AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0

Files changed:

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

@@ -0,1 +0,205 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Defines a filter used in Patch Manager APIs. Supported filter keys depend on the API operation that includes the filter. Patch Manager API operations that use <code>PatchOrchestratorFilter</code> include the following:</p>
           4  +
/// <ul>
           5  +
/// <li>
           6  +
/// <p><code>DescribeAvailablePatches</code></p></li>
           7  +
/// <li>
           8  +
/// <p><code>DescribeInstancePatches</code></p></li>
           9  +
/// <li>
          10  +
/// <p><code>DescribePatchBaselines</code></p></li>
          11  +
/// <li>
          12  +
/// <p><code>DescribePatchGroups</code></p></li>
          13  +
/// </ul>
          14  +
#[non_exhaustive]
          15  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          16  +
pub struct PatchOrchestratorFilter {
          17  +
    /// <p>The key for the filter.</p>
          18  +
    pub key: ::std::option::Option<::std::string::String>,
          19  +
    /// <p>The value for the filter.</p>
          20  +
    pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          21  +
}
          22  +
impl PatchOrchestratorFilter {
          23  +
    /// <p>The key for the filter.</p>
          24  +
    pub fn key(&self) -> ::std::option::Option<&str> {
          25  +
        self.key.as_deref()
          26  +
    }
          27  +
    /// <p>The value for the filter.</p>
          28  +
    ///
          29  +
    /// 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()`.
          30  +
    pub fn values(&self) -> &[::std::string::String] {
          31  +
        self.values.as_deref().unwrap_or_default()
          32  +
    }
          33  +
}
          34  +
static PATCHORCHESTRATORFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts(
          36  +
        "com.amazonaws.ssm#PatchOrchestratorFilter$Key",
          37  +
        "com.amazonaws.ssm",
          38  +
        "PatchOrchestratorFilter",
          39  +
    ),
          40  +
    ::aws_smithy_schema::ShapeType::String,
          41  +
    "Key",
          42  +
    0,
          43  +
);
          44  +
static PATCHORCHESTRATORFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          45  +
    ::aws_smithy_schema::ShapeId::from_parts(
          46  +
        "com.amazonaws.ssm#PatchOrchestratorFilterValues$member",
          47  +
        "com.amazonaws.ssm",
          48  +
        "PatchOrchestratorFilterValues",
          49  +
    ),
          50  +
    ::aws_smithy_schema::ShapeType::String,
          51  +
    "member",
          52  +
    0,
          53  +
);
          54  +
static PATCHORCHESTRATORFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          55  +
    ::aws_smithy_schema::ShapeId::from_parts(
          56  +
        "com.amazonaws.ssm#PatchOrchestratorFilter$Values",
          57  +
        "com.amazonaws.ssm",
          58  +
        "PatchOrchestratorFilter",
          59  +
    ),
          60  +
    ::aws_smithy_schema::ShapeType::List,
          61  +
    "Values",
          62  +
    1,
          63  +
)
          64  +
.with_list_member(&PATCHORCHESTRATORFILTER_MEMBER_VALUES_MEMBER);
          65  +
static PATCHORCHESTRATORFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          66  +
    ::aws_smithy_schema::ShapeId::from_parts(
          67  +
        "com.amazonaws.ssm#PatchOrchestratorFilter",
          68  +
        "com.amazonaws.ssm",
          69  +
        "PatchOrchestratorFilter",
          70  +
    ),
          71  +
    ::aws_smithy_schema::ShapeType::Structure,
          72  +
    &[&PATCHORCHESTRATORFILTER_MEMBER_KEY, &PATCHORCHESTRATORFILTER_MEMBER_VALUES],
          73  +
);
          74  +
impl PatchOrchestratorFilter {
          75  +
    /// The schema for this shape.
          76  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PATCHORCHESTRATORFILTER_SCHEMA;
          77  +
}
          78  +
impl ::aws_smithy_schema::serde::SerializableStruct for PatchOrchestratorFilter {
          79  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          80  +
    fn serialize_members(
          81  +
        &self,
          82  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          83  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          84  +
        if let Some(ref val) = self.key {
          85  +
            ser.write_string(&PATCHORCHESTRATORFILTER_MEMBER_KEY, val)?;
          86  +
        }
          87  +
        if let Some(ref val) = self.values {
          88  +
            ser.write_list(
          89  +
                &PATCHORCHESTRATORFILTER_MEMBER_VALUES,
          90  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          91  +
                    for item in val {
          92  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
          93  +
                    }
          94  +
                    Ok(())
          95  +
                },
          96  +
            )?;
          97  +
        }
          98  +
        Ok(())
          99  +
    }
         100  +
}
         101  +
impl PatchOrchestratorFilter {
         102  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         103  +
    pub fn deserialize(
         104  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         105  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         106  +
        #[allow(unused_variables, unused_mut)]
         107  +
        let mut builder = Self::builder();
         108  +
        #[allow(
         109  +
            unused_variables,
         110  +
            unreachable_code,
         111  +
            clippy::single_match,
         112  +
            clippy::match_single_binding,
         113  +
            clippy::diverging_sub_expression
         114  +
        )]
         115  +
        deserializer.read_struct(&PATCHORCHESTRATORFILTER_SCHEMA, &mut |member, deser| {
         116  +
            match member.member_index() {
         117  +
                Some(0) => {
         118  +
                    if deser.is_null() {
         119  +
                        deser.read_null()?;
         120  +
                    } else {
         121  +
                        builder.key = Some(deser.read_string(member)?);
         122  +
                    }
         123  +
                }
         124  +
                Some(1) => {
         125  +
                    if deser.is_null() {
         126  +
                        deser.read_null()?;
         127  +
                    } else {
         128  +
                        builder.values = Some(deser.read_string_list(member)?);
         129  +
                    }
         130  +
                }
         131  +
                _ => {}
         132  +
            }
         133  +
            Ok(())
         134  +
        })?;
         135  +
        Ok(builder.build())
         136  +
    }
         137  +
}
         138  +
impl PatchOrchestratorFilter {
         139  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         140  +
    pub fn deserialize_with_response(
         141  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         142  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         143  +
        _status: u16,
         144  +
        _body: &[u8],
         145  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         146  +
        Self::deserialize(deserializer)
         147  +
    }
         148  +
}
         149  +
impl PatchOrchestratorFilter {
         150  +
    /// Creates a new builder-style object to manufacture [`PatchOrchestratorFilter`](crate::types::PatchOrchestratorFilter).
         151  +
    pub fn builder() -> crate::types::builders::PatchOrchestratorFilterBuilder {
         152  +
        crate::types::builders::PatchOrchestratorFilterBuilder::default()
         153  +
    }
         154  +
}
         155  +
         156  +
/// A builder for [`PatchOrchestratorFilter`](crate::types::PatchOrchestratorFilter).
         157  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         158  +
#[non_exhaustive]
         159  +
pub struct PatchOrchestratorFilterBuilder {
         160  +
    pub(crate) key: ::std::option::Option<::std::string::String>,
         161  +
    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         162  +
}
         163  +
impl PatchOrchestratorFilterBuilder {
         164  +
    /// <p>The key for the filter.</p>
         165  +
    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         166  +
        self.key = ::std::option::Option::Some(input.into());
         167  +
        self
         168  +
    }
         169  +
    /// <p>The key for the filter.</p>
         170  +
    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         171  +
        self.key = input;
         172  +
        self
         173  +
    }
         174  +
    /// <p>The key for the filter.</p>
         175  +
    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
         176  +
        &self.key
         177  +
    }
         178  +
    /// Appends an item to `values`.
         179  +
    ///
         180  +
    /// To override the contents of this collection use [`set_values`](Self::set_values).
         181  +
    ///
         182  +
    /// <p>The value for the filter.</p>
         183  +
    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         184  +
        let mut v = self.values.unwrap_or_default();
         185  +
        v.push(input.into());
         186  +
        self.values = ::std::option::Option::Some(v);
         187  +
        self
         188  +
    }
         189  +
    /// <p>The value for the filter.</p>
         190  +
    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         191  +
        self.values = input;
         192  +
        self
         193  +
    }
         194  +
    /// <p>The value for the filter.</p>
         195  +
    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         196  +
        &self.values
         197  +
    }
         198  +
    /// Consumes the builder and constructs a [`PatchOrchestratorFilter`](crate::types::PatchOrchestratorFilter).
         199  +
    pub fn build(self) -> crate::types::PatchOrchestratorFilter {
         200  +
        crate::types::PatchOrchestratorFilter {
         201  +
            key: self.key,
         202  +
            values: self.values,
         203  +
        }
         204  +
    }
         205  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_patch_property.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 `PatchProperty`, 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 patchproperty = unimplemented!();
          14  +
/// match patchproperty {
          15  +
///     PatchProperty::PatchClassification => { /* ... */ },
          16  +
///     PatchProperty::PatchMsrcSeverity => { /* ... */ },
          17  +
///     PatchProperty::PatchPriority => { /* ... */ },
          18  +
///     PatchProperty::Product => { /* ... */ },
          19  +
///     PatchProperty::PatchProductFamily => { /* ... */ },
          20  +
///     PatchProperty::PatchSeverity => { /* ... */ },
          21  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          22  +
///     _ => { /* ... */ },
          23  +
/// }
          24  +
/// ```
          25  +
/// The above code demonstrates that when `patchproperty` represents
          26  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          27  +
/// even though the enum does not contain a variant `PatchProperty::NewFeature`
          28  +
/// in the current version of SDK. The reason is that the variable `other`,
          29  +
/// created by the `@` operator, is bound to
          30  +
/// `PatchProperty::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 `PatchProperty::NewFeature` is defined.
          34  +
/// Specifically, when `patchproperty` represents `NewFeature`,
          35  +
/// the execution path will hit the second last match arm as before by virtue of
          36  +
/// calling `as_str` on `PatchProperty::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 PatchProperty {
          49  +
    #[allow(missing_docs)] // documentation missing in model
          50  +
    PatchClassification,
          51  +
    #[allow(missing_docs)] // documentation missing in model
          52  +
    PatchMsrcSeverity,
          53  +
    #[allow(missing_docs)] // documentation missing in model
          54  +
    PatchPriority,
          55  +
    #[allow(missing_docs)] // documentation missing in model
          56  +
    Product,
          57  +
    #[allow(missing_docs)] // documentation missing in model
          58  +
    PatchProductFamily,
          59  +
    #[allow(missing_docs)] // documentation missing in model
          60  +
    PatchSeverity,
          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 PatchProperty {
          66  +
    fn from(s: &str) -> Self {
          67  +
        match s {
          68  +
            "CLASSIFICATION" => PatchProperty::PatchClassification,
          69  +
            "MSRC_SEVERITY" => PatchProperty::PatchMsrcSeverity,
          70  +
            "PRIORITY" => PatchProperty::PatchPriority,
          71  +
            "PRODUCT" => PatchProperty::Product,
          72  +
            "PRODUCT_FAMILY" => PatchProperty::PatchProductFamily,
          73  +
            "SEVERITY" => PatchProperty::PatchSeverity,
          74  +
            other => PatchProperty::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          75  +
        }
          76  +
    }
          77  +
}
          78  +
impl ::std::str::FromStr for PatchProperty {
          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(PatchProperty::from(s))
          83  +
    }
          84  +
}
          85  +
impl PatchProperty {
          86  +
    /// Returns the `&str` value of the enum member.
          87  +
    pub fn as_str(&self) -> &str {
          88  +
        match self {
          89  +
            PatchProperty::PatchClassification => "CLASSIFICATION",
          90  +
            PatchProperty::PatchMsrcSeverity => "MSRC_SEVERITY",
          91  +
            PatchProperty::PatchPriority => "PRIORITY",
          92  +
            PatchProperty::Product => "PRODUCT",
          93  +
            PatchProperty::PatchProductFamily => "PRODUCT_FAMILY",
          94  +
            PatchProperty::PatchSeverity => "SEVERITY",
          95  +
            PatchProperty::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  +
        &["CLASSIFICATION", "MSRC_SEVERITY", "PRIORITY", "PRODUCT", "PRODUCT_FAMILY", "SEVERITY"]
         101  +
    }
         102  +
}
         103  +
impl ::std::convert::AsRef<str> for PatchProperty {
         104  +
    fn as_ref(&self) -> &str {
         105  +
        self.as_str()
         106  +
    }
         107  +
}
         108  +
impl PatchProperty {
         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 PatchProperty {
         121  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         122  +
        match self {
         123  +
            PatchProperty::PatchClassification => write!(f, "CLASSIFICATION"),
         124  +
            PatchProperty::PatchMsrcSeverity => write!(f, "MSRC_SEVERITY"),
         125  +
            PatchProperty::PatchPriority => write!(f, "PRIORITY"),
         126  +
            PatchProperty::Product => write!(f, "PRODUCT"),
         127  +
            PatchProperty::PatchProductFamily => write!(f, "PRODUCT_FAMILY"),
         128  +
            PatchProperty::PatchSeverity => write!(f, "SEVERITY"),
         129  +
            PatchProperty::Unknown(value) => write!(f, "{value}"),
         130  +
        }
         131  +
    }
         132  +
}

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

@@ -0,1 +0,332 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Defines an approval rule for a patch baseline.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct PatchRule {
           7  +
    /// <p>The patch filter group that defines the criteria for the rule.</p>
           8  +
    pub patch_filter_group: ::std::option::Option<crate::types::PatchFilterGroup>,
           9  +
    /// <p>A compliance severity level for all approved patches in a patch baseline.</p>
          10  +
    pub compliance_level: ::std::option::Option<crate::types::PatchComplianceLevel>,
          11  +
    /// <p>The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of <code>7</code> means that patches are approved seven days after they are released.</p>
          12  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If a patch is released at <code>2025-11-09T18:00:00Z</code> and <code>ApproveAfterDays</code> is set to <code>7</code>, the patch will be approved after <code>2025-11-16T18:00:00Z</code>.</p>
          13  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveAfterDays</code> or <code>ApproveUntilDate</code>.</p>
          14  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
          15  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          16  +
    /// </important>
          17  +
    pub approve_after_days: ::std::option::Option<i32>,
          18  +
    /// <p>The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically.</p>
          19  +
    /// <p>Enter dates in the format <code>YYYY-MM-DD</code>. For example, <code>2025-11-16</code>.</p>
          20  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If you enter the date <code>2025-11-16</code>, patches released between <code>2025-11-16T00:00:00Z</code> and <code>2025-11-16T23:59:59Z</code> will be included in the approval.</p>
          21  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveUntilDate</code> or <code>ApproveAfterDays</code>.</p>
          22  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
          23  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          24  +
    /// </important>
          25  +
    pub approve_until_date: ::std::option::Option<::std::string::String>,
          26  +
    /// <p>For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is <code>false</code>. Applies to Linux managed nodes only.</p>
          27  +
    pub enable_non_security: ::std::option::Option<bool>,
          28  +
}
          29  +
impl PatchRule {
          30  +
    /// <p>The patch filter group that defines the criteria for the rule.</p>
          31  +
    pub fn patch_filter_group(&self) -> ::std::option::Option<&crate::types::PatchFilterGroup> {
          32  +
        self.patch_filter_group.as_ref()
          33  +
    }
          34  +
    /// <p>A compliance severity level for all approved patches in a patch baseline.</p>
          35  +
    pub fn compliance_level(&self) -> ::std::option::Option<&crate::types::PatchComplianceLevel> {
          36  +
        self.compliance_level.as_ref()
          37  +
    }
          38  +
    /// <p>The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of <code>7</code> means that patches are approved seven days after they are released.</p>
          39  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If a patch is released at <code>2025-11-09T18:00:00Z</code> and <code>ApproveAfterDays</code> is set to <code>7</code>, the patch will be approved after <code>2025-11-16T18:00:00Z</code>.</p>
          40  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveAfterDays</code> or <code>ApproveUntilDate</code>.</p>
          41  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
          42  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          43  +
    /// </important>
          44  +
    pub fn approve_after_days(&self) -> ::std::option::Option<i32> {
          45  +
        self.approve_after_days
          46  +
    }
          47  +
    /// <p>The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically.</p>
          48  +
    /// <p>Enter dates in the format <code>YYYY-MM-DD</code>. For example, <code>2025-11-16</code>.</p>
          49  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If you enter the date <code>2025-11-16</code>, patches released between <code>2025-11-16T00:00:00Z</code> and <code>2025-11-16T23:59:59Z</code> will be included in the approval.</p>
          50  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveUntilDate</code> or <code>ApproveAfterDays</code>.</p>
          51  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
          52  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          53  +
    /// </important>
          54  +
    pub fn approve_until_date(&self) -> ::std::option::Option<&str> {
          55  +
        self.approve_until_date.as_deref()
          56  +
    }
          57  +
    /// <p>For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is <code>false</code>. Applies to Linux managed nodes only.</p>
          58  +
    pub fn enable_non_security(&self) -> ::std::option::Option<bool> {
          59  +
        self.enable_non_security
          60  +
    }
          61  +
}
          62  +
static PATCHRULE_MEMBER_PATCH_FILTER_GROUP: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRule$PatchFilterGroup", "com.amazonaws.ssm", "PatchRule"),
          64  +
    ::aws_smithy_schema::ShapeType::Structure,
          65  +
    "PatchFilterGroup",
          66  +
    0,
          67  +
);
          68  +
static PATCHRULE_MEMBER_COMPLIANCE_LEVEL: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          69  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRule$ComplianceLevel", "com.amazonaws.ssm", "PatchRule"),
          70  +
    ::aws_smithy_schema::ShapeType::String,
          71  +
    "ComplianceLevel",
          72  +
    1,
          73  +
);
          74  +
static PATCHRULE_MEMBER_APPROVE_AFTER_DAYS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          75  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRule$ApproveAfterDays", "com.amazonaws.ssm", "PatchRule"),
          76  +
    ::aws_smithy_schema::ShapeType::Integer,
          77  +
    "ApproveAfterDays",
          78  +
    2,
          79  +
);
          80  +
static PATCHRULE_MEMBER_APPROVE_UNTIL_DATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          81  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRule$ApproveUntilDate", "com.amazonaws.ssm", "PatchRule"),
          82  +
    ::aws_smithy_schema::ShapeType::String,
          83  +
    "ApproveUntilDate",
          84  +
    3,
          85  +
);
          86  +
static PATCHRULE_MEMBER_ENABLE_NON_SECURITY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          87  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRule$EnableNonSecurity", "com.amazonaws.ssm", "PatchRule"),
          88  +
    ::aws_smithy_schema::ShapeType::Boolean,
          89  +
    "EnableNonSecurity",
          90  +
    4,
          91  +
);
          92  +
static PATCHRULE_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          93  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRule", "com.amazonaws.ssm", "PatchRule"),
          94  +
    ::aws_smithy_schema::ShapeType::Structure,
          95  +
    &[
          96  +
        &PATCHRULE_MEMBER_PATCH_FILTER_GROUP,
          97  +
        &PATCHRULE_MEMBER_COMPLIANCE_LEVEL,
          98  +
        &PATCHRULE_MEMBER_APPROVE_AFTER_DAYS,
          99  +
        &PATCHRULE_MEMBER_APPROVE_UNTIL_DATE,
         100  +
        &PATCHRULE_MEMBER_ENABLE_NON_SECURITY,
         101  +
    ],
         102  +
);
         103  +
impl PatchRule {
         104  +
    /// The schema for this shape.
         105  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PATCHRULE_SCHEMA;
         106  +
}
         107  +
impl ::aws_smithy_schema::serde::SerializableStruct for PatchRule {
         108  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         109  +
    fn serialize_members(
         110  +
        &self,
         111  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         112  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         113  +
        if let Some(ref val) = self.patch_filter_group {
         114  +
            ser.write_struct(&PATCHRULE_MEMBER_PATCH_FILTER_GROUP, val)?;
         115  +
        }
         116  +
        if let Some(ref val) = self.compliance_level {
         117  +
            ser.write_string(&PATCHRULE_MEMBER_COMPLIANCE_LEVEL, val.as_str())?;
         118  +
        }
         119  +
        if let Some(ref val) = self.approve_after_days {
         120  +
            ser.write_integer(&PATCHRULE_MEMBER_APPROVE_AFTER_DAYS, *val)?;
         121  +
        }
         122  +
        if let Some(ref val) = self.approve_until_date {
         123  +
            ser.write_string(&PATCHRULE_MEMBER_APPROVE_UNTIL_DATE, val)?;
         124  +
        }
         125  +
        if let Some(ref val) = self.enable_non_security {
         126  +
            ser.write_boolean(&PATCHRULE_MEMBER_ENABLE_NON_SECURITY, *val)?;
         127  +
        }
         128  +
        Ok(())
         129  +
    }
         130  +
}
         131  +
impl PatchRule {
         132  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         133  +
    pub fn deserialize(
         134  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         135  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         136  +
        #[allow(unused_variables, unused_mut)]
         137  +
        let mut builder = Self::builder();
         138  +
        #[allow(
         139  +
            unused_variables,
         140  +
            unreachable_code,
         141  +
            clippy::single_match,
         142  +
            clippy::match_single_binding,
         143  +
            clippy::diverging_sub_expression
         144  +
        )]
         145  +
        deserializer.read_struct(&PATCHRULE_SCHEMA, &mut |member, deser| {
         146  +
            match member.member_index() {
         147  +
                Some(0) => {
         148  +
                    if deser.is_null() {
         149  +
                        deser.read_null()?;
         150  +
                    } else {
         151  +
                        builder.patch_filter_group = Some(crate::types::PatchFilterGroup::deserialize(deser)?);
         152  +
                    }
         153  +
                }
         154  +
                Some(1) => {
         155  +
                    if deser.is_null() {
         156  +
                        deser.read_null()?;
         157  +
                    } else {
         158  +
                        builder.compliance_level = Some(crate::types::PatchComplianceLevel::from(deser.read_string(member)?.as_str()));
         159  +
                    }
         160  +
                }
         161  +
                Some(2) => {
         162  +
                    if deser.is_null() {
         163  +
                        deser.read_null()?;
         164  +
                    } else {
         165  +
                        builder.approve_after_days = Some(deser.read_integer(member)?);
         166  +
                    }
         167  +
                }
         168  +
                Some(3) => {
         169  +
                    if deser.is_null() {
         170  +
                        deser.read_null()?;
         171  +
                    } else {
         172  +
                        builder.approve_until_date = Some(deser.read_string(member)?);
         173  +
                    }
         174  +
                }
         175  +
                Some(4) => {
         176  +
                    if deser.is_null() {
         177  +
                        deser.read_null()?;
         178  +
                    } else {
         179  +
                        builder.enable_non_security = Some(deser.read_boolean(member)?);
         180  +
                    }
         181  +
                }
         182  +
                _ => {}
         183  +
            }
         184  +
            Ok(())
         185  +
        })?;
         186  +
        Ok(builder.build())
         187  +
    }
         188  +
}
         189  +
impl PatchRule {
         190  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         191  +
    pub fn deserialize_with_response(
         192  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         193  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         194  +
        _status: u16,
         195  +
        _body: &[u8],
         196  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         197  +
        Self::deserialize(deserializer)
         198  +
    }
         199  +
}
         200  +
impl PatchRule {
         201  +
    /// Creates a new builder-style object to manufacture [`PatchRule`](crate::types::PatchRule).
         202  +
    pub fn builder() -> crate::types::builders::PatchRuleBuilder {
         203  +
        crate::types::builders::PatchRuleBuilder::default()
         204  +
    }
         205  +
}
         206  +
         207  +
/// A builder for [`PatchRule`](crate::types::PatchRule).
         208  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         209  +
#[non_exhaustive]
         210  +
pub struct PatchRuleBuilder {
         211  +
    pub(crate) patch_filter_group: ::std::option::Option<crate::types::PatchFilterGroup>,
         212  +
    pub(crate) compliance_level: ::std::option::Option<crate::types::PatchComplianceLevel>,
         213  +
    pub(crate) approve_after_days: ::std::option::Option<i32>,
         214  +
    pub(crate) approve_until_date: ::std::option::Option<::std::string::String>,
         215  +
    pub(crate) enable_non_security: ::std::option::Option<bool>,
         216  +
}
         217  +
impl PatchRuleBuilder {
         218  +
    /// <p>The patch filter group that defines the criteria for the rule.</p>
         219  +
    /// This field is required.
         220  +
    pub fn patch_filter_group(mut self, input: crate::types::PatchFilterGroup) -> Self {
         221  +
        self.patch_filter_group = ::std::option::Option::Some(input);
         222  +
        self
         223  +
    }
         224  +
    /// <p>The patch filter group that defines the criteria for the rule.</p>
         225  +
    pub fn set_patch_filter_group(mut self, input: ::std::option::Option<crate::types::PatchFilterGroup>) -> Self {
         226  +
        self.patch_filter_group = input;
         227  +
        self
         228  +
    }
         229  +
    /// <p>The patch filter group that defines the criteria for the rule.</p>
         230  +
    pub fn get_patch_filter_group(&self) -> &::std::option::Option<crate::types::PatchFilterGroup> {
         231  +
        &self.patch_filter_group
         232  +
    }
         233  +
    /// <p>A compliance severity level for all approved patches in a patch baseline.</p>
         234  +
    pub fn compliance_level(mut self, input: crate::types::PatchComplianceLevel) -> Self {
         235  +
        self.compliance_level = ::std::option::Option::Some(input);
         236  +
        self
         237  +
    }
         238  +
    /// <p>A compliance severity level for all approved patches in a patch baseline.</p>
         239  +
    pub fn set_compliance_level(mut self, input: ::std::option::Option<crate::types::PatchComplianceLevel>) -> Self {
         240  +
        self.compliance_level = input;
         241  +
        self
         242  +
    }
         243  +
    /// <p>A compliance severity level for all approved patches in a patch baseline.</p>
         244  +
    pub fn get_compliance_level(&self) -> &::std::option::Option<crate::types::PatchComplianceLevel> {
         245  +
        &self.compliance_level
         246  +
    }
         247  +
    /// <p>The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of <code>7</code> means that patches are approved seven days after they are released.</p>
         248  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If a patch is released at <code>2025-11-09T18:00:00Z</code> and <code>ApproveAfterDays</code> is set to <code>7</code>, the patch will be approved after <code>2025-11-16T18:00:00Z</code>.</p>
         249  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveAfterDays</code> or <code>ApproveUntilDate</code>.</p>
         250  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
         251  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         252  +
    /// </important>
         253  +
    pub fn approve_after_days(mut self, input: i32) -> Self {
         254  +
        self.approve_after_days = ::std::option::Option::Some(input);
         255  +
        self
         256  +
    }
         257  +
    /// <p>The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of <code>7</code> means that patches are approved seven days after they are released.</p>
         258  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If a patch is released at <code>2025-11-09T18:00:00Z</code> and <code>ApproveAfterDays</code> is set to <code>7</code>, the patch will be approved after <code>2025-11-16T18:00:00Z</code>.</p>
         259  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveAfterDays</code> or <code>ApproveUntilDate</code>.</p>
         260  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
         261  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         262  +
    /// </important>
         263  +
    pub fn set_approve_after_days(mut self, input: ::std::option::Option<i32>) -> Self {
         264  +
        self.approve_after_days = input;
         265  +
        self
         266  +
    }
         267  +
    /// <p>The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of <code>7</code> means that patches are approved seven days after they are released.</p>
         268  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If a patch is released at <code>2025-11-09T18:00:00Z</code> and <code>ApproveAfterDays</code> is set to <code>7</code>, the patch will be approved after <code>2025-11-16T18:00:00Z</code>.</p>
         269  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveAfterDays</code> or <code>ApproveUntilDate</code>.</p>
         270  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
         271  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         272  +
    /// </important>
         273  +
    pub fn get_approve_after_days(&self) -> &::std::option::Option<i32> {
         274  +
        &self.approve_after_days
         275  +
    }
         276  +
    /// <p>The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically.</p>
         277  +
    /// <p>Enter dates in the format <code>YYYY-MM-DD</code>. For example, <code>2025-11-16</code>.</p>
         278  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If you enter the date <code>2025-11-16</code>, patches released between <code>2025-11-16T00:00:00Z</code> and <code>2025-11-16T23:59:59Z</code> will be included in the approval.</p>
         279  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveUntilDate</code> or <code>ApproveAfterDays</code>.</p>
         280  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
         281  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         282  +
    /// </important>
         283  +
    pub fn approve_until_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         284  +
        self.approve_until_date = ::std::option::Option::Some(input.into());
         285  +
        self
         286  +
    }
         287  +
    /// <p>The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically.</p>
         288  +
    /// <p>Enter dates in the format <code>YYYY-MM-DD</code>. For example, <code>2025-11-16</code>.</p>
         289  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If you enter the date <code>2025-11-16</code>, patches released between <code>2025-11-16T00:00:00Z</code> and <code>2025-11-16T23:59:59Z</code> will be included in the approval.</p>
         290  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveUntilDate</code> or <code>ApproveAfterDays</code>.</p>
         291  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
         292  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         293  +
    /// </important>
         294  +
    pub fn set_approve_until_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         295  +
        self.approve_until_date = input;
         296  +
        self
         297  +
    }
         298  +
    /// <p>The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically.</p>
         299  +
    /// <p>Enter dates in the format <code>YYYY-MM-DD</code>. For example, <code>2025-11-16</code>.</p>
         300  +
    /// <p>Patch Manager evaluates patch release dates using Coordinated Universal Time (UTC). If you enter the date <code>2025-11-16</code>, patches released between <code>2025-11-16T00:00:00Z</code> and <code>2025-11-16T23:59:59Z</code> will be included in the approval.</p>
         301  +
    /// <p>This parameter is marked as <code>Required: No</code>, but your request must include a value for either <code>ApproveUntilDate</code> or <code>ApproveAfterDays</code>.</p>
         302  +
    /// <p>Not supported for Debian Server or Ubuntu Server.</p><important>
         303  +
    /// <p>Use caution when setting this value for Windows Server patch baselines. Because patch updates that are replaced by later updates are removed, setting too broad a value for this parameter can result in crucial patches not being installed. For more information, see the <b>Windows Server</b> tab in the topic <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-selecting-patches.html">How security patches are selected</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         304  +
    /// </important>
         305  +
    pub fn get_approve_until_date(&self) -> &::std::option::Option<::std::string::String> {
         306  +
        &self.approve_until_date
         307  +
    }
         308  +
    /// <p>For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is <code>false</code>. Applies to Linux managed nodes only.</p>
         309  +
    pub fn enable_non_security(mut self, input: bool) -> Self {
         310  +
        self.enable_non_security = ::std::option::Option::Some(input);
         311  +
        self
         312  +
    }
         313  +
    /// <p>For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is <code>false</code>. Applies to Linux managed nodes only.</p>
         314  +
    pub fn set_enable_non_security(mut self, input: ::std::option::Option<bool>) -> Self {
         315  +
        self.enable_non_security = input;
         316  +
        self
         317  +
    }
         318  +
    /// <p>For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is <code>false</code>. Applies to Linux managed nodes only.</p>
         319  +
    pub fn get_enable_non_security(&self) -> &::std::option::Option<bool> {
         320  +
        &self.enable_non_security
         321  +
    }
         322  +
    /// Consumes the builder and constructs a [`PatchRule`](crate::types::PatchRule).
         323  +
    pub fn build(self) -> crate::types::PatchRule {
         324  +
        crate::types::PatchRule {
         325  +
            patch_filter_group: self.patch_filter_group,
         326  +
            compliance_level: self.compliance_level,
         327  +
            approve_after_days: self.approve_after_days,
         328  +
            approve_until_date: self.approve_until_date,
         329  +
            enable_non_security: self.enable_non_security,
         330  +
        }
         331  +
    }
         332  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_patch_rule_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 rules defining the approval rules for a patch baseline.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct PatchRuleGroup {
           7  +
    /// <p>The rules that make up the rule group.</p>
           8  +
    pub patch_rules: ::std::vec::Vec<crate::types::PatchRule>,
           9  +
}
          10  +
impl PatchRuleGroup {
          11  +
    /// <p>The rules that make up the rule group.</p>
          12  +
    pub fn patch_rules(&self) -> &[crate::types::PatchRule] {
          13  +
        use std::ops::Deref;
          14  +
        self.patch_rules.deref()
          15  +
    }
          16  +
}
          17  +
static PATCHRULEGROUP_MEMBER_PATCH_RULES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          18  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRuleList$member", "com.amazonaws.ssm", "PatchRuleList"),
          19  +
    ::aws_smithy_schema::ShapeType::Structure,
          20  +
    "member",
          21  +
    0,
          22  +
);
          23  +
static PATCHRULEGROUP_MEMBER_PATCH_RULES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          24  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRuleGroup$PatchRules", "com.amazonaws.ssm", "PatchRuleGroup"),
          25  +
    ::aws_smithy_schema::ShapeType::List,
          26  +
    "PatchRules",
          27  +
    0,
          28  +
)
          29  +
.with_list_member(&PATCHRULEGROUP_MEMBER_PATCH_RULES_MEMBER);
          30  +
static PATCHRULEGROUP_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          31  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchRuleGroup", "com.amazonaws.ssm", "PatchRuleGroup"),
          32  +
    ::aws_smithy_schema::ShapeType::Structure,
          33  +
    &[&PATCHRULEGROUP_MEMBER_PATCH_RULES],
          34  +
);
          35  +
impl PatchRuleGroup {
          36  +
    /// The schema for this shape.
          37  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PATCHRULEGROUP_SCHEMA;
          38  +
}
          39  +
impl ::aws_smithy_schema::serde::SerializableStruct for PatchRuleGroup {
          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_rules;
          47  +
          48  +
            ser.write_list(
          49  +
                &PATCHRULEGROUP_MEMBER_PATCH_RULES,
          50  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          51  +
                    for item in val {
          52  +
                        ser.write_struct(crate::types::PatchRule::SCHEMA, item)?;
          53  +
                    }
          54  +
                    Ok(())
          55  +
                },
          56  +
            )?;
          57  +
        }
          58  +
        Ok(())
          59  +
    }
          60  +
}
          61  +
impl PatchRuleGroup {
          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(&PATCHRULEGROUP_SCHEMA, &mut |member, deser| {
          76  +
            match member.member_index() {
          77  +
                Some(0) => {
          78  +
                    builder.patch_rules = Some({
          79  +
                        let mut container = Vec::new();
          80  +
                        deser.read_list(member, &mut |deser| {
          81  +
                            container.push(crate::types::PatchRule::deserialize(deser)?);
          82  +
                            Ok(())
          83  +
                        })?;
          84  +
                        container
          85  +
                    });
          86  +
                }
          87  +
                _ => {}
          88  +
            }
          89  +
            Ok(())
          90  +
        })?;
          91  +
        builder.patch_rules = builder.patch_rules.or(Some(Vec::new()));
          92  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          93  +
    }
          94  +
}
          95  +
impl PatchRuleGroup {
          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 PatchRuleGroup {
         107  +
    /// Creates a new builder-style object to manufacture [`PatchRuleGroup`](crate::types::PatchRuleGroup).
         108  +
    pub fn builder() -> crate::types::builders::PatchRuleGroupBuilder {
         109  +
        crate::types::builders::PatchRuleGroupBuilder::default()
         110  +
    }
         111  +
}
         112  +
         113  +
/// A builder for [`PatchRuleGroup`](crate::types::PatchRuleGroup).
         114  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         115  +
#[non_exhaustive]
         116  +
pub struct PatchRuleGroupBuilder {
         117  +
    pub(crate) patch_rules: ::std::option::Option<::std::vec::Vec<crate::types::PatchRule>>,
         118  +
}
         119  +
impl PatchRuleGroupBuilder {
         120  +
    /// Appends an item to `patch_rules`.
         121  +
    ///
         122  +
    /// To override the contents of this collection use [`set_patch_rules`](Self::set_patch_rules).
         123  +
    ///
         124  +
    /// <p>The rules that make up the rule group.</p>
         125  +
    pub fn patch_rules(mut self, input: crate::types::PatchRule) -> Self {
         126  +
        let mut v = self.patch_rules.unwrap_or_default();
         127  +
        v.push(input);
         128  +
        self.patch_rules = ::std::option::Option::Some(v);
         129  +
        self
         130  +
    }
         131  +
    /// <p>The rules that make up the rule group.</p>
         132  +
    pub fn set_patch_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchRule>>) -> Self {
         133  +
        self.patch_rules = input;
         134  +
        self
         135  +
    }
         136  +
    /// <p>The rules that make up the rule group.</p>
         137  +
    pub fn get_patch_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchRule>> {
         138  +
        &self.patch_rules
         139  +
    }
         140  +
    /// Consumes the builder and constructs a [`PatchRuleGroup`](crate::types::PatchRuleGroup).
         141  +
    /// This method will fail if any of the following fields are not set:
         142  +
    /// - [`patch_rules`](crate::types::builders::PatchRuleGroupBuilder::patch_rules)
         143  +
    pub fn build(self) -> ::std::result::Result<crate::types::PatchRuleGroup, ::aws_smithy_types::error::operation::BuildError> {
         144  +
        ::std::result::Result::Ok(crate::types::PatchRuleGroup {
         145  +
            patch_rules: self.patch_rules.ok_or_else(|| {
         146  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         147  +
                    "patch_rules",
         148  +
                    "patch_rules was not specified but it is required when building PatchRuleGroup",
         149  +
                )
         150  +
            })?,
         151  +
        })
         152  +
    }
         153  +
}

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

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

@@ -0,1 +0,306 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about the patches to use to update the managed nodes, including target operating systems and source repository. Applies to Linux managed nodes only.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           6  +
pub struct PatchSource {
           7  +
    /// <p>The name specified to identify the patch source.</p>
           8  +
    pub name: ::std::string::String,
           9  +
    /// <p>The specific operating system versions a patch repository applies to, such as "Ubuntu16.04", "AmazonLinux2016.09", "RedhatEnterpriseLinux7.2" or "Suse12.7". For lists of supported product values, see <code>PatchFilter</code>.</p>
          10  +
    pub products: ::std::vec::Vec<::std::string::String>,
          11  +
    /// <p>The value of the repo configuration.</p>
          12  +
    /// <p><b>Example for yum repositories</b></p>
          13  +
    /// <p><code>\[main\]</code></p>
          14  +
    /// <p><code>name=MyCustomRepository</code></p>
          15  +
    /// <p><code>baseurl=https://my-custom-repository</code></p>
          16  +
    /// <p><code>enabled=1</code></p>
          17  +
    /// <p>For information about other options available for your yum repository configuration, see <a href="https://man7.org/linux/man-pages/man5/dnf.conf.5.html">dnf.conf(5)</a> on the <i>man7.org</i> website.</p>
          18  +
    /// <p><b>Examples for Ubuntu Server and Debian Server</b></p>
          19  +
    /// <p><code>deb http://security.ubuntu.com/ubuntu jammy main</code></p>
          20  +
    /// <p><code>deb https://site.example.com/debian distribution component1 component2 component3</code></p>
          21  +
    /// <p>Repo information for Ubuntu Server repositories must be specifed in a single line. For more examples and information, see <a href="https://manpages.ubuntu.com/manpages/jammy/man5/sources.list.5.html">jammy (5) sources.list.5.gz</a> on the <i>Ubuntu Server Manuals</i> website and <a href="https://wiki.debian.org/SourcesList#sources.list_format">sources.list format</a> on the <i>Debian Wiki</i>.</p>
          22  +
    pub configuration: ::std::string::String,
          23  +
}
          24  +
impl PatchSource {
          25  +
    /// <p>The name specified to identify the patch source.</p>
          26  +
    pub fn name(&self) -> &str {
          27  +
        use std::ops::Deref;
          28  +
        self.name.deref()
          29  +
    }
          30  +
    /// <p>The specific operating system versions a patch repository applies to, such as "Ubuntu16.04", "AmazonLinux2016.09", "RedhatEnterpriseLinux7.2" or "Suse12.7". For lists of supported product values, see <code>PatchFilter</code>.</p>
          31  +
    pub fn products(&self) -> &[::std::string::String] {
          32  +
        use std::ops::Deref;
          33  +
        self.products.deref()
          34  +
    }
          35  +
    /// <p>The value of the repo configuration.</p>
          36  +
    /// <p><b>Example for yum repositories</b></p>
          37  +
    /// <p><code>\[main\]</code></p>
          38  +
    /// <p><code>name=MyCustomRepository</code></p>
          39  +
    /// <p><code>baseurl=https://my-custom-repository</code></p>
          40  +
    /// <p><code>enabled=1</code></p>
          41  +
    /// <p>For information about other options available for your yum repository configuration, see <a href="https://man7.org/linux/man-pages/man5/dnf.conf.5.html">dnf.conf(5)</a> on the <i>man7.org</i> website.</p>
          42  +
    /// <p><b>Examples for Ubuntu Server and Debian Server</b></p>
          43  +
    /// <p><code>deb http://security.ubuntu.com/ubuntu jammy main</code></p>
          44  +
    /// <p><code>deb https://site.example.com/debian distribution component1 component2 component3</code></p>
          45  +
    /// <p>Repo information for Ubuntu Server repositories must be specifed in a single line. For more examples and information, see <a href="https://manpages.ubuntu.com/manpages/jammy/man5/sources.list.5.html">jammy (5) sources.list.5.gz</a> on the <i>Ubuntu Server Manuals</i> website and <a href="https://wiki.debian.org/SourcesList#sources.list_format">sources.list format</a> on the <i>Debian Wiki</i>.</p>
          46  +
    pub fn configuration(&self) -> &str {
          47  +
        use std::ops::Deref;
          48  +
        self.configuration.deref()
          49  +
    }
          50  +
}
          51  +
impl ::std::fmt::Debug for PatchSource {
          52  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          53  +
        let mut formatter = f.debug_struct("PatchSource");
          54  +
        formatter.field("name", &self.name);
          55  +
        formatter.field("products", &self.products);
          56  +
        formatter.field("configuration", &"*** Sensitive Data Redacted ***");
          57  +
        formatter.finish()
          58  +
    }
          59  +
}
          60  +
static PATCHSOURCE_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          61  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchSource$Name", "com.amazonaws.ssm", "PatchSource"),
          62  +
    ::aws_smithy_schema::ShapeType::String,
          63  +
    "Name",
          64  +
    0,
          65  +
);
          66  +
static PATCHSOURCE_MEMBER_PRODUCTS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          67  +
    ::aws_smithy_schema::ShapeId::from_parts(
          68  +
        "com.amazonaws.ssm#PatchSourceProductList$member",
          69  +
        "com.amazonaws.ssm",
          70  +
        "PatchSourceProductList",
          71  +
    ),
          72  +
    ::aws_smithy_schema::ShapeType::String,
          73  +
    "member",
          74  +
    0,
          75  +
);
          76  +
static PATCHSOURCE_MEMBER_PRODUCTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          77  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchSource$Products", "com.amazonaws.ssm", "PatchSource"),
          78  +
    ::aws_smithy_schema::ShapeType::List,
          79  +
    "Products",
          80  +
    1,
          81  +
)
          82  +
.with_list_member(&PATCHSOURCE_MEMBER_PRODUCTS_MEMBER);
          83  +
static PATCHSOURCE_MEMBER_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          84  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchSource$Configuration", "com.amazonaws.ssm", "PatchSource"),
          85  +
    ::aws_smithy_schema::ShapeType::String,
          86  +
    "Configuration",
          87  +
    2,
          88  +
);
          89  +
static PATCHSOURCE_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          90  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchSource", "com.amazonaws.ssm", "PatchSource"),
          91  +
    ::aws_smithy_schema::ShapeType::Structure,
          92  +
    &[&PATCHSOURCE_MEMBER_NAME, &PATCHSOURCE_MEMBER_PRODUCTS, &PATCHSOURCE_MEMBER_CONFIGURATION],
          93  +
);
          94  +
impl PatchSource {
          95  +
    /// The schema for this shape.
          96  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PATCHSOURCE_SCHEMA;
          97  +
}
          98  +
impl ::aws_smithy_schema::serde::SerializableStruct for PatchSource {
          99  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         100  +
    fn serialize_members(
         101  +
        &self,
         102  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         103  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         104  +
        {
         105  +
            let val = &self.name;
         106  +
            ser.write_string(&PATCHSOURCE_MEMBER_NAME, val)?;
         107  +
        }
         108  +
        {
         109  +
            let val = &self.products;
         110  +
         111  +
            ser.write_list(
         112  +
                &PATCHSOURCE_MEMBER_PRODUCTS,
         113  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         114  +
                    for item in val {
         115  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         116  +
                    }
         117  +
                    Ok(())
         118  +
                },
         119  +
            )?;
         120  +
        }
         121  +
        {
         122  +
            let val = &self.configuration;
         123  +
            ser.write_string(&PATCHSOURCE_MEMBER_CONFIGURATION, val)?;
         124  +
        }
         125  +
        Ok(())
         126  +
    }
         127  +
}
         128  +
impl PatchSource {
         129  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         130  +
    pub fn deserialize(
         131  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         132  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         133  +
        #[allow(unused_variables, unused_mut)]
         134  +
        let mut builder = Self::builder();
         135  +
        #[allow(
         136  +
            unused_variables,
         137  +
            unreachable_code,
         138  +
            clippy::single_match,
         139  +
            clippy::match_single_binding,
         140  +
            clippy::diverging_sub_expression
         141  +
        )]
         142  +
        deserializer.read_struct(&PATCHSOURCE_SCHEMA, &mut |member, deser| {
         143  +
            match member.member_index() {
         144  +
                Some(0) => {
         145  +
                    builder.name = Some(deser.read_string(member)?);
         146  +
                }
         147  +
                Some(1) => {
         148  +
                    builder.products = Some(deser.read_string_list(member)?);
         149  +
                }
         150  +
                Some(2) => {
         151  +
                    builder.configuration = Some(deser.read_string(member)?);
         152  +
                }
         153  +
                _ => {}
         154  +
            }
         155  +
            Ok(())
         156  +
        })?;
         157  +
        builder.name = builder.name.or(Some(String::new()));
         158  +
        builder.products = builder.products.or(Some(Vec::new()));
         159  +
        builder.configuration = builder.configuration.or(Some(String::new()));
         160  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         161  +
    }
         162  +
}
         163  +
impl PatchSource {
         164  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         165  +
    pub fn deserialize_with_response(
         166  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         167  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         168  +
        _status: u16,
         169  +
        _body: &[u8],
         170  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         171  +
        Self::deserialize(deserializer)
         172  +
    }
         173  +
}
         174  +
impl PatchSource {
         175  +
    /// Creates a new builder-style object to manufacture [`PatchSource`](crate::types::PatchSource).
         176  +
    pub fn builder() -> crate::types::builders::PatchSourceBuilder {
         177  +
        crate::types::builders::PatchSourceBuilder::default()
         178  +
    }
         179  +
}
         180  +
         181  +
/// A builder for [`PatchSource`](crate::types::PatchSource).
         182  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
         183  +
#[non_exhaustive]
         184  +
pub struct PatchSourceBuilder {
         185  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         186  +
    pub(crate) products: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         187  +
    pub(crate) configuration: ::std::option::Option<::std::string::String>,
         188  +
}
         189  +
impl PatchSourceBuilder {
         190  +
    /// <p>The name specified to identify the patch source.</p>
         191  +
    /// This field is required.
         192  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         193  +
        self.name = ::std::option::Option::Some(input.into());
         194  +
        self
         195  +
    }
         196  +
    /// <p>The name specified to identify the patch source.</p>
         197  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         198  +
        self.name = input;
         199  +
        self
         200  +
    }
         201  +
    /// <p>The name specified to identify the patch source.</p>
         202  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         203  +
        &self.name
         204  +
    }
         205  +
    /// Appends an item to `products`.
         206  +
    ///
         207  +
    /// To override the contents of this collection use [`set_products`](Self::set_products).
         208  +
    ///
         209  +
    /// <p>The specific operating system versions a patch repository applies to, such as "Ubuntu16.04", "AmazonLinux2016.09", "RedhatEnterpriseLinux7.2" or "Suse12.7". For lists of supported product values, see <code>PatchFilter</code>.</p>
         210  +
    pub fn products(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         211  +
        let mut v = self.products.unwrap_or_default();
         212  +
        v.push(input.into());
         213  +
        self.products = ::std::option::Option::Some(v);
         214  +
        self
         215  +
    }
         216  +
    /// <p>The specific operating system versions a patch repository applies to, such as "Ubuntu16.04", "AmazonLinux2016.09", "RedhatEnterpriseLinux7.2" or "Suse12.7". For lists of supported product values, see <code>PatchFilter</code>.</p>
         217  +
    pub fn set_products(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         218  +
        self.products = input;
         219  +
        self
         220  +
    }
         221  +
    /// <p>The specific operating system versions a patch repository applies to, such as "Ubuntu16.04", "AmazonLinux2016.09", "RedhatEnterpriseLinux7.2" or "Suse12.7". For lists of supported product values, see <code>PatchFilter</code>.</p>
         222  +
    pub fn get_products(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         223  +
        &self.products
         224  +
    }
         225  +
    /// <p>The value of the repo configuration.</p>
         226  +
    /// <p><b>Example for yum repositories</b></p>
         227  +
    /// <p><code>\[main\]</code></p>
         228  +
    /// <p><code>name=MyCustomRepository</code></p>
         229  +
    /// <p><code>baseurl=https://my-custom-repository</code></p>
         230  +
    /// <p><code>enabled=1</code></p>
         231  +
    /// <p>For information about other options available for your yum repository configuration, see <a href="https://man7.org/linux/man-pages/man5/dnf.conf.5.html">dnf.conf(5)</a> on the <i>man7.org</i> website.</p>
         232  +
    /// <p><b>Examples for Ubuntu Server and Debian Server</b></p>
         233  +
    /// <p><code>deb http://security.ubuntu.com/ubuntu jammy main</code></p>
         234  +
    /// <p><code>deb https://site.example.com/debian distribution component1 component2 component3</code></p>
         235  +
    /// <p>Repo information for Ubuntu Server repositories must be specifed in a single line. For more examples and information, see <a href="https://manpages.ubuntu.com/manpages/jammy/man5/sources.list.5.html">jammy (5) sources.list.5.gz</a> on the <i>Ubuntu Server Manuals</i> website and <a href="https://wiki.debian.org/SourcesList#sources.list_format">sources.list format</a> on the <i>Debian Wiki</i>.</p>
         236  +
    /// This field is required.
         237  +
    pub fn configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         238  +
        self.configuration = ::std::option::Option::Some(input.into());
         239  +
        self
         240  +
    }
         241  +
    /// <p>The value of the repo configuration.</p>
         242  +
    /// <p><b>Example for yum repositories</b></p>
         243  +
    /// <p><code>\[main\]</code></p>
         244  +
    /// <p><code>name=MyCustomRepository</code></p>
         245  +
    /// <p><code>baseurl=https://my-custom-repository</code></p>
         246  +
    /// <p><code>enabled=1</code></p>
         247  +
    /// <p>For information about other options available for your yum repository configuration, see <a href="https://man7.org/linux/man-pages/man5/dnf.conf.5.html">dnf.conf(5)</a> on the <i>man7.org</i> website.</p>
         248  +
    /// <p><b>Examples for Ubuntu Server and Debian Server</b></p>
         249  +
    /// <p><code>deb http://security.ubuntu.com/ubuntu jammy main</code></p>
         250  +
    /// <p><code>deb https://site.example.com/debian distribution component1 component2 component3</code></p>
         251  +
    /// <p>Repo information for Ubuntu Server repositories must be specifed in a single line. For more examples and information, see <a href="https://manpages.ubuntu.com/manpages/jammy/man5/sources.list.5.html">jammy (5) sources.list.5.gz</a> on the <i>Ubuntu Server Manuals</i> website and <a href="https://wiki.debian.org/SourcesList#sources.list_format">sources.list format</a> on the <i>Debian Wiki</i>.</p>
         252  +
    pub fn set_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         253  +
        self.configuration = input;
         254  +
        self
         255  +
    }
         256  +
    /// <p>The value of the repo configuration.</p>
         257  +
    /// <p><b>Example for yum repositories</b></p>
         258  +
    /// <p><code>\[main\]</code></p>
         259  +
    /// <p><code>name=MyCustomRepository</code></p>
         260  +
    /// <p><code>baseurl=https://my-custom-repository</code></p>
         261  +
    /// <p><code>enabled=1</code></p>
         262  +
    /// <p>For information about other options available for your yum repository configuration, see <a href="https://man7.org/linux/man-pages/man5/dnf.conf.5.html">dnf.conf(5)</a> on the <i>man7.org</i> website.</p>
         263  +
    /// <p><b>Examples for Ubuntu Server and Debian Server</b></p>
         264  +
    /// <p><code>deb http://security.ubuntu.com/ubuntu jammy main</code></p>
         265  +
    /// <p><code>deb https://site.example.com/debian distribution component1 component2 component3</code></p>
         266  +
    /// <p>Repo information for Ubuntu Server repositories must be specifed in a single line. For more examples and information, see <a href="https://manpages.ubuntu.com/manpages/jammy/man5/sources.list.5.html">jammy (5) sources.list.5.gz</a> on the <i>Ubuntu Server Manuals</i> website and <a href="https://wiki.debian.org/SourcesList#sources.list_format">sources.list format</a> on the <i>Debian Wiki</i>.</p>
         267  +
    pub fn get_configuration(&self) -> &::std::option::Option<::std::string::String> {
         268  +
        &self.configuration
         269  +
    }
         270  +
    /// Consumes the builder and constructs a [`PatchSource`](crate::types::PatchSource).
         271  +
    /// This method will fail if any of the following fields are not set:
         272  +
    /// - [`name`](crate::types::builders::PatchSourceBuilder::name)
         273  +
    /// - [`products`](crate::types::builders::PatchSourceBuilder::products)
         274  +
    /// - [`configuration`](crate::types::builders::PatchSourceBuilder::configuration)
         275  +
    pub fn build(self) -> ::std::result::Result<crate::types::PatchSource, ::aws_smithy_types::error::operation::BuildError> {
         276  +
        ::std::result::Result::Ok(crate::types::PatchSource {
         277  +
            name: self.name.ok_or_else(|| {
         278  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         279  +
                    "name",
         280  +
                    "name was not specified but it is required when building PatchSource",
         281  +
                )
         282  +
            })?,
         283  +
            products: self.products.ok_or_else(|| {
         284  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         285  +
                    "products",
         286  +
                    "products was not specified but it is required when building PatchSource",
         287  +
                )
         288  +
            })?,
         289  +
            configuration: self.configuration.ok_or_else(|| {
         290  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         291  +
                    "configuration",
         292  +
                    "configuration was not specified but it is required when building PatchSource",
         293  +
                )
         294  +
            })?,
         295  +
        })
         296  +
    }
         297  +
}
         298  +
impl ::std::fmt::Debug for PatchSourceBuilder {
         299  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         300  +
        let mut formatter = f.debug_struct("PatchSourceBuilder");
         301  +
        formatter.field("name", &self.name);
         302  +
        formatter.field("products", &self.products);
         303  +
        formatter.field("configuration", &"*** Sensitive Data Redacted ***");
         304  +
        formatter.finish()
         305  +
    }
         306  +
}