AWS SDK

AWS SDK

rev. bbca34fa2eddb4be623fbbc6b6df1a2401de0029 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,258 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>One or more filters. Use a filter to return a more specific list of documents.</p>
           4  +
/// <p>For keys, you can specify one or more tags that have been applied to a document.</p>
           5  +
/// <p>You can also use Amazon Web Services-provided keys, some of which have specific allowed values. These keys and their associated values are as follows:</p>
           6  +
/// <dl>
           7  +
/// <dt>
           8  +
/// DocumentType
           9  +
/// </dt>
          10  +
/// <dd>
          11  +
/// <ul>
          12  +
/// <li>
          13  +
/// <p><code>ApplicationConfiguration</code></p></li>
          14  +
/// <li>
          15  +
/// <p><code>ApplicationConfigurationSchema</code></p></li>
          16  +
/// <li>
          17  +
/// <p><code>Automation</code></p></li>
          18  +
/// <li>
          19  +
/// <p><code>ChangeCalendar</code></p></li>
          20  +
/// <li>
          21  +
/// <p><code>Command</code></p></li>
          22  +
/// <li>
          23  +
/// <p><code>Package</code></p></li>
          24  +
/// <li>
          25  +
/// <p><code>Policy</code></p></li>
          26  +
/// <li>
          27  +
/// <p><code>Session</code></p></li>
          28  +
/// </ul>
          29  +
/// </dd>
          30  +
/// <dt>
          31  +
/// Owner
          32  +
/// </dt>
          33  +
/// <dd>
          34  +
/// <p>Note that only one <code>Owner</code> can be specified in a request. For example: <code>Key=Owner,Values=Self</code>.</p>
          35  +
/// <ul>
          36  +
/// <li>
          37  +
/// <p><code>Amazon</code></p></li>
          38  +
/// <li>
          39  +
/// <p><code>Private</code></p></li>
          40  +
/// <li>
          41  +
/// <p><code>Public</code></p></li>
          42  +
/// <li>
          43  +
/// <p><code>Self</code></p></li>
          44  +
/// <li>
          45  +
/// <p><code>ThirdParty</code></p></li>
          46  +
/// </ul>
          47  +
/// </dd>
          48  +
/// <dt>
          49  +
/// PlatformTypes
          50  +
/// </dt>
          51  +
/// <dd>
          52  +
/// <ul>
          53  +
/// <li>
          54  +
/// <p><code>Linux</code></p></li>
          55  +
/// <li>
          56  +
/// <p><code>Windows</code></p></li>
          57  +
/// </ul>
          58  +
/// </dd>
          59  +
/// </dl>
          60  +
/// <p><code>Name</code> is another Amazon Web Services-provided key. If you use <code>Name</code> as a key, you can use a name prefix to return a list of documents. For example, in the Amazon Web Services CLI, to return a list of all documents that begin with <code>Te</code>, run the following command:</p>
          61  +
/// <p><code>aws ssm list-documents --filters Key=Name,Values=Te</code></p>
          62  +
/// <p>You can also use the <code>TargetType</code> Amazon Web Services-provided key. For a list of valid resource type values that can be used with this key, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the <i>CloudFormation User Guide</i>.</p>
          63  +
/// <p>If you specify more than two keys, only documents that are identified by all the tags are returned in the results. If you specify more than two values for a key, documents that are identified by any of the values are returned in the results.</p>
          64  +
/// <p>To specify a custom key-value pair, use the format <code>Key=tag:tagName,Values=valueName</code>.</p>
          65  +
/// <p>For example, if you created a key called region and are using the Amazon Web Services CLI to call the <code>list-documents</code> command:</p>
          66  +
/// <p><code>aws ssm list-documents --filters Key=tag:region,Values=east,west Key=Owner,Values=Self</code></p>
          67  +
#[non_exhaustive]
          68  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          69  +
pub struct DocumentKeyValuesFilter {
          70  +
    /// <p>The name of the filter key.</p>
          71  +
    pub key: ::std::option::Option<::std::string::String>,
          72  +
    /// <p>The value for the filter key.</p>
          73  +
    pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          74  +
}
          75  +
impl DocumentKeyValuesFilter {
          76  +
    /// <p>The name of the filter key.</p>
          77  +
    pub fn key(&self) -> ::std::option::Option<&str> {
          78  +
        self.key.as_deref()
          79  +
    }
          80  +
    /// <p>The value for the filter key.</p>
          81  +
    ///
          82  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.values.is_none()`.
          83  +
    pub fn values(&self) -> &[::std::string::String] {
          84  +
        self.values.as_deref().unwrap_or_default()
          85  +
    }
          86  +
}
          87  +
static DOCUMENTKEYVALUESFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          88  +
    ::aws_smithy_schema::ShapeId::from_parts(
          89  +
        "com.amazonaws.ssm#DocumentKeyValuesFilter$Key",
          90  +
        "com.amazonaws.ssm",
          91  +
        "DocumentKeyValuesFilter",
          92  +
    ),
          93  +
    ::aws_smithy_schema::ShapeType::String,
          94  +
    "Key",
          95  +
    0,
          96  +
);
          97  +
static DOCUMENTKEYVALUESFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          98  +
    ::aws_smithy_schema::ShapeId::from_parts(
          99  +
        "com.amazonaws.ssm#DocumentKeyValuesFilterValues$member",
         100  +
        "com.amazonaws.ssm",
         101  +
        "DocumentKeyValuesFilterValues",
         102  +
    ),
         103  +
    ::aws_smithy_schema::ShapeType::String,
         104  +
    "member",
         105  +
    0,
         106  +
);
         107  +
static DOCUMENTKEYVALUESFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         108  +
    ::aws_smithy_schema::ShapeId::from_parts(
         109  +
        "com.amazonaws.ssm#DocumentKeyValuesFilter$Values",
         110  +
        "com.amazonaws.ssm",
         111  +
        "DocumentKeyValuesFilter",
         112  +
    ),
         113  +
    ::aws_smithy_schema::ShapeType::List,
         114  +
    "Values",
         115  +
    1,
         116  +
)
         117  +
.with_list_member(&DOCUMENTKEYVALUESFILTER_MEMBER_VALUES_MEMBER);
         118  +
static DOCUMENTKEYVALUESFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         119  +
    ::aws_smithy_schema::ShapeId::from_parts(
         120  +
        "com.amazonaws.ssm#DocumentKeyValuesFilter",
         121  +
        "com.amazonaws.ssm",
         122  +
        "DocumentKeyValuesFilter",
         123  +
    ),
         124  +
    ::aws_smithy_schema::ShapeType::Structure,
         125  +
    &[&DOCUMENTKEYVALUESFILTER_MEMBER_KEY, &DOCUMENTKEYVALUESFILTER_MEMBER_VALUES],
         126  +
);
         127  +
impl DocumentKeyValuesFilter {
         128  +
    /// The schema for this shape.
         129  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTKEYVALUESFILTER_SCHEMA;
         130  +
}
         131  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentKeyValuesFilter {
         132  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         133  +
    fn serialize_members(
         134  +
        &self,
         135  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         136  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         137  +
        if let Some(ref val) = self.key {
         138  +
            ser.write_string(&DOCUMENTKEYVALUESFILTER_MEMBER_KEY, val)?;
         139  +
        }
         140  +
        if let Some(ref val) = self.values {
         141  +
            ser.write_list(
         142  +
                &DOCUMENTKEYVALUESFILTER_MEMBER_VALUES,
         143  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         144  +
                    for item in val {
         145  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         146  +
                    }
         147  +
                    Ok(())
         148  +
                },
         149  +
            )?;
         150  +
        }
         151  +
        Ok(())
         152  +
    }
         153  +
}
         154  +
impl DocumentKeyValuesFilter {
         155  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         156  +
    pub fn deserialize(
         157  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         158  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         159  +
        #[allow(unused_variables, unused_mut)]
         160  +
        let mut builder = Self::builder();
         161  +
        #[allow(
         162  +
            unused_variables,
         163  +
            unreachable_code,
         164  +
            clippy::single_match,
         165  +
            clippy::match_single_binding,
         166  +
            clippy::diverging_sub_expression
         167  +
        )]
         168  +
        deserializer.read_struct(&DOCUMENTKEYVALUESFILTER_SCHEMA, &mut |member, deser| {
         169  +
            match member.member_index() {
         170  +
                Some(0) => {
         171  +
                    if deser.is_null() {
         172  +
                        deser.read_null()?;
         173  +
                    } else {
         174  +
                        builder.key = Some(deser.read_string(member)?);
         175  +
                    }
         176  +
                }
         177  +
                Some(1) => {
         178  +
                    if deser.is_null() {
         179  +
                        deser.read_null()?;
         180  +
                    } else {
         181  +
                        builder.values = Some(deser.read_string_list(member)?);
         182  +
                    }
         183  +
                }
         184  +
                _ => {}
         185  +
            }
         186  +
            Ok(())
         187  +
        })?;
         188  +
        Ok(builder.build())
         189  +
    }
         190  +
}
         191  +
impl DocumentKeyValuesFilter {
         192  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         193  +
    pub fn deserialize_with_response(
         194  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         195  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         196  +
        _status: u16,
         197  +
        _body: &[u8],
         198  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         199  +
        Self::deserialize(deserializer)
         200  +
    }
         201  +
}
         202  +
impl DocumentKeyValuesFilter {
         203  +
    /// Creates a new builder-style object to manufacture [`DocumentKeyValuesFilter`](crate::types::DocumentKeyValuesFilter).
         204  +
    pub fn builder() -> crate::types::builders::DocumentKeyValuesFilterBuilder {
         205  +
        crate::types::builders::DocumentKeyValuesFilterBuilder::default()
         206  +
    }
         207  +
}
         208  +
         209  +
/// A builder for [`DocumentKeyValuesFilter`](crate::types::DocumentKeyValuesFilter).
         210  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         211  +
#[non_exhaustive]
         212  +
pub struct DocumentKeyValuesFilterBuilder {
         213  +
    pub(crate) key: ::std::option::Option<::std::string::String>,
         214  +
    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         215  +
}
         216  +
impl DocumentKeyValuesFilterBuilder {
         217  +
    /// <p>The name of the filter key.</p>
         218  +
    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         219  +
        self.key = ::std::option::Option::Some(input.into());
         220  +
        self
         221  +
    }
         222  +
    /// <p>The name of the filter key.</p>
         223  +
    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         224  +
        self.key = input;
         225  +
        self
         226  +
    }
         227  +
    /// <p>The name of the filter key.</p>
         228  +
    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
         229  +
        &self.key
         230  +
    }
         231  +
    /// Appends an item to `values`.
         232  +
    ///
         233  +
    /// To override the contents of this collection use [`set_values`](Self::set_values).
         234  +
    ///
         235  +
    /// <p>The value for the filter key.</p>
         236  +
    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         237  +
        let mut v = self.values.unwrap_or_default();
         238  +
        v.push(input.into());
         239  +
        self.values = ::std::option::Option::Some(v);
         240  +
        self
         241  +
    }
         242  +
    /// <p>The value for the filter key.</p>
         243  +
    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         244  +
        self.values = input;
         245  +
        self
         246  +
    }
         247  +
    /// <p>The value for the filter key.</p>
         248  +
    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         249  +
        &self.values
         250  +
    }
         251  +
    /// Consumes the builder and constructs a [`DocumentKeyValuesFilter`](crate::types::DocumentKeyValuesFilter).
         252  +
    pub fn build(self) -> crate::types::DocumentKeyValuesFilter {
         253  +
        crate::types::DocumentKeyValuesFilter {
         254  +
            key: self.key,
         255  +
            values: self.values,
         256  +
        }
         257  +
    }
         258  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_document_metadata_enum.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 `DocumentMetadataEnum`, 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 documentmetadataenum = unimplemented!();
          14  +
/// match documentmetadataenum {
          15  +
///     DocumentMetadataEnum::DocumentReviews => { /* ... */ },
          16  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          17  +
///     _ => { /* ... */ },
          18  +
/// }
          19  +
/// ```
          20  +
/// The above code demonstrates that when `documentmetadataenum` represents
          21  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          22  +
/// even though the enum does not contain a variant `DocumentMetadataEnum::NewFeature`
          23  +
/// in the current version of SDK. The reason is that the variable `other`,
          24  +
/// created by the `@` operator, is bound to
          25  +
/// `DocumentMetadataEnum::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 `DocumentMetadataEnum::NewFeature` is defined.
          29  +
/// Specifically, when `documentmetadataenum` represents `NewFeature`,
          30  +
/// the execution path will hit the second last match arm as before by virtue of
          31  +
/// calling `as_str` on `DocumentMetadataEnum::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 DocumentMetadataEnum {
          44  +
    #[allow(missing_docs)] // documentation missing in model
          45  +
    DocumentReviews,
          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 DocumentMetadataEnum {
          51  +
    fn from(s: &str) -> Self {
          52  +
        match s {
          53  +
            "DocumentReviews" => DocumentMetadataEnum::DocumentReviews,
          54  +
            other => DocumentMetadataEnum::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          55  +
        }
          56  +
    }
          57  +
}
          58  +
impl ::std::str::FromStr for DocumentMetadataEnum {
          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(DocumentMetadataEnum::from(s))
          63  +
    }
          64  +
}
          65  +
impl DocumentMetadataEnum {
          66  +
    /// Returns the `&str` value of the enum member.
          67  +
    pub fn as_str(&self) -> &str {
          68  +
        match self {
          69  +
            DocumentMetadataEnum::DocumentReviews => "DocumentReviews",
          70  +
            DocumentMetadataEnum::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  +
        &["DocumentReviews"]
          76  +
    }
          77  +
}
          78  +
impl ::std::convert::AsRef<str> for DocumentMetadataEnum {
          79  +
    fn as_ref(&self) -> &str {
          80  +
        self.as_str()
          81  +
    }
          82  +
}
          83  +
impl DocumentMetadataEnum {
          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 DocumentMetadataEnum {
          96  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
          97  +
        match self {
          98  +
            DocumentMetadataEnum::DocumentReviews => write!(f, "DocumentReviews"),
          99  +
            DocumentMetadataEnum::Unknown(value) => write!(f, "{value}"),
         100  +
        }
         101  +
    }
         102  +
}

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

@@ -0,1 +0,160 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Details about the response to a document review request.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct DocumentMetadataResponseInfo {
           7  +
    /// <p>Details about a reviewer's response to a document review request.</p>
           8  +
    pub reviewer_response: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewerResponseSource>>,
           9  +
}
          10  +
impl DocumentMetadataResponseInfo {
          11  +
    /// <p>Details about a reviewer's response to a document review request.</p>
          12  +
    ///
          13  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.reviewer_response.is_none()`.
          14  +
    pub fn reviewer_response(&self) -> &[crate::types::DocumentReviewerResponseSource] {
          15  +
        self.reviewer_response.as_deref().unwrap_or_default()
          16  +
    }
          17  +
}
          18  +
static DOCUMENTMETADATARESPONSEINFO_MEMBER_REVIEWER_RESPONSE_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          19  +
    ::aws_smithy_schema::ShapeId::from_parts(
          20  +
        "com.amazonaws.ssm#DocumentReviewerResponseList$member",
          21  +
        "com.amazonaws.ssm",
          22  +
        "DocumentReviewerResponseList",
          23  +
    ),
          24  +
    ::aws_smithy_schema::ShapeType::Structure,
          25  +
    "member",
          26  +
    0,
          27  +
);
          28  +
static DOCUMENTMETADATARESPONSEINFO_MEMBER_REVIEWER_RESPONSE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          29  +
    ::aws_smithy_schema::ShapeId::from_parts(
          30  +
        "com.amazonaws.ssm#DocumentMetadataResponseInfo$ReviewerResponse",
          31  +
        "com.amazonaws.ssm",
          32  +
        "DocumentMetadataResponseInfo",
          33  +
    ),
          34  +
    ::aws_smithy_schema::ShapeType::List,
          35  +
    "ReviewerResponse",
          36  +
    0,
          37  +
)
          38  +
.with_list_member(&DOCUMENTMETADATARESPONSEINFO_MEMBER_REVIEWER_RESPONSE_MEMBER);
          39  +
static DOCUMENTMETADATARESPONSEINFO_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          40  +
    ::aws_smithy_schema::ShapeId::from_parts(
          41  +
        "com.amazonaws.ssm#DocumentMetadataResponseInfo",
          42  +
        "com.amazonaws.ssm",
          43  +
        "DocumentMetadataResponseInfo",
          44  +
    ),
          45  +
    ::aws_smithy_schema::ShapeType::Structure,
          46  +
    &[&DOCUMENTMETADATARESPONSEINFO_MEMBER_REVIEWER_RESPONSE],
          47  +
);
          48  +
impl DocumentMetadataResponseInfo {
          49  +
    /// The schema for this shape.
          50  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTMETADATARESPONSEINFO_SCHEMA;
          51  +
}
          52  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentMetadataResponseInfo {
          53  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          54  +
    fn serialize_members(
          55  +
        &self,
          56  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          57  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          58  +
        if let Some(ref val) = self.reviewer_response {
          59  +
            ser.write_list(
          60  +
                &DOCUMENTMETADATARESPONSEINFO_MEMBER_REVIEWER_RESPONSE,
          61  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          62  +
                    for item in val {
          63  +
                        ser.write_struct(crate::types::DocumentReviewerResponseSource::SCHEMA, item)?;
          64  +
                    }
          65  +
                    Ok(())
          66  +
                },
          67  +
            )?;
          68  +
        }
          69  +
        Ok(())
          70  +
    }
          71  +
}
          72  +
impl DocumentMetadataResponseInfo {
          73  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          74  +
    pub fn deserialize(
          75  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          76  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          77  +
        #[allow(unused_variables, unused_mut)]
          78  +
        let mut builder = Self::builder();
          79  +
        #[allow(
          80  +
            unused_variables,
          81  +
            unreachable_code,
          82  +
            clippy::single_match,
          83  +
            clippy::match_single_binding,
          84  +
            clippy::diverging_sub_expression
          85  +
        )]
          86  +
        deserializer.read_struct(&DOCUMENTMETADATARESPONSEINFO_SCHEMA, &mut |member, deser| {
          87  +
            match member.member_index() {
          88  +
                Some(0) => {
          89  +
                    if deser.is_null() {
          90  +
                        deser.read_null()?;
          91  +
                    } else {
          92  +
                        builder.reviewer_response = Some({
          93  +
                            let mut container = Vec::new();
          94  +
                            deser.read_list(member, &mut |deser| {
          95  +
                                container.push(crate::types::DocumentReviewerResponseSource::deserialize(deser)?);
          96  +
                                Ok(())
          97  +
                            })?;
          98  +
                            container
          99  +
                        });
         100  +
                    }
         101  +
                }
         102  +
                _ => {}
         103  +
            }
         104  +
            Ok(())
         105  +
        })?;
         106  +
        Ok(builder.build())
         107  +
    }
         108  +
}
         109  +
impl DocumentMetadataResponseInfo {
         110  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         111  +
    pub fn deserialize_with_response(
         112  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         113  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         114  +
        _status: u16,
         115  +
        _body: &[u8],
         116  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         117  +
        Self::deserialize(deserializer)
         118  +
    }
         119  +
}
         120  +
impl DocumentMetadataResponseInfo {
         121  +
    /// Creates a new builder-style object to manufacture [`DocumentMetadataResponseInfo`](crate::types::DocumentMetadataResponseInfo).
         122  +
    pub fn builder() -> crate::types::builders::DocumentMetadataResponseInfoBuilder {
         123  +
        crate::types::builders::DocumentMetadataResponseInfoBuilder::default()
         124  +
    }
         125  +
}
         126  +
         127  +
/// A builder for [`DocumentMetadataResponseInfo`](crate::types::DocumentMetadataResponseInfo).
         128  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         129  +
#[non_exhaustive]
         130  +
pub struct DocumentMetadataResponseInfoBuilder {
         131  +
    pub(crate) reviewer_response: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewerResponseSource>>,
         132  +
}
         133  +
impl DocumentMetadataResponseInfoBuilder {
         134  +
    /// Appends an item to `reviewer_response`.
         135  +
    ///
         136  +
    /// To override the contents of this collection use [`set_reviewer_response`](Self::set_reviewer_response).
         137  +
    ///
         138  +
    /// <p>Details about a reviewer's response to a document review request.</p>
         139  +
    pub fn reviewer_response(mut self, input: crate::types::DocumentReviewerResponseSource) -> Self {
         140  +
        let mut v = self.reviewer_response.unwrap_or_default();
         141  +
        v.push(input);
         142  +
        self.reviewer_response = ::std::option::Option::Some(v);
         143  +
        self
         144  +
    }
         145  +
    /// <p>Details about a reviewer's response to a document review request.</p>
         146  +
    pub fn set_reviewer_response(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewerResponseSource>>) -> Self {
         147  +
        self.reviewer_response = input;
         148  +
        self
         149  +
    }
         150  +
    /// <p>Details about a reviewer's response to a document review request.</p>
         151  +
    pub fn get_reviewer_response(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentReviewerResponseSource>> {
         152  +
        &self.reviewer_response
         153  +
    }
         154  +
    /// Consumes the builder and constructs a [`DocumentMetadataResponseInfo`](crate::types::DocumentMetadataResponseInfo).
         155  +
    pub fn build(self) -> crate::types::DocumentMetadataResponseInfo {
         156  +
        crate::types::DocumentMetadataResponseInfo {
         157  +
            reviewer_response: self.reviewer_response,
         158  +
        }
         159  +
    }
         160  +
}

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

@@ -0,1 +0,245 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Parameters specified in a Systems Manager document that run on the server when the command is run.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct DocumentParameter {
           7  +
    /// <p>The name of the parameter.</p>
           8  +
    pub name: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>The type of parameter. The type can be either String or StringList.</p>
          10  +
    pub r#type: ::std::option::Option<crate::types::DocumentParameterType>,
          11  +
    /// <p>A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.</p>
          12  +
    pub description: ::std::option::Option<::std::string::String>,
          13  +
    /// <p>If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.</p>
          14  +
    pub default_value: ::std::option::Option<::std::string::String>,
          15  +
}
          16  +
impl DocumentParameter {
          17  +
    /// <p>The name of the parameter.</p>
          18  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          19  +
        self.name.as_deref()
          20  +
    }
          21  +
    /// <p>The type of parameter. The type can be either String or StringList.</p>
          22  +
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::DocumentParameterType> {
          23  +
        self.r#type.as_ref()
          24  +
    }
          25  +
    /// <p>A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.</p>
          26  +
    pub fn description(&self) -> ::std::option::Option<&str> {
          27  +
        self.description.as_deref()
          28  +
    }
          29  +
    /// <p>If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.</p>
          30  +
    pub fn default_value(&self) -> ::std::option::Option<&str> {
          31  +
        self.default_value.as_deref()
          32  +
    }
          33  +
}
          34  +
static DOCUMENTPARAMETER_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentParameter$Name", "com.amazonaws.ssm", "DocumentParameter"),
          36  +
    ::aws_smithy_schema::ShapeType::String,
          37  +
    "Name",
          38  +
    0,
          39  +
);
          40  +
static DOCUMENTPARAMETER_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentParameter$Type", "com.amazonaws.ssm", "DocumentParameter"),
          42  +
    ::aws_smithy_schema::ShapeType::String,
          43  +
    "Type",
          44  +
    1,
          45  +
);
          46  +
static DOCUMENTPARAMETER_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          47  +
    ::aws_smithy_schema::ShapeId::from_parts(
          48  +
        "com.amazonaws.ssm#DocumentParameter$Description",
          49  +
        "com.amazonaws.ssm",
          50  +
        "DocumentParameter",
          51  +
    ),
          52  +
    ::aws_smithy_schema::ShapeType::String,
          53  +
    "Description",
          54  +
    2,
          55  +
);
          56  +
static DOCUMENTPARAMETER_MEMBER_DEFAULT_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          57  +
    ::aws_smithy_schema::ShapeId::from_parts(
          58  +
        "com.amazonaws.ssm#DocumentParameter$DefaultValue",
          59  +
        "com.amazonaws.ssm",
          60  +
        "DocumentParameter",
          61  +
    ),
          62  +
    ::aws_smithy_schema::ShapeType::String,
          63  +
    "DefaultValue",
          64  +
    3,
          65  +
);
          66  +
static DOCUMENTPARAMETER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          67  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentParameter", "com.amazonaws.ssm", "DocumentParameter"),
          68  +
    ::aws_smithy_schema::ShapeType::Structure,
          69  +
    &[
          70  +
        &DOCUMENTPARAMETER_MEMBER_NAME,
          71  +
        &DOCUMENTPARAMETER_MEMBER_TYPE,
          72  +
        &DOCUMENTPARAMETER_MEMBER_DESCRIPTION,
          73  +
        &DOCUMENTPARAMETER_MEMBER_DEFAULT_VALUE,
          74  +
    ],
          75  +
);
          76  +
impl DocumentParameter {
          77  +
    /// The schema for this shape.
          78  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTPARAMETER_SCHEMA;
          79  +
}
          80  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentParameter {
          81  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          82  +
    fn serialize_members(
          83  +
        &self,
          84  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          85  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          86  +
        if let Some(ref val) = self.name {
          87  +
            ser.write_string(&DOCUMENTPARAMETER_MEMBER_NAME, val)?;
          88  +
        }
          89  +
        if let Some(ref val) = self.r#type {
          90  +
            ser.write_string(&DOCUMENTPARAMETER_MEMBER_TYPE, val.as_str())?;
          91  +
        }
          92  +
        if let Some(ref val) = self.description {
          93  +
            ser.write_string(&DOCUMENTPARAMETER_MEMBER_DESCRIPTION, val)?;
          94  +
        }
          95  +
        if let Some(ref val) = self.default_value {
          96  +
            ser.write_string(&DOCUMENTPARAMETER_MEMBER_DEFAULT_VALUE, val)?;
          97  +
        }
          98  +
        Ok(())
          99  +
    }
         100  +
}
         101  +
impl DocumentParameter {
         102  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         103  +
    pub fn deserialize(
         104  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         105  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         106  +
        #[allow(unused_variables, unused_mut)]
         107  +
        let mut builder = Self::builder();
         108  +
        #[allow(
         109  +
            unused_variables,
         110  +
            unreachable_code,
         111  +
            clippy::single_match,
         112  +
            clippy::match_single_binding,
         113  +
            clippy::diverging_sub_expression
         114  +
        )]
         115  +
        deserializer.read_struct(&DOCUMENTPARAMETER_SCHEMA, &mut |member, deser| {
         116  +
            match member.member_index() {
         117  +
                Some(0) => {
         118  +
                    if deser.is_null() {
         119  +
                        deser.read_null()?;
         120  +
                    } else {
         121  +
                        builder.name = Some(deser.read_string(member)?);
         122  +
                    }
         123  +
                }
         124  +
                Some(1) => {
         125  +
                    if deser.is_null() {
         126  +
                        deser.read_null()?;
         127  +
                    } else {
         128  +
                        builder.r#type = Some(crate::types::DocumentParameterType::from(deser.read_string(member)?.as_str()));
         129  +
                    }
         130  +
                }
         131  +
                Some(2) => {
         132  +
                    if deser.is_null() {
         133  +
                        deser.read_null()?;
         134  +
                    } else {
         135  +
                        builder.description = Some(deser.read_string(member)?);
         136  +
                    }
         137  +
                }
         138  +
                Some(3) => {
         139  +
                    if deser.is_null() {
         140  +
                        deser.read_null()?;
         141  +
                    } else {
         142  +
                        builder.default_value = Some(deser.read_string(member)?);
         143  +
                    }
         144  +
                }
         145  +
                _ => {}
         146  +
            }
         147  +
            Ok(())
         148  +
        })?;
         149  +
        Ok(builder.build())
         150  +
    }
         151  +
}
         152  +
impl DocumentParameter {
         153  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         154  +
    pub fn deserialize_with_response(
         155  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         156  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         157  +
        _status: u16,
         158  +
        _body: &[u8],
         159  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         160  +
        Self::deserialize(deserializer)
         161  +
    }
         162  +
}
         163  +
impl DocumentParameter {
         164  +
    /// Creates a new builder-style object to manufacture [`DocumentParameter`](crate::types::DocumentParameter).
         165  +
    pub fn builder() -> crate::types::builders::DocumentParameterBuilder {
         166  +
        crate::types::builders::DocumentParameterBuilder::default()
         167  +
    }
         168  +
}
         169  +
         170  +
/// A builder for [`DocumentParameter`](crate::types::DocumentParameter).
         171  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         172  +
#[non_exhaustive]
         173  +
pub struct DocumentParameterBuilder {
         174  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         175  +
    pub(crate) r#type: ::std::option::Option<crate::types::DocumentParameterType>,
         176  +
    pub(crate) description: ::std::option::Option<::std::string::String>,
         177  +
    pub(crate) default_value: ::std::option::Option<::std::string::String>,
         178  +
}
         179  +
impl DocumentParameterBuilder {
         180  +
    /// <p>The name of the parameter.</p>
         181  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         182  +
        self.name = ::std::option::Option::Some(input.into());
         183  +
        self
         184  +
    }
         185  +
    /// <p>The name of the parameter.</p>
         186  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         187  +
        self.name = input;
         188  +
        self
         189  +
    }
         190  +
    /// <p>The name of the parameter.</p>
         191  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         192  +
        &self.name
         193  +
    }
         194  +
    /// <p>The type of parameter. The type can be either String or StringList.</p>
         195  +
    pub fn r#type(mut self, input: crate::types::DocumentParameterType) -> Self {
         196  +
        self.r#type = ::std::option::Option::Some(input);
         197  +
        self
         198  +
    }
         199  +
    /// <p>The type of parameter. The type can be either String or StringList.</p>
         200  +
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::DocumentParameterType>) -> Self {
         201  +
        self.r#type = input;
         202  +
        self
         203  +
    }
         204  +
    /// <p>The type of parameter. The type can be either String or StringList.</p>
         205  +
    pub fn get_type(&self) -> &::std::option::Option<crate::types::DocumentParameterType> {
         206  +
        &self.r#type
         207  +
    }
         208  +
    /// <p>A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.</p>
         209  +
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         210  +
        self.description = ::std::option::Option::Some(input.into());
         211  +
        self
         212  +
    }
         213  +
    /// <p>A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.</p>
         214  +
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         215  +
        self.description = input;
         216  +
        self
         217  +
    }
         218  +
    /// <p>A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.</p>
         219  +
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
         220  +
        &self.description
         221  +
    }
         222  +
    /// <p>If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.</p>
         223  +
    pub fn default_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         224  +
        self.default_value = ::std::option::Option::Some(input.into());
         225  +
        self
         226  +
    }
         227  +
    /// <p>If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.</p>
         228  +
    pub fn set_default_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         229  +
        self.default_value = input;
         230  +
        self
         231  +
    }
         232  +
    /// <p>If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.</p>
         233  +
    pub fn get_default_value(&self) -> &::std::option::Option<::std::string::String> {
         234  +
        &self.default_value
         235  +
    }
         236  +
    /// Consumes the builder and constructs a [`DocumentParameter`](crate::types::DocumentParameter).
         237  +
    pub fn build(self) -> crate::types::DocumentParameter {
         238  +
        crate::types::DocumentParameter {
         239  +
            name: self.name,
         240  +
            r#type: self.r#type,
         241  +
            description: self.description,
         242  +
            default_value: self.default_value,
         243  +
        }
         244  +
    }
         245  +
}

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

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_document_permission_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 `DocumentPermissionType`, 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 documentpermissiontype = unimplemented!();
          14  +
/// match documentpermissiontype {
          15  +
///     DocumentPermissionType::Share => { /* ... */ },
          16  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          17  +
///     _ => { /* ... */ },
          18  +
/// }
          19  +
/// ```
          20  +
/// The above code demonstrates that when `documentpermissiontype` represents
          21  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          22  +
/// even though the enum does not contain a variant `DocumentPermissionType::NewFeature`
          23  +
/// in the current version of SDK. The reason is that the variable `other`,
          24  +
/// created by the `@` operator, is bound to
          25  +
/// `DocumentPermissionType::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 `DocumentPermissionType::NewFeature` is defined.
          29  +
/// Specifically, when `documentpermissiontype` represents `NewFeature`,
          30  +
/// the execution path will hit the second last match arm as before by virtue of
          31  +
/// calling `as_str` on `DocumentPermissionType::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 DocumentPermissionType {
          44  +
    #[allow(missing_docs)] // documentation missing in model
          45  +
    Share,
          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 DocumentPermissionType {
          51  +
    fn from(s: &str) -> Self {
          52  +
        match s {
          53  +
            "Share" => DocumentPermissionType::Share,
          54  +
            other => DocumentPermissionType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          55  +
        }
          56  +
    }
          57  +
}
          58  +
impl ::std::str::FromStr for DocumentPermissionType {
          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(DocumentPermissionType::from(s))
          63  +
    }
          64  +
}
          65  +
impl DocumentPermissionType {
          66  +
    /// Returns the `&str` value of the enum member.
          67  +
    pub fn as_str(&self) -> &str {
          68  +
        match self {
          69  +
            DocumentPermissionType::Share => "Share",
          70  +
            DocumentPermissionType::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  +
        &["Share"]
          76  +
    }
          77  +
}
          78  +
impl ::std::convert::AsRef<str> for DocumentPermissionType {
          79  +
    fn as_ref(&self) -> &str {
          80  +
        self.as_str()
          81  +
    }
          82  +
}
          83  +
impl DocumentPermissionType {
          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 DocumentPermissionType {
          96  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
          97  +
        match self {
          98  +
            DocumentPermissionType::Share => write!(f, "Share"),
          99  +
            DocumentPermissionType::Unknown(value) => write!(f, "{value}"),
         100  +
        }
         101  +
    }
         102  +
}

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

@@ -0,1 +0,244 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>An SSM document required by the current document.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct DocumentRequires {
           7  +
    /// <p>The name of the required SSM document. The name can be an Amazon Resource Name (ARN).</p>
           8  +
    pub name: ::std::string::String,
           9  +
    /// <p>The document version required by the current document.</p>
          10  +
    pub version: ::std::option::Option<::std::string::String>,
          11  +
    /// <p>The document type of the required SSM document.</p>
          12  +
    pub require_type: ::std::option::Option<::std::string::String>,
          13  +
    /// <p>An optional field specifying 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  +
}
          16  +
impl DocumentRequires {
          17  +
    /// <p>The name of the required SSM document. The name can be an Amazon Resource Name (ARN).</p>
          18  +
    pub fn name(&self) -> &str {
          19  +
        use std::ops::Deref;
          20  +
        self.name.deref()
          21  +
    }
          22  +
    /// <p>The document version required by the current document.</p>
          23  +
    pub fn version(&self) -> ::std::option::Option<&str> {
          24  +
        self.version.as_deref()
          25  +
    }
          26  +
    /// <p>The document type of the required SSM document.</p>
          27  +
    pub fn require_type(&self) -> ::std::option::Option<&str> {
          28  +
        self.require_type.as_deref()
          29  +
    }
          30  +
    /// <p>An optional field specifying 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>
          31  +
    pub fn version_name(&self) -> ::std::option::Option<&str> {
          32  +
        self.version_name.as_deref()
          33  +
    }
          34  +
}
          35  +
static DOCUMENTREQUIRES_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          36  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentRequires$Name", "com.amazonaws.ssm", "DocumentRequires"),
          37  +
    ::aws_smithy_schema::ShapeType::String,
          38  +
    "Name",
          39  +
    0,
          40  +
);
          41  +
static DOCUMENTREQUIRES_MEMBER_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          42  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentRequires$Version", "com.amazonaws.ssm", "DocumentRequires"),
          43  +
    ::aws_smithy_schema::ShapeType::String,
          44  +
    "Version",
          45  +
    1,
          46  +
);
          47  +
static DOCUMENTREQUIRES_MEMBER_REQUIRE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          48  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentRequires$RequireType", "com.amazonaws.ssm", "DocumentRequires"),
          49  +
    ::aws_smithy_schema::ShapeType::String,
          50  +
    "RequireType",
          51  +
    2,
          52  +
);
          53  +
static DOCUMENTREQUIRES_MEMBER_VERSION_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentRequires$VersionName", "com.amazonaws.ssm", "DocumentRequires"),
          55  +
    ::aws_smithy_schema::ShapeType::String,
          56  +
    "VersionName",
          57  +
    3,
          58  +
);
          59  +
static DOCUMENTREQUIRES_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          60  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#DocumentRequires", "com.amazonaws.ssm", "DocumentRequires"),
          61  +
    ::aws_smithy_schema::ShapeType::Structure,
          62  +
    &[
          63  +
        &DOCUMENTREQUIRES_MEMBER_NAME,
          64  +
        &DOCUMENTREQUIRES_MEMBER_VERSION,
          65  +
        &DOCUMENTREQUIRES_MEMBER_REQUIRE_TYPE,
          66  +
        &DOCUMENTREQUIRES_MEMBER_VERSION_NAME,
          67  +
    ],
          68  +
);
          69  +
impl DocumentRequires {
          70  +
    /// The schema for this shape.
          71  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTREQUIRES_SCHEMA;
          72  +
}
          73  +
impl ::aws_smithy_schema::serde::SerializableStruct for DocumentRequires {
          74  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          75  +
    fn serialize_members(
          76  +
        &self,
          77  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          78  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          79  +
        {
          80  +
            let val = &self.name;
          81  +
            ser.write_string(&DOCUMENTREQUIRES_MEMBER_NAME, val)?;
          82  +
        }
          83  +
        if let Some(ref val) = self.version {
          84  +
            ser.write_string(&DOCUMENTREQUIRES_MEMBER_VERSION, val)?;
          85  +
        }
          86  +
        if let Some(ref val) = self.require_type {
          87  +
            ser.write_string(&DOCUMENTREQUIRES_MEMBER_REQUIRE_TYPE, val)?;
          88  +
        }
          89  +
        if let Some(ref val) = self.version_name {
          90  +
            ser.write_string(&DOCUMENTREQUIRES_MEMBER_VERSION_NAME, val)?;
          91  +
        }
          92  +
        Ok(())
          93  +
    }
          94  +
}
          95  +
impl DocumentRequires {
          96  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          97  +
    pub fn deserialize(
          98  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          99  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         100  +
        #[allow(unused_variables, unused_mut)]
         101  +
        let mut builder = Self::builder();
         102  +
        #[allow(
         103  +
            unused_variables,
         104  +
            unreachable_code,
         105  +
            clippy::single_match,
         106  +
            clippy::match_single_binding,
         107  +
            clippy::diverging_sub_expression
         108  +
        )]
         109  +
        deserializer.read_struct(&DOCUMENTREQUIRES_SCHEMA, &mut |member, deser| {
         110  +
            match member.member_index() {
         111  +
                Some(0) => {
         112  +
                    builder.name = Some(deser.read_string(member)?);
         113  +
                }
         114  +
                Some(1) => {
         115  +
                    if deser.is_null() {
         116  +
                        deser.read_null()?;
         117  +
                    } else {
         118  +
                        builder.version = Some(deser.read_string(member)?);
         119  +
                    }
         120  +
                }
         121  +
                Some(2) => {
         122  +
                    if deser.is_null() {
         123  +
                        deser.read_null()?;
         124  +
                    } else {
         125  +
                        builder.require_type = Some(deser.read_string(member)?);
         126  +
                    }
         127  +
                }
         128  +
                Some(3) => {
         129  +
                    if deser.is_null() {
         130  +
                        deser.read_null()?;
         131  +
                    } else {
         132  +
                        builder.version_name = Some(deser.read_string(member)?);
         133  +
                    }
         134  +
                }
         135  +
                _ => {}
         136  +
            }
         137  +
            Ok(())
         138  +
        })?;
         139  +
        builder.name = builder.name.or(Some(String::new()));
         140  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         141  +
    }
         142  +
}
         143  +
impl DocumentRequires {
         144  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         145  +
    pub fn deserialize_with_response(
         146  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         147  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         148  +
        _status: u16,
         149  +
        _body: &[u8],
         150  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         151  +
        Self::deserialize(deserializer)
         152  +
    }
         153  +
}
         154  +
impl DocumentRequires {
         155  +
    /// Creates a new builder-style object to manufacture [`DocumentRequires`](crate::types::DocumentRequires).
         156  +
    pub fn builder() -> crate::types::builders::DocumentRequiresBuilder {
         157  +
        crate::types::builders::DocumentRequiresBuilder::default()
         158  +
    }
         159  +
}
         160  +
         161  +
/// A builder for [`DocumentRequires`](crate::types::DocumentRequires).
         162  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         163  +
#[non_exhaustive]
         164  +
pub struct DocumentRequiresBuilder {
         165  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         166  +
    pub(crate) version: ::std::option::Option<::std::string::String>,
         167  +
    pub(crate) require_type: ::std::option::Option<::std::string::String>,
         168  +
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
         169  +
}
         170  +
impl DocumentRequiresBuilder {
         171  +
    /// <p>The name of the required SSM document. The name can be an Amazon Resource Name (ARN).</p>
         172  +
    /// This field is required.
         173  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         174  +
        self.name = ::std::option::Option::Some(input.into());
         175  +
        self
         176  +
    }
         177  +
    /// <p>The name of the required SSM document. The name can be an Amazon Resource Name (ARN).</p>
         178  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         179  +
        self.name = input;
         180  +
        self
         181  +
    }
         182  +
    /// <p>The name of the required SSM document. The name can be an Amazon Resource Name (ARN).</p>
         183  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         184  +
        &self.name
         185  +
    }
         186  +
    /// <p>The document version required by the current document.</p>
         187  +
    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         188  +
        self.version = ::std::option::Option::Some(input.into());
         189  +
        self
         190  +
    }
         191  +
    /// <p>The document version required by the current document.</p>
         192  +
    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         193  +
        self.version = input;
         194  +
        self
         195  +
    }
         196  +
    /// <p>The document version required by the current document.</p>
         197  +
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
         198  +
        &self.version
         199  +
    }
         200  +
    /// <p>The document type of the required SSM document.</p>
         201  +
    pub fn require_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         202  +
        self.require_type = ::std::option::Option::Some(input.into());
         203  +
        self
         204  +
    }
         205  +
    /// <p>The document type of the required SSM document.</p>
         206  +
    pub fn set_require_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         207  +
        self.require_type = input;
         208  +
        self
         209  +
    }
         210  +
    /// <p>The document type of the required SSM document.</p>
         211  +
    pub fn get_require_type(&self) -> &::std::option::Option<::std::string::String> {
         212  +
        &self.require_type
         213  +
    }
         214  +
    /// <p>An optional field specifying 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>
         215  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         216  +
        self.version_name = ::std::option::Option::Some(input.into());
         217  +
        self
         218  +
    }
         219  +
    /// <p>An optional field specifying 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>
         220  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         221  +
        self.version_name = input;
         222  +
        self
         223  +
    }
         224  +
    /// <p>An optional field specifying 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>
         225  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         226  +
        &self.version_name
         227  +
    }
         228  +
    /// Consumes the builder and constructs a [`DocumentRequires`](crate::types::DocumentRequires).
         229  +
    /// This method will fail if any of the following fields are not set:
         230  +
    /// - [`name`](crate::types::builders::DocumentRequiresBuilder::name)
         231  +
    pub fn build(self) -> ::std::result::Result<crate::types::DocumentRequires, ::aws_smithy_types::error::operation::BuildError> {
         232  +
        ::std::result::Result::Ok(crate::types::DocumentRequires {
         233  +
            name: self.name.ok_or_else(|| {
         234  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         235  +
                    "name",
         236  +
                    "name was not specified but it is required when building DocumentRequires",
         237  +
                )
         238  +
            })?,
         239  +
            version: self.version,
         240  +
            require_type: self.require_type,
         241  +
            version_name: self.version_name,
         242  +
        })
         243  +
    }
         244  +
}