AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0

Files changed:

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

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

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

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

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

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

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

@@ -0,1 +0,344 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about a reviewer's response to a document review request.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct DocumentReviewerResponseSource {
           7  +
    /// <p>The date and time that a reviewer entered a response to a document review request.</p>
           8  +
    pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
           9  +
    /// <p>The date and time that a reviewer last updated a response to a document review request.</p>
          10  +
    pub updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
          11  +
    /// <p>The current review status of a new custom SSM document created by a member of your organization, or of the latest version of an existing SSM document.</p>
          12  +
    /// <p>Only one version of a document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
          13  +
    /// <p>Only one version of a document can be in review, or PENDING, at a time.</p>
          14  +
    pub review_status: ::std::option::Option<crate::types::ReviewStatus>,
          15  +
    /// <p>The comment entered by a reviewer as part of their document review response.</p>
          16  +
    pub comment: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>>,
          17  +
    /// <p>The user in your organization assigned to review a document request.</p>
          18  +
    pub reviewer: ::std::option::Option<::std::string::String>,
          19  +
}
          20  +
impl DocumentReviewerResponseSource {
          21  +
    /// <p>The date and time that a reviewer entered a response to a document review request.</p>
          22  +
    pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          23  +
        self.create_time.as_ref()
          24  +
    }
          25  +
    /// <p>The date and time that a reviewer last updated a response to a document review request.</p>
          26  +
    pub fn updated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          27  +
        self.updated_time.as_ref()
          28  +
    }
          29  +
    /// <p>The current review status of a new custom SSM document created by a member of your organization, or of the latest version of an existing SSM document.</p>
          30  +
    /// <p>Only one version of a document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
          31  +
    /// <p>Only one version of a document can be in review, or PENDING, at a time.</p>
          32  +
    pub fn review_status(&self) -> ::std::option::Option<&crate::types::ReviewStatus> {
          33  +
        self.review_status.as_ref()
          34  +
    }
          35  +
    /// <p>The comment entered by a reviewer as part of their document review response.</p>
          36  +
    ///
          37  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.comment.is_none()`.
          38  +
    pub fn comment(&self) -> &[crate::types::DocumentReviewCommentSource] {
          39  +
        self.comment.as_deref().unwrap_or_default()
          40  +
    }
          41  +
    /// <p>The user in your organization assigned to review a document request.</p>
          42  +
    pub fn reviewer(&self) -> ::std::option::Option<&str> {
          43  +
        self.reviewer.as_deref()
          44  +
    }
          45  +
}
          46  +
static DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_CREATE_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          47  +
    ::aws_smithy_schema::ShapeId::from_parts(
          48  +
        "com.amazonaws.ssm#DocumentReviewerResponseSource$CreateTime",
          49  +
        "com.amazonaws.ssm",
          50  +
        "DocumentReviewerResponseSource",
          51  +
    ),
          52  +
    ::aws_smithy_schema::ShapeType::Timestamp,
          53  +
    "CreateTime",
          54  +
    0,
          55  +
);
          56  +
static DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_UPDATED_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          57  +
    ::aws_smithy_schema::ShapeId::from_parts(
          58  +
        "com.amazonaws.ssm#DocumentReviewerResponseSource$UpdatedTime",
          59  +
        "com.amazonaws.ssm",
          60  +
        "DocumentReviewerResponseSource",
          61  +
    ),
          62  +
    ::aws_smithy_schema::ShapeType::Timestamp,
          63  +
    "UpdatedTime",
          64  +
    1,
          65  +
);
          66  +
static DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_REVIEW_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          67  +
    ::aws_smithy_schema::ShapeId::from_parts(
          68  +
        "com.amazonaws.ssm#DocumentReviewerResponseSource$ReviewStatus",
          69  +
        "com.amazonaws.ssm",
          70  +
        "DocumentReviewerResponseSource",
          71  +
    ),
          72  +
    ::aws_smithy_schema::ShapeType::String,
          73  +
    "ReviewStatus",
          74  +
    2,
          75  +
);
          76  +
static DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_COMMENT_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          77  +
    ::aws_smithy_schema::ShapeId::from_parts(
          78  +
        "com.amazonaws.ssm#DocumentReviewCommentList$member",
          79  +
        "com.amazonaws.ssm",
          80  +
        "DocumentReviewCommentList",
          81  +
    ),
          82  +
    ::aws_smithy_schema::ShapeType::Structure,
          83  +
    "member",
          84  +
    0,
          85  +
);
          86  +
static DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_COMMENT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          87  +
    ::aws_smithy_schema::ShapeId::from_parts(
          88  +
        "com.amazonaws.ssm#DocumentReviewerResponseSource$Comment",
          89  +
        "com.amazonaws.ssm",
          90  +
        "DocumentReviewerResponseSource",
          91  +
    ),
          92  +
    ::aws_smithy_schema::ShapeType::List,
          93  +
    "Comment",
          94  +
    3,
          95  +
)
          96  +
.with_list_member(&DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_COMMENT_MEMBER);
          97  +
static DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_REVIEWER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          98  +
    ::aws_smithy_schema::ShapeId::from_parts(
          99  +
        "com.amazonaws.ssm#DocumentReviewerResponseSource$Reviewer",
         100  +
        "com.amazonaws.ssm",
         101  +
        "DocumentReviewerResponseSource",
         102  +
    ),
         103  +
    ::aws_smithy_schema::ShapeType::String,
         104  +
    "Reviewer",
         105  +
    4,
         106  +
);
         107  +
static DOCUMENTREVIEWERRESPONSESOURCE_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         108  +
    ::aws_smithy_schema::ShapeId::from_parts(
         109  +
        "com.amazonaws.ssm#DocumentReviewerResponseSource",
         110  +
        "com.amazonaws.ssm",
         111  +
        "DocumentReviewerResponseSource",
         112  +
    ),
         113  +
    ::aws_smithy_schema::ShapeType::Structure,
         114  +
    &[
         115  +
        &DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_CREATE_TIME,
         116  +
        &DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_UPDATED_TIME,
         117  +
        &DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_REVIEW_STATUS,
         118  +
        &DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_COMMENT,
         119  +
        &DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_REVIEWER,
         120  +
    ],
         121  +
);
         122  +
impl DocumentReviewerResponseSource {
         123  +
    /// The schema for this shape.
         124  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTREVIEWERRESPONSESOURCE_SCHEMA;
         125  +
}
         126  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentReviewerResponseSource {
         127  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         128  +
    fn serialize_members(
         129  +
        &self,
         130  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         131  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         132  +
        if let Some(ref val) = self.create_time {
         133  +
            ser.write_timestamp(&DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_CREATE_TIME, val)?;
         134  +
        }
         135  +
        if let Some(ref val) = self.updated_time {
         136  +
            ser.write_timestamp(&DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_UPDATED_TIME, val)?;
         137  +
        }
         138  +
        if let Some(ref val) = self.review_status {
         139  +
            ser.write_string(&DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_REVIEW_STATUS, val.as_str())?;
         140  +
        }
         141  +
        if let Some(ref val) = self.comment {
         142  +
            ser.write_list(
         143  +
                &DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_COMMENT,
         144  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         145  +
                    for item in val {
         146  +
                        ser.write_struct(crate::types::DocumentReviewCommentSource::SCHEMA, item)?;
         147  +
                    }
         148  +
                    Ok(())
         149  +
                },
         150  +
            )?;
         151  +
        }
         152  +
        if let Some(ref val) = self.reviewer {
         153  +
            ser.write_string(&DOCUMENTREVIEWERRESPONSESOURCE_MEMBER_REVIEWER, val)?;
         154  +
        }
         155  +
        Ok(())
         156  +
    }
         157  +
}
         158  +
impl DocumentReviewerResponseSource {
         159  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         160  +
    pub fn deserialize(
         161  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         162  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         163  +
        #[allow(unused_variables, unused_mut)]
         164  +
        let mut builder = Self::builder();
         165  +
        #[allow(
         166  +
            unused_variables,
         167  +
            unreachable_code,
         168  +
            clippy::single_match,
         169  +
            clippy::match_single_binding,
         170  +
            clippy::diverging_sub_expression
         171  +
        )]
         172  +
        deserializer.read_struct(&DOCUMENTREVIEWERRESPONSESOURCE_SCHEMA, &mut |member, deser| {
         173  +
            match member.member_index() {
         174  +
                Some(0) => {
         175  +
                    if deser.is_null() {
         176  +
                        deser.read_null()?;
         177  +
                    } else {
         178  +
                        builder.create_time = Some(deser.read_timestamp(member)?);
         179  +
                    }
         180  +
                }
         181  +
                Some(1) => {
         182  +
                    if deser.is_null() {
         183  +
                        deser.read_null()?;
         184  +
                    } else {
         185  +
                        builder.updated_time = Some(deser.read_timestamp(member)?);
         186  +
                    }
         187  +
                }
         188  +
                Some(2) => {
         189  +
                    if deser.is_null() {
         190  +
                        deser.read_null()?;
         191  +
                    } else {
         192  +
                        builder.review_status = Some(crate::types::ReviewStatus::from(deser.read_string(member)?.as_str()));
         193  +
                    }
         194  +
                }
         195  +
                Some(3) => {
         196  +
                    if deser.is_null() {
         197  +
                        deser.read_null()?;
         198  +
                    } else {
         199  +
                        builder.comment = Some({
         200  +
                            let mut container = Vec::new();
         201  +
                            deser.read_list(member, &mut |deser| {
         202  +
                                container.push(crate::types::DocumentReviewCommentSource::deserialize(deser)?);
         203  +
                                Ok(())
         204  +
                            })?;
         205  +
                            container
         206  +
                        });
         207  +
                    }
         208  +
                }
         209  +
                Some(4) => {
         210  +
                    if deser.is_null() {
         211  +
                        deser.read_null()?;
         212  +
                    } else {
         213  +
                        builder.reviewer = Some(deser.read_string(member)?);
         214  +
                    }
         215  +
                }
         216  +
                _ => {}
         217  +
            }
         218  +
            Ok(())
         219  +
        })?;
         220  +
        Ok(builder.build())
         221  +
    }
         222  +
}
         223  +
impl DocumentReviewerResponseSource {
         224  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         225  +
    pub fn deserialize_with_response(
         226  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         227  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         228  +
        _status: u16,
         229  +
        _body: &[u8],
         230  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         231  +
        Self::deserialize(deserializer)
         232  +
    }
         233  +
}
         234  +
impl DocumentReviewerResponseSource {
         235  +
    /// Creates a new builder-style object to manufacture [`DocumentReviewerResponseSource`](crate::types::DocumentReviewerResponseSource).
         236  +
    pub fn builder() -> crate::types::builders::DocumentReviewerResponseSourceBuilder {
         237  +
        crate::types::builders::DocumentReviewerResponseSourceBuilder::default()
         238  +
    }
         239  +
}
         240  +
         241  +
/// A builder for [`DocumentReviewerResponseSource`](crate::types::DocumentReviewerResponseSource).
         242  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         243  +
#[non_exhaustive]
         244  +
pub struct DocumentReviewerResponseSourceBuilder {
         245  +
    pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         246  +
    pub(crate) updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         247  +
    pub(crate) review_status: ::std::option::Option<crate::types::ReviewStatus>,
         248  +
    pub(crate) comment: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>>,
         249  +
    pub(crate) reviewer: ::std::option::Option<::std::string::String>,
         250  +
}
         251  +
impl DocumentReviewerResponseSourceBuilder {
         252  +
    /// <p>The date and time that a reviewer entered a response to a document review request.</p>
         253  +
    pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         254  +
        self.create_time = ::std::option::Option::Some(input);
         255  +
        self
         256  +
    }
         257  +
    /// <p>The date and time that a reviewer entered a response to a document review request.</p>
         258  +
    pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         259  +
        self.create_time = input;
         260  +
        self
         261  +
    }
         262  +
    /// <p>The date and time that a reviewer entered a response to a document review request.</p>
         263  +
    pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         264  +
        &self.create_time
         265  +
    }
         266  +
    /// <p>The date and time that a reviewer last updated a response to a document review request.</p>
         267  +
    pub fn updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         268  +
        self.updated_time = ::std::option::Option::Some(input);
         269  +
        self
         270  +
    }
         271  +
    /// <p>The date and time that a reviewer last updated a response to a document review request.</p>
         272  +
    pub fn set_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         273  +
        self.updated_time = input;
         274  +
        self
         275  +
    }
         276  +
    /// <p>The date and time that a reviewer last updated a response to a document review request.</p>
         277  +
    pub fn get_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         278  +
        &self.updated_time
         279  +
    }
         280  +
    /// <p>The current review status of a new custom SSM document created by a member of your organization, or of the latest version of an existing SSM document.</p>
         281  +
    /// <p>Only one version of a document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
         282  +
    /// <p>Only one version of a document can be in review, or PENDING, at a time.</p>
         283  +
    pub fn review_status(mut self, input: crate::types::ReviewStatus) -> Self {
         284  +
        self.review_status = ::std::option::Option::Some(input);
         285  +
        self
         286  +
    }
         287  +
    /// <p>The current review status of a new custom SSM document created by a member of your organization, or of the latest version of an existing SSM document.</p>
         288  +
    /// <p>Only one version of a document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
         289  +
    /// <p>Only one version of a document can be in review, or PENDING, at a time.</p>
         290  +
    pub fn set_review_status(mut self, input: ::std::option::Option<crate::types::ReviewStatus>) -> Self {
         291  +
        self.review_status = input;
         292  +
        self
         293  +
    }
         294  +
    /// <p>The current review status of a new custom SSM document created by a member of your organization, or of the latest version of an existing SSM document.</p>
         295  +
    /// <p>Only one version of a document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
         296  +
    /// <p>Only one version of a document can be in review, or PENDING, at a time.</p>
         297  +
    pub fn get_review_status(&self) -> &::std::option::Option<crate::types::ReviewStatus> {
         298  +
        &self.review_status
         299  +
    }
         300  +
    /// Appends an item to `comment`.
         301  +
    ///
         302  +
    /// To override the contents of this collection use [`set_comment`](Self::set_comment).
         303  +
    ///
         304  +
    /// <p>The comment entered by a reviewer as part of their document review response.</p>
         305  +
    pub fn comment(mut self, input: crate::types::DocumentReviewCommentSource) -> Self {
         306  +
        let mut v = self.comment.unwrap_or_default();
         307  +
        v.push(input);
         308  +
        self.comment = ::std::option::Option::Some(v);
         309  +
        self
         310  +
    }
         311  +
    /// <p>The comment entered by a reviewer as part of their document review response.</p>
         312  +
    pub fn set_comment(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>>) -> Self {
         313  +
        self.comment = input;
         314  +
        self
         315  +
    }
         316  +
    /// <p>The comment entered by a reviewer as part of their document review response.</p>
         317  +
    pub fn get_comment(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>> {
         318  +
        &self.comment
         319  +
    }
         320  +
    /// <p>The user in your organization assigned to review a document request.</p>
         321  +
    pub fn reviewer(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         322  +
        self.reviewer = ::std::option::Option::Some(input.into());
         323  +
        self
         324  +
    }
         325  +
    /// <p>The user in your organization assigned to review a document request.</p>
         326  +
    pub fn set_reviewer(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         327  +
        self.reviewer = input;
         328  +
        self
         329  +
    }
         330  +
    /// <p>The user in your organization assigned to review a document request.</p>
         331  +
    pub fn get_reviewer(&self) -> &::std::option::Option<::std::string::String> {
         332  +
        &self.reviewer
         333  +
    }
         334  +
    /// Consumes the builder and constructs a [`DocumentReviewerResponseSource`](crate::types::DocumentReviewerResponseSource).
         335  +
    pub fn build(self) -> crate::types::DocumentReviewerResponseSource {
         336  +
        crate::types::DocumentReviewerResponseSource {
         337  +
            create_time: self.create_time,
         338  +
            updated_time: self.updated_time,
         339  +
            review_status: self.review_status,
         340  +
            comment: self.comment,
         341  +
            reviewer: self.reviewer,
         342  +
        }
         343  +
    }
         344  +
}

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

@@ -0,1 +0,195 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about a document approval review.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct DocumentReviews {
           7  +
    /// <p>The action to take on a document approval review request.</p>
           8  +
    pub action: crate::types::DocumentReviewAction,
           9  +
    /// <p>A comment entered by a user in your organization about the document review request.</p>
          10  +
    pub comment: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>>,
          11  +
}
          12  +
impl DocumentReviews {
          13  +
    /// <p>The action to take on a document approval review request.</p>
          14  +
    pub fn action(&self) -> &crate::types::DocumentReviewAction {
          15  +
        &self.action
          16  +
    }
          17  +
    /// <p>A comment entered by a user in your organization about the document review request.</p>
          18  +
    ///
          19  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.comment.is_none()`.
          20  +
    pub fn comment(&self) -> &[crate::types::DocumentReviewCommentSource] {
          21  +
        self.comment.as_deref().unwrap_or_default()
          22  +
    }
          23  +
}
          24  +
static DOCUMENTREVIEWS_MEMBER_ACTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          25  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentReviews$Action", "com.amazonaws.ssm", "DocumentReviews"),
          26  +
    ::aws_smithy_schema::ShapeType::String,
          27  +
    "Action",
          28  +
    0,
          29  +
);
          30  +
static DOCUMENTREVIEWS_MEMBER_COMMENT_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          31  +
    ::aws_smithy_schema::ShapeId::from_parts(
          32  +
        "com.amazonaws.ssm#DocumentReviewCommentList$member",
          33  +
        "com.amazonaws.ssm",
          34  +
        "DocumentReviewCommentList",
          35  +
    ),
          36  +
    ::aws_smithy_schema::ShapeType::Structure,
          37  +
    "member",
          38  +
    0,
          39  +
);
          40  +
static DOCUMENTREVIEWS_MEMBER_COMMENT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentReviews$Comment", "com.amazonaws.ssm", "DocumentReviews"),
          42  +
    ::aws_smithy_schema::ShapeType::List,
          43  +
    "Comment",
          44  +
    1,
          45  +
)
          46  +
.with_list_member(&DOCUMENTREVIEWS_MEMBER_COMMENT_MEMBER);
          47  +
static DOCUMENTREVIEWS_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          48  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentReviews", "com.amazonaws.ssm", "DocumentReviews"),
          49  +
    ::aws_smithy_schema::ShapeType::Structure,
          50  +
    &[&DOCUMENTREVIEWS_MEMBER_ACTION, &DOCUMENTREVIEWS_MEMBER_COMMENT],
          51  +
);
          52  +
impl DocumentReviews {
          53  +
    /// The schema for this shape.
          54  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTREVIEWS_SCHEMA;
          55  +
}
          56  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentReviews {
          57  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          58  +
    fn serialize_members(
          59  +
        &self,
          60  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          61  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          62  +
        {
          63  +
            let val = &self.action;
          64  +
            ser.write_string(&DOCUMENTREVIEWS_MEMBER_ACTION, val.as_str())?;
          65  +
        }
          66  +
        if let Some(ref val) = self.comment {
          67  +
            ser.write_list(
          68  +
                &DOCUMENTREVIEWS_MEMBER_COMMENT,
          69  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          70  +
                    for item in val {
          71  +
                        ser.write_struct(crate::types::DocumentReviewCommentSource::SCHEMA, item)?;
          72  +
                    }
          73  +
                    Ok(())
          74  +
                },
          75  +
            )?;
          76  +
        }
          77  +
        Ok(())
          78  +
    }
          79  +
}
          80  +
impl DocumentReviews {
          81  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          82  +
    pub fn deserialize(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        #[allow(unused_variables, unused_mut)]
          86  +
        let mut builder = Self::builder();
          87  +
        #[allow(
          88  +
            unused_variables,
          89  +
            unreachable_code,
          90  +
            clippy::single_match,
          91  +
            clippy::match_single_binding,
          92  +
            clippy::diverging_sub_expression
          93  +
        )]
          94  +
        deserializer.read_struct(&DOCUMENTREVIEWS_SCHEMA, &mut |member, deser| {
          95  +
            match member.member_index() {
          96  +
                Some(0) => {
          97  +
                    builder.action = Some(crate::types::DocumentReviewAction::from(deser.read_string(member)?.as_str()));
          98  +
                }
          99  +
                Some(1) => {
         100  +
                    if deser.is_null() {
         101  +
                        deser.read_null()?;
         102  +
                    } else {
         103  +
                        builder.comment = Some({
         104  +
                            let mut container = Vec::new();
         105  +
                            deser.read_list(member, &mut |deser| {
         106  +
                                container.push(crate::types::DocumentReviewCommentSource::deserialize(deser)?);
         107  +
                                Ok(())
         108  +
                            })?;
         109  +
                            container
         110  +
                        });
         111  +
                    }
         112  +
                }
         113  +
                _ => {}
         114  +
            }
         115  +
            Ok(())
         116  +
        })?;
         117  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         118  +
    }
         119  +
}
         120  +
impl DocumentReviews {
         121  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         122  +
    pub fn deserialize_with_response(
         123  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         124  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         125  +
        _status: u16,
         126  +
        _body: &[u8],
         127  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         128  +
        Self::deserialize(deserializer)
         129  +
    }
         130  +
}
         131  +
impl DocumentReviews {
         132  +
    /// Creates a new builder-style object to manufacture [`DocumentReviews`](crate::types::DocumentReviews).
         133  +
    pub fn builder() -> crate::types::builders::DocumentReviewsBuilder {
         134  +
        crate::types::builders::DocumentReviewsBuilder::default()
         135  +
    }
         136  +
}
         137  +
         138  +
/// A builder for [`DocumentReviews`](crate::types::DocumentReviews).
         139  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         140  +
#[non_exhaustive]
         141  +
pub struct DocumentReviewsBuilder {
         142  +
    pub(crate) action: ::std::option::Option<crate::types::DocumentReviewAction>,
         143  +
    pub(crate) comment: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>>,
         144  +
}
         145  +
impl DocumentReviewsBuilder {
         146  +
    /// <p>The action to take on a document approval review request.</p>
         147  +
    /// This field is required.
         148  +
    pub fn action(mut self, input: crate::types::DocumentReviewAction) -> Self {
         149  +
        self.action = ::std::option::Option::Some(input);
         150  +
        self
         151  +
    }
         152  +
    /// <p>The action to take on a document approval review request.</p>
         153  +
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::DocumentReviewAction>) -> Self {
         154  +
        self.action = input;
         155  +
        self
         156  +
    }
         157  +
    /// <p>The action to take on a document approval review request.</p>
         158  +
    pub fn get_action(&self) -> &::std::option::Option<crate::types::DocumentReviewAction> {
         159  +
        &self.action
         160  +
    }
         161  +
    /// Appends an item to `comment`.
         162  +
    ///
         163  +
    /// To override the contents of this collection use [`set_comment`](Self::set_comment).
         164  +
    ///
         165  +
    /// <p>A comment entered by a user in your organization about the document review request.</p>
         166  +
    pub fn comment(mut self, input: crate::types::DocumentReviewCommentSource) -> Self {
         167  +
        let mut v = self.comment.unwrap_or_default();
         168  +
        v.push(input);
         169  +
        self.comment = ::std::option::Option::Some(v);
         170  +
        self
         171  +
    }
         172  +
    /// <p>A comment entered by a user in your organization about the document review request.</p>
         173  +
    pub fn set_comment(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>>) -> Self {
         174  +
        self.comment = input;
         175  +
        self
         176  +
    }
         177  +
    /// <p>A comment entered by a user in your organization about the document review request.</p>
         178  +
    pub fn get_comment(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewCommentSource>> {
         179  +
        &self.comment
         180  +
    }
         181  +
    /// Consumes the builder and constructs a [`DocumentReviews`](crate::types::DocumentReviews).
         182  +
    /// This method will fail if any of the following fields are not set:
         183  +
    /// - [`action`](crate::types::builders::DocumentReviewsBuilder::action)
         184  +
    pub fn build(self) -> ::std::result::Result<crate::types::DocumentReviews, ::aws_smithy_types::error::operation::BuildError> {
         185  +
        ::std::result::Result::Ok(crate::types::DocumentReviews {
         186  +
            action: self.action.ok_or_else(|| {
         187  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         188  +
                    "action",
         189  +
                    "action was not specified but it is required when building DocumentReviews",
         190  +
                )
         191  +
            })?,
         192  +
            comment: self.comment,
         193  +
        })
         194  +
    }
         195  +
}

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

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