AWS SDK

AWS SDK

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b

Files changed:

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

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

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

@@ -0,1 +0,500 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Version information about the document.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct DocumentVersionInfo {
           7  +
    /// <p>The document name.</p>
           8  +
    pub name: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
          10  +
    pub display_name: ::std::option::Option<::std::string::String>,
          11  +
    /// <p>The document version.</p>
          12  +
    pub document_version: ::std::option::Option<::std::string::String>,
          13  +
    /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
          14  +
    pub version_name: ::std::option::Option<::std::string::String>,
          15  +
    /// <p>The date the document was created.</p>
          16  +
    pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
          17  +
    /// <p>An identifier for the default version of the document.</p>
          18  +
    pub is_default_version: bool,
          19  +
    /// <p>The document format, either JSON or YAML.</p>
          20  +
    pub document_format: ::std::option::Option<crate::types::DocumentFormat>,
          21  +
    /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
          22  +
    pub status: ::std::option::Option<crate::types::DocumentStatus>,
          23  +
    /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
          24  +
    pub status_information: ::std::option::Option<::std::string::String>,
          25  +
    /// <p>The current status of the approval review for the latest version of the document.</p>
          26  +
    pub review_status: ::std::option::Option<crate::types::ReviewStatus>,
          27  +
}
          28  +
impl DocumentVersionInfo {
          29  +
    /// <p>The document name.</p>
          30  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          31  +
        self.name.as_deref()
          32  +
    }
          33  +
    /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
          34  +
    pub fn display_name(&self) -> ::std::option::Option<&str> {
          35  +
        self.display_name.as_deref()
          36  +
    }
          37  +
    /// <p>The document version.</p>
          38  +
    pub fn document_version(&self) -> ::std::option::Option<&str> {
          39  +
        self.document_version.as_deref()
          40  +
    }
          41  +
    /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
          42  +
    pub fn version_name(&self) -> ::std::option::Option<&str> {
          43  +
        self.version_name.as_deref()
          44  +
    }
          45  +
    /// <p>The date the document was created.</p>
          46  +
    pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          47  +
        self.created_date.as_ref()
          48  +
    }
          49  +
    /// <p>An identifier for the default version of the document.</p>
          50  +
    pub fn is_default_version(&self) -> bool {
          51  +
        self.is_default_version
          52  +
    }
          53  +
    /// <p>The document format, either JSON or YAML.</p>
          54  +
    pub fn document_format(&self) -> ::std::option::Option<&crate::types::DocumentFormat> {
          55  +
        self.document_format.as_ref()
          56  +
    }
          57  +
    /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
          58  +
    pub fn status(&self) -> ::std::option::Option<&crate::types::DocumentStatus> {
          59  +
        self.status.as_ref()
          60  +
    }
          61  +
    /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
          62  +
    pub fn status_information(&self) -> ::std::option::Option<&str> {
          63  +
        self.status_information.as_deref()
          64  +
    }
          65  +
    /// <p>The current status of the approval review for the latest version of the document.</p>
          66  +
    pub fn review_status(&self) -> ::std::option::Option<&crate::types::ReviewStatus> {
          67  +
        self.review_status.as_ref()
          68  +
    }
          69  +
}
          70  +
static DOCUMENTVERSIONINFO_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          71  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentVersionInfo$Name", "com.amazonaws.ssm", "DocumentVersionInfo"),
          72  +
    ::aws_smithy_schema::ShapeType::String,
          73  +
    "Name",
          74  +
    0,
          75  +
);
          76  +
static DOCUMENTVERSIONINFO_MEMBER_DISPLAY_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          77  +
    ::aws_smithy_schema::ShapeId::from_parts(
          78  +
        "com.amazonaws.ssm#DocumentVersionInfo$DisplayName",
          79  +
        "com.amazonaws.ssm",
          80  +
        "DocumentVersionInfo",
          81  +
    ),
          82  +
    ::aws_smithy_schema::ShapeType::String,
          83  +
    "DisplayName",
          84  +
    1,
          85  +
);
          86  +
static DOCUMENTVERSIONINFO_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          87  +
    ::aws_smithy_schema::ShapeId::from_parts(
          88  +
        "com.amazonaws.ssm#DocumentVersionInfo$DocumentVersion",
          89  +
        "com.amazonaws.ssm",
          90  +
        "DocumentVersionInfo",
          91  +
    ),
          92  +
    ::aws_smithy_schema::ShapeType::String,
          93  +
    "DocumentVersion",
          94  +
    2,
          95  +
);
          96  +
static DOCUMENTVERSIONINFO_MEMBER_VERSION_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          97  +
    ::aws_smithy_schema::ShapeId::from_parts(
          98  +
        "com.amazonaws.ssm#DocumentVersionInfo$VersionName",
          99  +
        "com.amazonaws.ssm",
         100  +
        "DocumentVersionInfo",
         101  +
    ),
         102  +
    ::aws_smithy_schema::ShapeType::String,
         103  +
    "VersionName",
         104  +
    3,
         105  +
);
         106  +
static DOCUMENTVERSIONINFO_MEMBER_CREATED_DATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         107  +
    ::aws_smithy_schema::ShapeId::from_parts(
         108  +
        "com.amazonaws.ssm#DocumentVersionInfo$CreatedDate",
         109  +
        "com.amazonaws.ssm",
         110  +
        "DocumentVersionInfo",
         111  +
    ),
         112  +
    ::aws_smithy_schema::ShapeType::Timestamp,
         113  +
    "CreatedDate",
         114  +
    4,
         115  +
);
         116  +
static DOCUMENTVERSIONINFO_MEMBER_IS_DEFAULT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         117  +
    ::aws_smithy_schema::ShapeId::from_parts(
         118  +
        "com.amazonaws.ssm#DocumentVersionInfo$IsDefaultVersion",
         119  +
        "com.amazonaws.ssm",
         120  +
        "DocumentVersionInfo",
         121  +
    ),
         122  +
    ::aws_smithy_schema::ShapeType::Boolean,
         123  +
    "IsDefaultVersion",
         124  +
    5,
         125  +
);
         126  +
static DOCUMENTVERSIONINFO_MEMBER_DOCUMENT_FORMAT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         127  +
    ::aws_smithy_schema::ShapeId::from_parts(
         128  +
        "com.amazonaws.ssm#DocumentVersionInfo$DocumentFormat",
         129  +
        "com.amazonaws.ssm",
         130  +
        "DocumentVersionInfo",
         131  +
    ),
         132  +
    ::aws_smithy_schema::ShapeType::String,
         133  +
    "DocumentFormat",
         134  +
    6,
         135  +
);
         136  +
static DOCUMENTVERSIONINFO_MEMBER_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         137  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentVersionInfo$Status", "com.amazonaws.ssm", "DocumentVersionInfo"),
         138  +
    ::aws_smithy_schema::ShapeType::String,
         139  +
    "Status",
         140  +
    7,
         141  +
);
         142  +
static DOCUMENTVERSIONINFO_MEMBER_STATUS_INFORMATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         143  +
    ::aws_smithy_schema::ShapeId::from_parts(
         144  +
        "com.amazonaws.ssm#DocumentVersionInfo$StatusInformation",
         145  +
        "com.amazonaws.ssm",
         146  +
        "DocumentVersionInfo",
         147  +
    ),
         148  +
    ::aws_smithy_schema::ShapeType::String,
         149  +
    "StatusInformation",
         150  +
    8,
         151  +
);
         152  +
static DOCUMENTVERSIONINFO_MEMBER_REVIEW_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         153  +
    ::aws_smithy_schema::ShapeId::from_parts(
         154  +
        "com.amazonaws.ssm#DocumentVersionInfo$ReviewStatus",
         155  +
        "com.amazonaws.ssm",
         156  +
        "DocumentVersionInfo",
         157  +
    ),
         158  +
    ::aws_smithy_schema::ShapeType::String,
         159  +
    "ReviewStatus",
         160  +
    9,
         161  +
);
         162  +
static DOCUMENTVERSIONINFO_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         163  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentVersionInfo", "com.amazonaws.ssm", "DocumentVersionInfo"),
         164  +
    ::aws_smithy_schema::ShapeType::Structure,
         165  +
    &[
         166  +
        &DOCUMENTVERSIONINFO_MEMBER_NAME,
         167  +
        &DOCUMENTVERSIONINFO_MEMBER_DISPLAY_NAME,
         168  +
        &DOCUMENTVERSIONINFO_MEMBER_DOCUMENT_VERSION,
         169  +
        &DOCUMENTVERSIONINFO_MEMBER_VERSION_NAME,
         170  +
        &DOCUMENTVERSIONINFO_MEMBER_CREATED_DATE,
         171  +
        &DOCUMENTVERSIONINFO_MEMBER_IS_DEFAULT_VERSION,
         172  +
        &DOCUMENTVERSIONINFO_MEMBER_DOCUMENT_FORMAT,
         173  +
        &DOCUMENTVERSIONINFO_MEMBER_STATUS,
         174  +
        &DOCUMENTVERSIONINFO_MEMBER_STATUS_INFORMATION,
         175  +
        &DOCUMENTVERSIONINFO_MEMBER_REVIEW_STATUS,
         176  +
    ],
         177  +
);
         178  +
impl DocumentVersionInfo {
         179  +
    /// The schema for this shape.
         180  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTVERSIONINFO_SCHEMA;
         181  +
}
         182  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentVersionInfo {
         183  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         184  +
    fn serialize_members(
         185  +
        &self,
         186  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         187  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         188  +
        if let Some(ref val) = self.name {
         189  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_NAME, val)?;
         190  +
        }
         191  +
        if let Some(ref val) = self.display_name {
         192  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_DISPLAY_NAME, val)?;
         193  +
        }
         194  +
        if let Some(ref val) = self.document_version {
         195  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_DOCUMENT_VERSION, val)?;
         196  +
        }
         197  +
        if let Some(ref val) = self.version_name {
         198  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_VERSION_NAME, val)?;
         199  +
        }
         200  +
        if let Some(ref val) = self.created_date {
         201  +
            ser.write_timestamp(&DOCUMENTVERSIONINFO_MEMBER_CREATED_DATE, val)?;
         202  +
        }
         203  +
        {
         204  +
            let val = &self.is_default_version;
         205  +
            ser.write_boolean(&DOCUMENTVERSIONINFO_MEMBER_IS_DEFAULT_VERSION, *val)?;
         206  +
        }
         207  +
        if let Some(ref val) = self.document_format {
         208  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_DOCUMENT_FORMAT, val.as_str())?;
         209  +
        }
         210  +
        if let Some(ref val) = self.status {
         211  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_STATUS, val.as_str())?;
         212  +
        }
         213  +
        if let Some(ref val) = self.status_information {
         214  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_STATUS_INFORMATION, val)?;
         215  +
        }
         216  +
        if let Some(ref val) = self.review_status {
         217  +
            ser.write_string(&DOCUMENTVERSIONINFO_MEMBER_REVIEW_STATUS, val.as_str())?;
         218  +
        }
         219  +
        Ok(())
         220  +
    }
         221  +
}
         222  +
impl DocumentVersionInfo {
         223  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         224  +
    pub fn deserialize(
         225  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         226  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         227  +
        #[allow(unused_variables, unused_mut)]
         228  +
        let mut builder = Self::builder();
         229  +
        #[allow(
         230  +
            unused_variables,
         231  +
            unreachable_code,
         232  +
            clippy::single_match,
         233  +
            clippy::match_single_binding,
         234  +
            clippy::diverging_sub_expression
         235  +
        )]
         236  +
        deserializer.read_struct(&DOCUMENTVERSIONINFO_SCHEMA, &mut |member, deser| {
         237  +
            match member.member_index() {
         238  +
                Some(0) => {
         239  +
                    if deser.is_null() {
         240  +
                        deser.read_null()?;
         241  +
                    } else {
         242  +
                        builder.name = Some(deser.read_string(member)?);
         243  +
                    }
         244  +
                }
         245  +
                Some(1) => {
         246  +
                    if deser.is_null() {
         247  +
                        deser.read_null()?;
         248  +
                    } else {
         249  +
                        builder.display_name = Some(deser.read_string(member)?);
         250  +
                    }
         251  +
                }
         252  +
                Some(2) => {
         253  +
                    if deser.is_null() {
         254  +
                        deser.read_null()?;
         255  +
                    } else {
         256  +
                        builder.document_version = Some(deser.read_string(member)?);
         257  +
                    }
         258  +
                }
         259  +
                Some(3) => {
         260  +
                    if deser.is_null() {
         261  +
                        deser.read_null()?;
         262  +
                    } else {
         263  +
                        builder.version_name = Some(deser.read_string(member)?);
         264  +
                    }
         265  +
                }
         266  +
                Some(4) => {
         267  +
                    if deser.is_null() {
         268  +
                        deser.read_null()?;
         269  +
                    } else {
         270  +
                        builder.created_date = Some(deser.read_timestamp(member)?);
         271  +
                    }
         272  +
                }
         273  +
                Some(5) => {
         274  +
                    builder.is_default_version = Some(deser.read_boolean(member)?);
         275  +
                }
         276  +
                Some(6) => {
         277  +
                    if deser.is_null() {
         278  +
                        deser.read_null()?;
         279  +
                    } else {
         280  +
                        builder.document_format = Some(crate::types::DocumentFormat::from(deser.read_string(member)?.as_str()));
         281  +
                    }
         282  +
                }
         283  +
                Some(7) => {
         284  +
                    if deser.is_null() {
         285  +
                        deser.read_null()?;
         286  +
                    } else {
         287  +
                        builder.status = Some(crate::types::DocumentStatus::from(deser.read_string(member)?.as_str()));
         288  +
                    }
         289  +
                }
         290  +
                Some(8) => {
         291  +
                    if deser.is_null() {
         292  +
                        deser.read_null()?;
         293  +
                    } else {
         294  +
                        builder.status_information = Some(deser.read_string(member)?);
         295  +
                    }
         296  +
                }
         297  +
                Some(9) => {
         298  +
                    if deser.is_null() {
         299  +
                        deser.read_null()?;
         300  +
                    } else {
         301  +
                        builder.review_status = Some(crate::types::ReviewStatus::from(deser.read_string(member)?.as_str()));
         302  +
                    }
         303  +
                }
         304  +
                _ => {}
         305  +
            }
         306  +
            Ok(())
         307  +
        })?;
         308  +
        Ok(builder.build())
         309  +
    }
         310  +
}
         311  +
impl DocumentVersionInfo {
         312  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         313  +
    pub fn deserialize_with_response(
         314  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         315  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         316  +
        _status: u16,
         317  +
        _body: &[u8],
         318  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         319  +
        Self::deserialize(deserializer)
         320  +
    }
         321  +
}
         322  +
impl DocumentVersionInfo {
         323  +
    /// Creates a new builder-style object to manufacture [`DocumentVersionInfo`](crate::types::DocumentVersionInfo).
         324  +
    pub fn builder() -> crate::types::builders::DocumentVersionInfoBuilder {
         325  +
        crate::types::builders::DocumentVersionInfoBuilder::default()
         326  +
    }
         327  +
}
         328  +
         329  +
/// A builder for [`DocumentVersionInfo`](crate::types::DocumentVersionInfo).
         330  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         331  +
#[non_exhaustive]
         332  +
pub struct DocumentVersionInfoBuilder {
         333  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         334  +
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
         335  +
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
         336  +
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
         337  +
    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
         338  +
    pub(crate) is_default_version: ::std::option::Option<bool>,
         339  +
    pub(crate) document_format: ::std::option::Option<crate::types::DocumentFormat>,
         340  +
    pub(crate) status: ::std::option::Option<crate::types::DocumentStatus>,
         341  +
    pub(crate) status_information: ::std::option::Option<::std::string::String>,
         342  +
    pub(crate) review_status: ::std::option::Option<crate::types::ReviewStatus>,
         343  +
}
         344  +
impl DocumentVersionInfoBuilder {
         345  +
    /// <p>The document name.</p>
         346  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         347  +
        self.name = ::std::option::Option::Some(input.into());
         348  +
        self
         349  +
    }
         350  +
    /// <p>The document name.</p>
         351  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         352  +
        self.name = input;
         353  +
        self
         354  +
    }
         355  +
    /// <p>The document name.</p>
         356  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         357  +
        &self.name
         358  +
    }
         359  +
    /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
         360  +
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         361  +
        self.display_name = ::std::option::Option::Some(input.into());
         362  +
        self
         363  +
    }
         364  +
    /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
         365  +
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         366  +
        self.display_name = input;
         367  +
        self
         368  +
    }
         369  +
    /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
         370  +
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
         371  +
        &self.display_name
         372  +
    }
         373  +
    /// <p>The document version.</p>
         374  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         375  +
        self.document_version = ::std::option::Option::Some(input.into());
         376  +
        self
         377  +
    }
         378  +
    /// <p>The document version.</p>
         379  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         380  +
        self.document_version = input;
         381  +
        self
         382  +
    }
         383  +
    /// <p>The document version.</p>
         384  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         385  +
        &self.document_version
         386  +
    }
         387  +
    /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         388  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         389  +
        self.version_name = ::std::option::Option::Some(input.into());
         390  +
        self
         391  +
    }
         392  +
    /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         393  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         394  +
        self.version_name = input;
         395  +
        self
         396  +
    }
         397  +
    /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         398  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         399  +
        &self.version_name
         400  +
    }
         401  +
    /// <p>The date the document was created.</p>
         402  +
    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         403  +
        self.created_date = ::std::option::Option::Some(input);
         404  +
        self
         405  +
    }
         406  +
    /// <p>The date the document was created.</p>
         407  +
    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         408  +
        self.created_date = input;
         409  +
        self
         410  +
    }
         411  +
    /// <p>The date the document was created.</p>
         412  +
    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         413  +
        &self.created_date
         414  +
    }
         415  +
    /// <p>An identifier for the default version of the document.</p>
         416  +
    pub fn is_default_version(mut self, input: bool) -> Self {
         417  +
        self.is_default_version = ::std::option::Option::Some(input);
         418  +
        self
         419  +
    }
         420  +
    /// <p>An identifier for the default version of the document.</p>
         421  +
    pub fn set_is_default_version(mut self, input: ::std::option::Option<bool>) -> Self {
         422  +
        self.is_default_version = input;
         423  +
        self
         424  +
    }
         425  +
    /// <p>An identifier for the default version of the document.</p>
         426  +
    pub fn get_is_default_version(&self) -> &::std::option::Option<bool> {
         427  +
        &self.is_default_version
         428  +
    }
         429  +
    /// <p>The document format, either JSON or YAML.</p>
         430  +
    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
         431  +
        self.document_format = ::std::option::Option::Some(input);
         432  +
        self
         433  +
    }
         434  +
    /// <p>The document format, either JSON or YAML.</p>
         435  +
    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
         436  +
        self.document_format = input;
         437  +
        self
         438  +
    }
         439  +
    /// <p>The document format, either JSON or YAML.</p>
         440  +
    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
         441  +
        &self.document_format
         442  +
    }
         443  +
    /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
         444  +
    pub fn status(mut self, input: crate::types::DocumentStatus) -> Self {
         445  +
        self.status = ::std::option::Option::Some(input);
         446  +
        self
         447  +
    }
         448  +
    /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
         449  +
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DocumentStatus>) -> Self {
         450  +
        self.status = input;
         451  +
        self
         452  +
    }
         453  +
    /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
         454  +
    pub fn get_status(&self) -> &::std::option::Option<crate::types::DocumentStatus> {
         455  +
        &self.status
         456  +
    }
         457  +
    /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
         458  +
    pub fn status_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         459  +
        self.status_information = ::std::option::Option::Some(input.into());
         460  +
        self
         461  +
    }
         462  +
    /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
         463  +
    pub fn set_status_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         464  +
        self.status_information = input;
         465  +
        self
         466  +
    }
         467  +
    /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
         468  +
    pub fn get_status_information(&self) -> &::std::option::Option<::std::string::String> {
         469  +
        &self.status_information
         470  +
    }
         471  +
    /// <p>The current status of the approval review for the latest version of the document.</p>
         472  +
    pub fn review_status(mut self, input: crate::types::ReviewStatus) -> Self {
         473  +
        self.review_status = ::std::option::Option::Some(input);
         474  +
        self
         475  +
    }
         476  +
    /// <p>The current status of the approval review for the latest version of the document.</p>
         477  +
    pub fn set_review_status(mut self, input: ::std::option::Option<crate::types::ReviewStatus>) -> Self {
         478  +
        self.review_status = input;
         479  +
        self
         480  +
    }
         481  +
    /// <p>The current status of the approval review for the latest version of the document.</p>
         482  +
    pub fn get_review_status(&self) -> &::std::option::Option<crate::types::ReviewStatus> {
         483  +
        &self.review_status
         484  +
    }
         485  +
    /// Consumes the builder and constructs a [`DocumentVersionInfo`](crate::types::DocumentVersionInfo).
         486  +
    pub fn build(self) -> crate::types::DocumentVersionInfo {
         487  +
        crate::types::DocumentVersionInfo {
         488  +
            name: self.name,
         489  +
            display_name: self.display_name,
         490  +
            document_version: self.document_version,
         491  +
            version_name: self.version_name,
         492  +
            created_date: self.created_date,
         493  +
            is_default_version: self.is_default_version.unwrap_or_default(),
         494  +
            document_format: self.document_format,
         495  +
            status: self.status,
         496  +
            status_information: self.status_information,
         497  +
            review_status: self.review_status,
         498  +
        }
         499  +
    }
         500  +
}

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

@@ -0,1 +0,156 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The <code>EffectivePatch</code> structure defines metadata about a patch along with the approval state of the patch in a particular patch baseline. The approval state includes information about whether the patch is currently approved, due to be approved by a rule, explicitly approved, or explicitly rejected and the date the patch was or will be approved.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct EffectivePatch {
           7  +
    /// <p>Provides metadata for a patch, including information such as the KB ID, severity, classification and a URL for where more information can be obtained about the patch.</p>
           8  +
    pub patch: ::std::option::Option<crate::types::Patch>,
           9  +
    /// <p>The status of the patch in a patch baseline. This includes information about whether the patch is currently approved, due to be approved by a rule, explicitly approved, or explicitly rejected and the date the patch was or will be approved.</p>
          10  +
    pub patch_status: ::std::option::Option<crate::types::PatchStatus>,
          11  +
}
          12  +
impl EffectivePatch {
          13  +
    /// <p>Provides metadata for a patch, including information such as the KB ID, severity, classification and a URL for where more information can be obtained about the patch.</p>
          14  +
    pub fn patch(&self) -> ::std::option::Option<&crate::types::Patch> {
          15  +
        self.patch.as_ref()
          16  +
    }
          17  +
    /// <p>The status of the patch in a patch baseline. This includes information about whether the patch is currently approved, due to be approved by a rule, explicitly approved, or explicitly rejected and the date the patch was or will be approved.</p>
          18  +
    pub fn patch_status(&self) -> ::std::option::Option<&crate::types::PatchStatus> {
          19  +
        self.patch_status.as_ref()
          20  +
    }
          21  +
}
          22  +
static EFFECTIVEPATCH_MEMBER_PATCH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          23  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#EffectivePatch$Patch", "com.amazonaws.ssm", "EffectivePatch"),
          24  +
    ::aws_smithy_schema::ShapeType::Structure,
          25  +
    "Patch",
          26  +
    0,
          27  +
);
          28  +
static EFFECTIVEPATCH_MEMBER_PATCH_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          29  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#EffectivePatch$PatchStatus", "com.amazonaws.ssm", "EffectivePatch"),
          30  +
    ::aws_smithy_schema::ShapeType::Structure,
          31  +
    "PatchStatus",
          32  +
    1,
          33  +
);
          34  +
static EFFECTIVEPATCH_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#EffectivePatch", "com.amazonaws.ssm", "EffectivePatch"),
          36  +
    ::aws_smithy_schema::ShapeType::Structure,
          37  +
    &[&EFFECTIVEPATCH_MEMBER_PATCH, &EFFECTIVEPATCH_MEMBER_PATCH_STATUS],
          38  +
);
          39  +
impl EffectivePatch {
          40  +
    /// The schema for this shape.
          41  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &EFFECTIVEPATCH_SCHEMA;
          42  +
}
          43  +
impl ::aws_smithy_schema::serde::SerializableStruct for EffectivePatch {
          44  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          45  +
    fn serialize_members(
          46  +
        &self,
          47  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          48  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          49  +
        if let Some(ref val) = self.patch {
          50  +
            ser.write_struct(&EFFECTIVEPATCH_MEMBER_PATCH, val)?;
          51  +
        }
          52  +
        if let Some(ref val) = self.patch_status {
          53  +
            ser.write_struct(&EFFECTIVEPATCH_MEMBER_PATCH_STATUS, val)?;
          54  +
        }
          55  +
        Ok(())
          56  +
    }
          57  +
}
          58  +
impl EffectivePatch {
          59  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          60  +
    pub fn deserialize(
          61  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          62  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          63  +
        #[allow(unused_variables, unused_mut)]
          64  +
        let mut builder = Self::builder();
          65  +
        #[allow(
          66  +
            unused_variables,
          67  +
            unreachable_code,
          68  +
            clippy::single_match,
          69  +
            clippy::match_single_binding,
          70  +
            clippy::diverging_sub_expression
          71  +
        )]
          72  +
        deserializer.read_struct(&EFFECTIVEPATCH_SCHEMA, &mut |member, deser| {
          73  +
            match member.member_index() {
          74  +
                Some(0) => {
          75  +
                    if deser.is_null() {
          76  +
                        deser.read_null()?;
          77  +
                    } else {
          78  +
                        builder.patch = Some(crate::types::Patch::deserialize(deser)?);
          79  +
                    }
          80  +
                }
          81  +
                Some(1) => {
          82  +
                    if deser.is_null() {
          83  +
                        deser.read_null()?;
          84  +
                    } else {
          85  +
                        builder.patch_status = Some(crate::types::PatchStatus::deserialize(deser)?);
          86  +
                    }
          87  +
                }
          88  +
                _ => {}
          89  +
            }
          90  +
            Ok(())
          91  +
        })?;
          92  +
        Ok(builder.build())
          93  +
    }
          94  +
}
          95  +
impl EffectivePatch {
          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 EffectivePatch {
         107  +
    /// Creates a new builder-style object to manufacture [`EffectivePatch`](crate::types::EffectivePatch).
         108  +
    pub fn builder() -> crate::types::builders::EffectivePatchBuilder {
         109  +
        crate::types::builders::EffectivePatchBuilder::default()
         110  +
    }
         111  +
}
         112  +
         113  +
/// A builder for [`EffectivePatch`](crate::types::EffectivePatch).
         114  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         115  +
#[non_exhaustive]
         116  +
pub struct EffectivePatchBuilder {
         117  +
    pub(crate) patch: ::std::option::Option<crate::types::Patch>,
         118  +
    pub(crate) patch_status: ::std::option::Option<crate::types::PatchStatus>,
         119  +
}
         120  +
impl EffectivePatchBuilder {
         121  +
    /// <p>Provides metadata for a patch, including information such as the KB ID, severity, classification and a URL for where more information can be obtained about the patch.</p>
         122  +
    pub fn patch(mut self, input: crate::types::Patch) -> Self {
         123  +
        self.patch = ::std::option::Option::Some(input);
         124  +
        self
         125  +
    }
         126  +
    /// <p>Provides metadata for a patch, including information such as the KB ID, severity, classification and a URL for where more information can be obtained about the patch.</p>
         127  +
    pub fn set_patch(mut self, input: ::std::option::Option<crate::types::Patch>) -> Self {
         128  +
        self.patch = input;
         129  +
        self
         130  +
    }
         131  +
    /// <p>Provides metadata for a patch, including information such as the KB ID, severity, classification and a URL for where more information can be obtained about the patch.</p>
         132  +
    pub fn get_patch(&self) -> &::std::option::Option<crate::types::Patch> {
         133  +
        &self.patch
         134  +
    }
         135  +
    /// <p>The status of the patch in a patch baseline. This includes information about whether the patch is currently approved, due to be approved by a rule, explicitly approved, or explicitly rejected and the date the patch was or will be approved.</p>
         136  +
    pub fn patch_status(mut self, input: crate::types::PatchStatus) -> Self {
         137  +
        self.patch_status = ::std::option::Option::Some(input);
         138  +
        self
         139  +
    }
         140  +
    /// <p>The status of the patch in a patch baseline. This includes information about whether the patch is currently approved, due to be approved by a rule, explicitly approved, or explicitly rejected and the date the patch was or will be approved.</p>
         141  +
    pub fn set_patch_status(mut self, input: ::std::option::Option<crate::types::PatchStatus>) -> Self {
         142  +
        self.patch_status = input;
         143  +
        self
         144  +
    }
         145  +
    /// <p>The status of the patch in a patch baseline. This includes information about whether the patch is currently approved, due to be approved by a rule, explicitly approved, or explicitly rejected and the date the patch was or will be approved.</p>
         146  +
    pub fn get_patch_status(&self) -> &::std::option::Option<crate::types::PatchStatus> {
         147  +
        &self.patch_status
         148  +
    }
         149  +
    /// Consumes the builder and constructs a [`EffectivePatch`](crate::types::EffectivePatch).
         150  +
    pub fn build(self) -> crate::types::EffectivePatch {
         151  +
        crate::types::EffectivePatch {
         152  +
            patch: self.patch,
         153  +
            patch_status: self.patch_status,
         154  +
        }
         155  +
    }
         156  +
}

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

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

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