AWS SDK

AWS SDK

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,281 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>One or more aggregators for viewing counts of nodes using different dimensions.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct NodeAggregator {
           7  +
    /// <p>The aggregator type for limiting a node summary. Currently, only <code>Count</code> is supported.</p>
           8  +
    pub aggregator_type: crate::types::NodeAggregatorType,
           9  +
    /// <p>The data type name to use for viewing counts of nodes. Currently, only <code>Instance</code> is supported.</p>
          10  +
    pub type_name: crate::types::NodeTypeName,
          11  +
    /// <p>The name of a node attribute on which to limit the count of nodes.</p>
          12  +
    pub attribute_name: crate::types::NodeAttributeName,
          13  +
    /// <p>Information about aggregators used to refine a node summary.</p>
          14  +
    pub aggregators: ::std::option::Option<::std::vec::Vec<crate::types::NodeAggregator>>,
          15  +
}
          16  +
impl NodeAggregator {
          17  +
    /// <p>The aggregator type for limiting a node summary. Currently, only <code>Count</code> is supported.</p>
          18  +
    pub fn aggregator_type(&self) -> &crate::types::NodeAggregatorType {
          19  +
        &self.aggregator_type
          20  +
    }
          21  +
    /// <p>The data type name to use for viewing counts of nodes. Currently, only <code>Instance</code> is supported.</p>
          22  +
    pub fn type_name(&self) -> &crate::types::NodeTypeName {
          23  +
        &self.type_name
          24  +
    }
          25  +
    /// <p>The name of a node attribute on which to limit the count of nodes.</p>
          26  +
    pub fn attribute_name(&self) -> &crate::types::NodeAttributeName {
          27  +
        &self.attribute_name
          28  +
    }
          29  +
    /// <p>Information about aggregators used to refine a node summary.</p>
          30  +
    ///
          31  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.aggregators.is_none()`.
          32  +
    pub fn aggregators(&self) -> &[crate::types::NodeAggregator] {
          33  +
        self.aggregators.as_deref().unwrap_or_default()
          34  +
    }
          35  +
}
          36  +
static NODEAGGREGATOR_MEMBER_AGGREGATOR_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          37  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeAggregator$AggregatorType", "com.amazonaws.ssm", "NodeAggregator"),
          38  +
    ::aws_smithy_schema::ShapeType::String,
          39  +
    "AggregatorType",
          40  +
    0,
          41  +
);
          42  +
static NODEAGGREGATOR_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeAggregator$TypeName", "com.amazonaws.ssm", "NodeAggregator"),
          44  +
    ::aws_smithy_schema::ShapeType::String,
          45  +
    "TypeName",
          46  +
    1,
          47  +
);
          48  +
static NODEAGGREGATOR_MEMBER_ATTRIBUTE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          49  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeAggregator$AttributeName", "com.amazonaws.ssm", "NodeAggregator"),
          50  +
    ::aws_smithy_schema::ShapeType::String,
          51  +
    "AttributeName",
          52  +
    2,
          53  +
);
          54  +
static NODEAGGREGATOR_MEMBER_AGGREGATORS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          55  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeAggregatorList$member", "com.amazonaws.ssm", "NodeAggregatorList"),
          56  +
    ::aws_smithy_schema::ShapeType::Structure,
          57  +
    "member",
          58  +
    0,
          59  +
)
          60  +
.with_xml_name("NodeAggregator");
          61  +
static NODEAGGREGATOR_MEMBER_AGGREGATORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          62  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeAggregator$Aggregators", "com.amazonaws.ssm", "NodeAggregator"),
          63  +
    ::aws_smithy_schema::ShapeType::List,
          64  +
    "Aggregators",
          65  +
    3,
          66  +
)
          67  +
.with_list_member(&NODEAGGREGATOR_MEMBER_AGGREGATORS_MEMBER);
          68  +
static NODEAGGREGATOR_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          69  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeAggregator", "com.amazonaws.ssm", "NodeAggregator"),
          70  +
    ::aws_smithy_schema::ShapeType::Structure,
          71  +
    &[
          72  +
        &NODEAGGREGATOR_MEMBER_AGGREGATOR_TYPE,
          73  +
        &NODEAGGREGATOR_MEMBER_TYPE_NAME,
          74  +
        &NODEAGGREGATOR_MEMBER_ATTRIBUTE_NAME,
          75  +
        &NODEAGGREGATOR_MEMBER_AGGREGATORS,
          76  +
    ],
          77  +
);
          78  +
impl NodeAggregator {
          79  +
    /// The schema for this shape.
          80  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &NODEAGGREGATOR_SCHEMA;
          81  +
}
          82  +
impl ::aws_smithy_schema::serde::SerializableStruct for NodeAggregator {
          83  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          84  +
    fn serialize_members(
          85  +
        &self,
          86  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          87  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          88  +
        {
          89  +
            let val = &self.aggregator_type;
          90  +
            ser.write_string(&NODEAGGREGATOR_MEMBER_AGGREGATOR_TYPE, val.as_str())?;
          91  +
        }
          92  +
        {
          93  +
            let val = &self.type_name;
          94  +
            ser.write_string(&NODEAGGREGATOR_MEMBER_TYPE_NAME, val.as_str())?;
          95  +
        }
          96  +
        {
          97  +
            let val = &self.attribute_name;
          98  +
            ser.write_string(&NODEAGGREGATOR_MEMBER_ATTRIBUTE_NAME, val.as_str())?;
          99  +
        }
         100  +
        if let Some(ref val) = self.aggregators {
         101  +
            ser.write_list(
         102  +
                &NODEAGGREGATOR_MEMBER_AGGREGATORS,
         103  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         104  +
                    for item in val {
         105  +
                        ser.write_struct(crate::types::NodeAggregator::SCHEMA, item)?;
         106  +
                    }
         107  +
                    Ok(())
         108  +
                },
         109  +
            )?;
         110  +
        }
         111  +
        Ok(())
         112  +
    }
         113  +
}
         114  +
impl NodeAggregator {
         115  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         116  +
    pub fn deserialize(
         117  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        #[allow(unused_variables, unused_mut)]
         120  +
        let mut builder = Self::builder();
         121  +
        #[allow(
         122  +
            unused_variables,
         123  +
            unreachable_code,
         124  +
            clippy::single_match,
         125  +
            clippy::match_single_binding,
         126  +
            clippy::diverging_sub_expression
         127  +
        )]
         128  +
        deserializer.read_struct(&NODEAGGREGATOR_SCHEMA, &mut |member, deser| {
         129  +
            match member.member_index() {
         130  +
                Some(0) => {
         131  +
                    builder.aggregator_type = Some(crate::types::NodeAggregatorType::from(deser.read_string(member)?.as_str()));
         132  +
                }
         133  +
                Some(1) => {
         134  +
                    builder.type_name = Some(crate::types::NodeTypeName::from(deser.read_string(member)?.as_str()));
         135  +
                }
         136  +
                Some(2) => {
         137  +
                    builder.attribute_name = Some(crate::types::NodeAttributeName::from(deser.read_string(member)?.as_str()));
         138  +
                }
         139  +
                Some(3) => {
         140  +
                    if deser.is_null() {
         141  +
                        deser.read_null()?;
         142  +
                    } else {
         143  +
                        builder.aggregators = Some({
         144  +
                            let mut container = Vec::new();
         145  +
                            deser.read_list(member, &mut |deser| {
         146  +
                                container.push(crate::types::NodeAggregator::deserialize(deser)?);
         147  +
                                Ok(())
         148  +
                            })?;
         149  +
                            container
         150  +
                        });
         151  +
                    }
         152  +
                }
         153  +
                _ => {}
         154  +
            }
         155  +
            Ok(())
         156  +
        })?;
         157  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         158  +
    }
         159  +
}
         160  +
impl NodeAggregator {
         161  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         162  +
    pub fn deserialize_with_response(
         163  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         164  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         165  +
        _status: u16,
         166  +
        _body: &[u8],
         167  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         168  +
        Self::deserialize(deserializer)
         169  +
    }
         170  +
}
         171  +
impl NodeAggregator {
         172  +
    /// Creates a new builder-style object to manufacture [`NodeAggregator`](crate::types::NodeAggregator).
         173  +
    pub fn builder() -> crate::types::builders::NodeAggregatorBuilder {
         174  +
        crate::types::builders::NodeAggregatorBuilder::default()
         175  +
    }
         176  +
}
         177  +
         178  +
/// A builder for [`NodeAggregator`](crate::types::NodeAggregator).
         179  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         180  +
#[non_exhaustive]
         181  +
pub struct NodeAggregatorBuilder {
         182  +
    pub(crate) aggregator_type: ::std::option::Option<crate::types::NodeAggregatorType>,
         183  +
    pub(crate) type_name: ::std::option::Option<crate::types::NodeTypeName>,
         184  +
    pub(crate) attribute_name: ::std::option::Option<crate::types::NodeAttributeName>,
         185  +
    pub(crate) aggregators: ::std::option::Option<::std::vec::Vec<crate::types::NodeAggregator>>,
         186  +
}
         187  +
impl NodeAggregatorBuilder {
         188  +
    /// <p>The aggregator type for limiting a node summary. Currently, only <code>Count</code> is supported.</p>
         189  +
    /// This field is required.
         190  +
    pub fn aggregator_type(mut self, input: crate::types::NodeAggregatorType) -> Self {
         191  +
        self.aggregator_type = ::std::option::Option::Some(input);
         192  +
        self
         193  +
    }
         194  +
    /// <p>The aggregator type for limiting a node summary. Currently, only <code>Count</code> is supported.</p>
         195  +
    pub fn set_aggregator_type(mut self, input: ::std::option::Option<crate::types::NodeAggregatorType>) -> Self {
         196  +
        self.aggregator_type = input;
         197  +
        self
         198  +
    }
         199  +
    /// <p>The aggregator type for limiting a node summary. Currently, only <code>Count</code> is supported.</p>
         200  +
    pub fn get_aggregator_type(&self) -> &::std::option::Option<crate::types::NodeAggregatorType> {
         201  +
        &self.aggregator_type
         202  +
    }
         203  +
    /// <p>The data type name to use for viewing counts of nodes. Currently, only <code>Instance</code> is supported.</p>
         204  +
    /// This field is required.
         205  +
    pub fn type_name(mut self, input: crate::types::NodeTypeName) -> Self {
         206  +
        self.type_name = ::std::option::Option::Some(input);
         207  +
        self
         208  +
    }
         209  +
    /// <p>The data type name to use for viewing counts of nodes. Currently, only <code>Instance</code> is supported.</p>
         210  +
    pub fn set_type_name(mut self, input: ::std::option::Option<crate::types::NodeTypeName>) -> Self {
         211  +
        self.type_name = input;
         212  +
        self
         213  +
    }
         214  +
    /// <p>The data type name to use for viewing counts of nodes. Currently, only <code>Instance</code> is supported.</p>
         215  +
    pub fn get_type_name(&self) -> &::std::option::Option<crate::types::NodeTypeName> {
         216  +
        &self.type_name
         217  +
    }
         218  +
    /// <p>The name of a node attribute on which to limit the count of nodes.</p>
         219  +
    /// This field is required.
         220  +
    pub fn attribute_name(mut self, input: crate::types::NodeAttributeName) -> Self {
         221  +
        self.attribute_name = ::std::option::Option::Some(input);
         222  +
        self
         223  +
    }
         224  +
    /// <p>The name of a node attribute on which to limit the count of nodes.</p>
         225  +
    pub fn set_attribute_name(mut self, input: ::std::option::Option<crate::types::NodeAttributeName>) -> Self {
         226  +
        self.attribute_name = input;
         227  +
        self
         228  +
    }
         229  +
    /// <p>The name of a node attribute on which to limit the count of nodes.</p>
         230  +
    pub fn get_attribute_name(&self) -> &::std::option::Option<crate::types::NodeAttributeName> {
         231  +
        &self.attribute_name
         232  +
    }
         233  +
    /// Appends an item to `aggregators`.
         234  +
    ///
         235  +
    /// To override the contents of this collection use [`set_aggregators`](Self::set_aggregators).
         236  +
    ///
         237  +
    /// <p>Information about aggregators used to refine a node summary.</p>
         238  +
    pub fn aggregators(mut self, input: crate::types::NodeAggregator) -> Self {
         239  +
        let mut v = self.aggregators.unwrap_or_default();
         240  +
        v.push(input);
         241  +
        self.aggregators = ::std::option::Option::Some(v);
         242  +
        self
         243  +
    }
         244  +
    /// <p>Information about aggregators used to refine a node summary.</p>
         245  +
    pub fn set_aggregators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NodeAggregator>>) -> Self {
         246  +
        self.aggregators = input;
         247  +
        self
         248  +
    }
         249  +
    /// <p>Information about aggregators used to refine a node summary.</p>
         250  +
    pub fn get_aggregators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NodeAggregator>> {
         251  +
        &self.aggregators
         252  +
    }
         253  +
    /// Consumes the builder and constructs a [`NodeAggregator`](crate::types::NodeAggregator).
         254  +
    /// This method will fail if any of the following fields are not set:
         255  +
    /// - [`aggregator_type`](crate::types::builders::NodeAggregatorBuilder::aggregator_type)
         256  +
    /// - [`type_name`](crate::types::builders::NodeAggregatorBuilder::type_name)
         257  +
    /// - [`attribute_name`](crate::types::builders::NodeAggregatorBuilder::attribute_name)
         258  +
    pub fn build(self) -> ::std::result::Result<crate::types::NodeAggregator, ::aws_smithy_types::error::operation::BuildError> {
         259  +
        ::std::result::Result::Ok(crate::types::NodeAggregator {
         260  +
            aggregator_type: self.aggregator_type.ok_or_else(|| {
         261  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         262  +
                    "aggregator_type",
         263  +
                    "aggregator_type was not specified but it is required when building NodeAggregator",
         264  +
                )
         265  +
            })?,
         266  +
            type_name: self.type_name.ok_or_else(|| {
         267  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         268  +
                    "type_name",
         269  +
                    "type_name was not specified but it is required when building NodeAggregator",
         270  +
                )
         271  +
            })?,
         272  +
            attribute_name: self.attribute_name.ok_or_else(|| {
         273  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         274  +
                    "attribute_name",
         275  +
                    "attribute_name was not specified but it is required when building NodeAggregator",
         276  +
                )
         277  +
            })?,
         278  +
            aggregators: self.aggregators,
         279  +
        })
         280  +
    }
         281  +
}

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

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

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

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

@@ -0,1 +0,224 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The filters for the operation.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct NodeFilter {
           7  +
    /// <p>The name of the filter.</p>
           8  +
    pub key: crate::types::NodeFilterKey,
           9  +
    /// <p>A filter value supported by the specified key. For example, for the key <code>PlatformType</code>, supported values include <code>Linux</code> and <code>Windows</code>.</p>
          10  +
    pub values: ::std::vec::Vec<::std::string::String>,
          11  +
    /// <p>The type of filter operator.</p>
          12  +
    pub r#type: ::std::option::Option<crate::types::NodeFilterOperatorType>,
          13  +
}
          14  +
impl NodeFilter {
          15  +
    /// <p>The name of the filter.</p>
          16  +
    pub fn key(&self) -> &crate::types::NodeFilterKey {
          17  +
        &self.key
          18  +
    }
          19  +
    /// <p>A filter value supported by the specified key. For example, for the key <code>PlatformType</code>, supported values include <code>Linux</code> and <code>Windows</code>.</p>
          20  +
    pub fn values(&self) -> &[::std::string::String] {
          21  +
        use std::ops::Deref;
          22  +
        self.values.deref()
          23  +
    }
          24  +
    /// <p>The type of filter operator.</p>
          25  +
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::NodeFilterOperatorType> {
          26  +
        self.r#type.as_ref()
          27  +
    }
          28  +
}
          29  +
static NODEFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          30  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeFilter$Key", "com.amazonaws.ssm", "NodeFilter"),
          31  +
    ::aws_smithy_schema::ShapeType::String,
          32  +
    "Key",
          33  +
    0,
          34  +
);
          35  +
static NODEFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          36  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeFilterValueList$member", "com.amazonaws.ssm", "NodeFilterValueList"),
          37  +
    ::aws_smithy_schema::ShapeType::String,
          38  +
    "member",
          39  +
    0,
          40  +
)
          41  +
.with_xml_name("FilterValue");
          42  +
static NODEFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeFilter$Values", "com.amazonaws.ssm", "NodeFilter"),
          44  +
    ::aws_smithy_schema::ShapeType::List,
          45  +
    "Values",
          46  +
    1,
          47  +
)
          48  +
.with_list_member(&NODEFILTER_MEMBER_VALUES_MEMBER);
          49  +
static NODEFILTER_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          50  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeFilter$Type", "com.amazonaws.ssm", "NodeFilter"),
          51  +
    ::aws_smithy_schema::ShapeType::String,
          52  +
    "Type",
          53  +
    2,
          54  +
);
          55  +
static NODEFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          56  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#NodeFilter", "com.amazonaws.ssm", "NodeFilter"),
          57  +
    ::aws_smithy_schema::ShapeType::Structure,
          58  +
    &[&NODEFILTER_MEMBER_KEY, &NODEFILTER_MEMBER_VALUES, &NODEFILTER_MEMBER_TYPE],
          59  +
);
          60  +
impl NodeFilter {
          61  +
    /// The schema for this shape.
          62  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &NODEFILTER_SCHEMA;
          63  +
}
          64  +
impl ::aws_smithy_schema::serde::SerializableStruct for NodeFilter {
          65  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          66  +
    fn serialize_members(
          67  +
        &self,
          68  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          69  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          70  +
        {
          71  +
            let val = &self.key;
          72  +
            ser.write_string(&NODEFILTER_MEMBER_KEY, val.as_str())?;
          73  +
        }
          74  +
        {
          75  +
            let val = &self.values;
          76  +
          77  +
            ser.write_list(&NODEFILTER_MEMBER_VALUES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          78  +
                for item in val {
          79  +
                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
          80  +
                }
          81  +
                Ok(())
          82  +
            })?;
          83  +
        }
          84  +
        if let Some(ref val) = self.r#type {
          85  +
            ser.write_string(&NODEFILTER_MEMBER_TYPE, val.as_str())?;
          86  +
        }
          87  +
        Ok(())
          88  +
    }
          89  +
}
          90  +
impl NodeFilter {
          91  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          92  +
    pub fn deserialize(
          93  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          94  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          95  +
        #[allow(unused_variables, unused_mut)]
          96  +
        let mut builder = Self::builder();
          97  +
        #[allow(
          98  +
            unused_variables,
          99  +
            unreachable_code,
         100  +
            clippy::single_match,
         101  +
            clippy::match_single_binding,
         102  +
            clippy::diverging_sub_expression
         103  +
        )]
         104  +
        deserializer.read_struct(&NODEFILTER_SCHEMA, &mut |member, deser| {
         105  +
            match member.member_index() {
         106  +
                Some(0) => {
         107  +
                    builder.key = Some(crate::types::NodeFilterKey::from(deser.read_string(member)?.as_str()));
         108  +
                }
         109  +
                Some(1) => {
         110  +
                    builder.values = Some(deser.read_string_list(member)?);
         111  +
                }
         112  +
                Some(2) => {
         113  +
                    if deser.is_null() {
         114  +
                        deser.read_null()?;
         115  +
                    } else {
         116  +
                        builder.r#type = Some(crate::types::NodeFilterOperatorType::from(deser.read_string(member)?.as_str()));
         117  +
                    }
         118  +
                }
         119  +
                _ => {}
         120  +
            }
         121  +
            Ok(())
         122  +
        })?;
         123  +
        builder.values = builder.values.or(Some(Vec::new()));
         124  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         125  +
    }
         126  +
}
         127  +
impl NodeFilter {
         128  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         129  +
    pub fn deserialize_with_response(
         130  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         131  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         132  +
        _status: u16,
         133  +
        _body: &[u8],
         134  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         135  +
        Self::deserialize(deserializer)
         136  +
    }
         137  +
}
         138  +
impl NodeFilter {
         139  +
    /// Creates a new builder-style object to manufacture [`NodeFilter`](crate::types::NodeFilter).
         140  +
    pub fn builder() -> crate::types::builders::NodeFilterBuilder {
         141  +
        crate::types::builders::NodeFilterBuilder::default()
         142  +
    }
         143  +
}
         144  +
         145  +
/// A builder for [`NodeFilter`](crate::types::NodeFilter).
         146  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         147  +
#[non_exhaustive]
         148  +
pub struct NodeFilterBuilder {
         149  +
    pub(crate) key: ::std::option::Option<crate::types::NodeFilterKey>,
         150  +
    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         151  +
    pub(crate) r#type: ::std::option::Option<crate::types::NodeFilterOperatorType>,
         152  +
}
         153  +
impl NodeFilterBuilder {
         154  +
    /// <p>The name of the filter.</p>
         155  +
    /// This field is required.
         156  +
    pub fn key(mut self, input: crate::types::NodeFilterKey) -> Self {
         157  +
        self.key = ::std::option::Option::Some(input);
         158  +
        self
         159  +
    }
         160  +
    /// <p>The name of the filter.</p>
         161  +
    pub fn set_key(mut self, input: ::std::option::Option<crate::types::NodeFilterKey>) -> Self {
         162  +
        self.key = input;
         163  +
        self
         164  +
    }
         165  +
    /// <p>The name of the filter.</p>
         166  +
    pub fn get_key(&self) -> &::std::option::Option<crate::types::NodeFilterKey> {
         167  +
        &self.key
         168  +
    }
         169  +
    /// Appends an item to `values`.
         170  +
    ///
         171  +
    /// To override the contents of this collection use [`set_values`](Self::set_values).
         172  +
    ///
         173  +
    /// <p>A filter value supported by the specified key. For example, for the key <code>PlatformType</code>, supported values include <code>Linux</code> and <code>Windows</code>.</p>
         174  +
    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         175  +
        let mut v = self.values.unwrap_or_default();
         176  +
        v.push(input.into());
         177  +
        self.values = ::std::option::Option::Some(v);
         178  +
        self
         179  +
    }
         180  +
    /// <p>A filter value supported by the specified key. For example, for the key <code>PlatformType</code>, supported values include <code>Linux</code> and <code>Windows</code>.</p>
         181  +
    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         182  +
        self.values = input;
         183  +
        self
         184  +
    }
         185  +
    /// <p>A filter value supported by the specified key. For example, for the key <code>PlatformType</code>, supported values include <code>Linux</code> and <code>Windows</code>.</p>
         186  +
    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         187  +
        &self.values
         188  +
    }
         189  +
    /// <p>The type of filter operator.</p>
         190  +
    pub fn r#type(mut self, input: crate::types::NodeFilterOperatorType) -> Self {
         191  +
        self.r#type = ::std::option::Option::Some(input);
         192  +
        self
         193  +
    }
         194  +
    /// <p>The type of filter operator.</p>
         195  +
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::NodeFilterOperatorType>) -> Self {
         196  +
        self.r#type = input;
         197  +
        self
         198  +
    }
         199  +
    /// <p>The type of filter operator.</p>
         200  +
    pub fn get_type(&self) -> &::std::option::Option<crate::types::NodeFilterOperatorType> {
         201  +
        &self.r#type
         202  +
    }
         203  +
    /// Consumes the builder and constructs a [`NodeFilter`](crate::types::NodeFilter).
         204  +
    /// This method will fail if any of the following fields are not set:
         205  +
    /// - [`key`](crate::types::builders::NodeFilterBuilder::key)
         206  +
    /// - [`values`](crate::types::builders::NodeFilterBuilder::values)
         207  +
    pub fn build(self) -> ::std::result::Result<crate::types::NodeFilter, ::aws_smithy_types::error::operation::BuildError> {
         208  +
        ::std::result::Result::Ok(crate::types::NodeFilter {
         209  +
            key: self.key.ok_or_else(|| {
         210  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         211  +
                    "key",
         212  +
                    "key was not specified but it is required when building NodeFilter",
         213  +
                )
         214  +
            })?,
         215  +
            values: self.values.ok_or_else(|| {
         216  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         217  +
                    "values",
         218  +
                    "values was not specified but it is required when building NodeFilter",
         219  +
                )
         220  +
            })?,
         221  +
            r#type: self.r#type,
         222  +
        })
         223  +
    }
         224  +
}

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

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

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

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