AWS SDK

AWS SDK

rev. bbca34fa2eddb4be623fbbc6b6df1a2401de0029 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,254 @@
           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 results.</p>
           4  +
/// <p><b>Example formats for the <code>aws ssm get-inventory</code> command:</b></p>
           5  +
/// <p><code>--filters Key=AWS:InstanceInformation.AgentType,Values=amazon-ssm-agent,Type=Equal</code></p>
           6  +
/// <p><code>--filters Key=AWS:InstanceInformation.AgentVersion,Values=3.3.2299.0,Type=Equal</code></p>
           7  +
/// <p><code>--filters Key=AWS:InstanceInformation.ComputerName,Values=ip-192.0.2.0.us-east-2.compute.internal,Type=Equal</code></p>
           8  +
/// <p><code>--filters Key=AWS:InstanceInformation.InstanceId,Values=i-0a4cd6ceffEXAMPLE,i-1a2b3c4d5e6EXAMPLE,Type=Equal</code></p>
           9  +
/// <p><code>--filters Key=AWS:InstanceInformation.InstanceStatus,Values=Active,Type=Equal</code></p>
          10  +
/// <p><code>--filters Key=AWS:InstanceInformation.IpAddress,Values=198.51.100.0,Type=Equal</code></p>
          11  +
/// <p><code>--filters Key=AWS:InstanceInformation.PlatformName,Values="Amazon Linux",Type=Equal</code></p>
          12  +
/// <p><code>--filters Key=AWS:InstanceInformation.PlatformType,Values=Linux,Type=Equal</code></p>
          13  +
/// <p><code>--filters Key=AWS:InstanceInformation.PlatformVersion,Values=2023,Type=BeginWith</code></p>
          14  +
/// <p><code>--filters Key=AWS:InstanceInformation.ResourceType,Values=EC2Instance,Type=Equal</code></p>
          15  +
#[non_exhaustive]
          16  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          17  +
pub struct InventoryFilter {
          18  +
    /// <p>The name of the filter key.</p>
          19  +
    pub key: ::std::string::String,
          20  +
    /// <p>Inventory filter values.</p>
          21  +
    pub values: ::std::vec::Vec<::std::string::String>,
          22  +
    /// <p>The type of filter.</p><note>
          23  +
    /// <p>The <code>Exists</code> filter must be used with aggregators. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-aggregate.html">Aggregating inventory data</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          24  +
    /// </note>
          25  +
    pub r#type: ::std::option::Option<crate::types::InventoryQueryOperatorType>,
          26  +
}
          27  +
impl InventoryFilter {
          28  +
    /// <p>The name of the filter key.</p>
          29  +
    pub fn key(&self) -> &str {
          30  +
        use std::ops::Deref;
          31  +
        self.key.deref()
          32  +
    }
          33  +
    /// <p>Inventory filter values.</p>
          34  +
    pub fn values(&self) -> &[::std::string::String] {
          35  +
        use std::ops::Deref;
          36  +
        self.values.deref()
          37  +
    }
          38  +
    /// <p>The type of filter.</p><note>
          39  +
    /// <p>The <code>Exists</code> filter must be used with aggregators. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-aggregate.html">Aggregating inventory data</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          40  +
    /// </note>
          41  +
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::InventoryQueryOperatorType> {
          42  +
        self.r#type.as_ref()
          43  +
    }
          44  +
}
          45  +
static INVENTORYFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          46  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryFilter$Key", "com.amazonaws.ssm", "InventoryFilter"),
          47  +
    ::aws_smithy_schema::ShapeType::String,
          48  +
    "Key",
          49  +
    0,
          50  +
);
          51  +
static INVENTORYFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          52  +
    ::aws_smithy_schema::ShapeId::from_parts(
          53  +
        "com.amazonaws.ssm#InventoryFilterValueList$member",
          54  +
        "com.amazonaws.ssm",
          55  +
        "InventoryFilterValueList",
          56  +
    ),
          57  +
    ::aws_smithy_schema::ShapeType::String,
          58  +
    "member",
          59  +
    0,
          60  +
)
          61  +
.with_xml_name("FilterValue");
          62  +
static INVENTORYFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryFilter$Values", "com.amazonaws.ssm", "InventoryFilter"),
          64  +
    ::aws_smithy_schema::ShapeType::List,
          65  +
    "Values",
          66  +
    1,
          67  +
)
          68  +
.with_list_member(&INVENTORYFILTER_MEMBER_VALUES_MEMBER);
          69  +
static INVENTORYFILTER_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          70  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryFilter$Type", "com.amazonaws.ssm", "InventoryFilter"),
          71  +
    ::aws_smithy_schema::ShapeType::String,
          72  +
    "Type",
          73  +
    2,
          74  +
);
          75  +
static INVENTORYFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          76  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryFilter", "com.amazonaws.ssm", "InventoryFilter"),
          77  +
    ::aws_smithy_schema::ShapeType::Structure,
          78  +
    &[&INVENTORYFILTER_MEMBER_KEY, &INVENTORYFILTER_MEMBER_VALUES, &INVENTORYFILTER_MEMBER_TYPE],
          79  +
);
          80  +
impl InventoryFilter {
          81  +
    /// The schema for this shape.
          82  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INVENTORYFILTER_SCHEMA;
          83  +
}
          84  +
impl ::aws_smithy_schema::serde::SerializableStruct for InventoryFilter {
          85  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          86  +
    fn serialize_members(
          87  +
        &self,
          88  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          89  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          90  +
        {
          91  +
            let val = &self.key;
          92  +
            ser.write_string(&INVENTORYFILTER_MEMBER_KEY, val)?;
          93  +
        }
          94  +
        {
          95  +
            let val = &self.values;
          96  +
          97  +
            ser.write_list(
          98  +
                &INVENTORYFILTER_MEMBER_VALUES,
          99  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         100  +
                    for item in val {
         101  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         102  +
                    }
         103  +
                    Ok(())
         104  +
                },
         105  +
            )?;
         106  +
        }
         107  +
        if let Some(ref val) = self.r#type {
         108  +
            ser.write_string(&INVENTORYFILTER_MEMBER_TYPE, val.as_str())?;
         109  +
        }
         110  +
        Ok(())
         111  +
    }
         112  +
}
         113  +
impl InventoryFilter {
         114  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         115  +
    pub fn deserialize(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         117  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         118  +
        #[allow(unused_variables, unused_mut)]
         119  +
        let mut builder = Self::builder();
         120  +
        #[allow(
         121  +
            unused_variables,
         122  +
            unreachable_code,
         123  +
            clippy::single_match,
         124  +
            clippy::match_single_binding,
         125  +
            clippy::diverging_sub_expression
         126  +
        )]
         127  +
        deserializer.read_struct(&INVENTORYFILTER_SCHEMA, &mut |member, deser| {
         128  +
            match member.member_index() {
         129  +
                Some(0) => {
         130  +
                    builder.key = Some(deser.read_string(member)?);
         131  +
                }
         132  +
                Some(1) => {
         133  +
                    builder.values = Some(deser.read_string_list(member)?);
         134  +
                }
         135  +
                Some(2) => {
         136  +
                    if deser.is_null() {
         137  +
                        deser.read_null()?;
         138  +
                    } else {
         139  +
                        builder.r#type = Some(crate::types::InventoryQueryOperatorType::from(deser.read_string(member)?.as_str()));
         140  +
                    }
         141  +
                }
         142  +
                _ => {}
         143  +
            }
         144  +
            Ok(())
         145  +
        })?;
         146  +
        builder.key = builder.key.or(Some(String::new()));
         147  +
        builder.values = builder.values.or(Some(Vec::new()));
         148  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         149  +
    }
         150  +
}
         151  +
impl InventoryFilter {
         152  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         153  +
    pub fn deserialize_with_response(
         154  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         155  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         156  +
        _status: u16,
         157  +
        _body: &[u8],
         158  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         159  +
        Self::deserialize(deserializer)
         160  +
    }
         161  +
}
         162  +
impl InventoryFilter {
         163  +
    /// Creates a new builder-style object to manufacture [`InventoryFilter`](crate::types::InventoryFilter).
         164  +
    pub fn builder() -> crate::types::builders::InventoryFilterBuilder {
         165  +
        crate::types::builders::InventoryFilterBuilder::default()
         166  +
    }
         167  +
}
         168  +
         169  +
/// A builder for [`InventoryFilter`](crate::types::InventoryFilter).
         170  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         171  +
#[non_exhaustive]
         172  +
pub struct InventoryFilterBuilder {
         173  +
    pub(crate) key: ::std::option::Option<::std::string::String>,
         174  +
    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         175  +
    pub(crate) r#type: ::std::option::Option<crate::types::InventoryQueryOperatorType>,
         176  +
}
         177  +
impl InventoryFilterBuilder {
         178  +
    /// <p>The name of the filter key.</p>
         179  +
    /// This field is required.
         180  +
    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         181  +
        self.key = ::std::option::Option::Some(input.into());
         182  +
        self
         183  +
    }
         184  +
    /// <p>The name of the filter key.</p>
         185  +
    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         186  +
        self.key = input;
         187  +
        self
         188  +
    }
         189  +
    /// <p>The name of the filter key.</p>
         190  +
    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
         191  +
        &self.key
         192  +
    }
         193  +
    /// Appends an item to `values`.
         194  +
    ///
         195  +
    /// To override the contents of this collection use [`set_values`](Self::set_values).
         196  +
    ///
         197  +
    /// <p>Inventory filter values.</p>
         198  +
    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         199  +
        let mut v = self.values.unwrap_or_default();
         200  +
        v.push(input.into());
         201  +
        self.values = ::std::option::Option::Some(v);
         202  +
        self
         203  +
    }
         204  +
    /// <p>Inventory filter values.</p>
         205  +
    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         206  +
        self.values = input;
         207  +
        self
         208  +
    }
         209  +
    /// <p>Inventory filter values.</p>
         210  +
    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         211  +
        &self.values
         212  +
    }
         213  +
    /// <p>The type of filter.</p><note>
         214  +
    /// <p>The <code>Exists</code> filter must be used with aggregators. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-aggregate.html">Aggregating inventory data</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         215  +
    /// </note>
         216  +
    pub fn r#type(mut self, input: crate::types::InventoryQueryOperatorType) -> Self {
         217  +
        self.r#type = ::std::option::Option::Some(input);
         218  +
        self
         219  +
    }
         220  +
    /// <p>The type of filter.</p><note>
         221  +
    /// <p>The <code>Exists</code> filter must be used with aggregators. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-aggregate.html">Aggregating inventory data</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         222  +
    /// </note>
         223  +
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::InventoryQueryOperatorType>) -> Self {
         224  +
        self.r#type = input;
         225  +
        self
         226  +
    }
         227  +
    /// <p>The type of filter.</p><note>
         228  +
    /// <p>The <code>Exists</code> filter must be used with aggregators. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-aggregate.html">Aggregating inventory data</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         229  +
    /// </note>
         230  +
    pub fn get_type(&self) -> &::std::option::Option<crate::types::InventoryQueryOperatorType> {
         231  +
        &self.r#type
         232  +
    }
         233  +
    /// Consumes the builder and constructs a [`InventoryFilter`](crate::types::InventoryFilter).
         234  +
    /// This method will fail if any of the following fields are not set:
         235  +
    /// - [`key`](crate::types::builders::InventoryFilterBuilder::key)
         236  +
    /// - [`values`](crate::types::builders::InventoryFilterBuilder::values)
         237  +
    pub fn build(self) -> ::std::result::Result<crate::types::InventoryFilter, ::aws_smithy_types::error::operation::BuildError> {
         238  +
        ::std::result::Result::Ok(crate::types::InventoryFilter {
         239  +
            key: self.key.ok_or_else(|| {
         240  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         241  +
                    "key",
         242  +
                    "key was not specified but it is required when building InventoryFilter",
         243  +
                )
         244  +
            })?,
         245  +
            values: self.values.ok_or_else(|| {
         246  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         247  +
                    "values",
         248  +
                    "values was not specified but it is required when building InventoryFilter",
         249  +
                )
         250  +
            })?,
         251  +
            r#type: self.r#type,
         252  +
        })
         253  +
    }
         254  +
}

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

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

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

@@ -0,1 +0,437 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information collected from managed nodes based on your inventory policy document</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct InventoryItem {
           7  +
    /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
           8  +
    pub type_name: ::std::string::String,
           9  +
    /// <p>The schema version for the inventory item.</p>
          10  +
    pub schema_version: ::std::string::String,
          11  +
    /// <p>The time the inventory information was collected.</p>
          12  +
    pub capture_time: ::std::string::String,
          13  +
    /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
          14  +
    pub content_hash: ::std::option::Option<::std::string::String>,
          15  +
    /// <p>The inventory data of the inventory type.</p>
          16  +
    pub content: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
          17  +
    /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
          18  +
    pub context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          19  +
}
          20  +
impl InventoryItem {
          21  +
    /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
          22  +
    pub fn type_name(&self) -> &str {
          23  +
        use std::ops::Deref;
          24  +
        self.type_name.deref()
          25  +
    }
          26  +
    /// <p>The schema version for the inventory item.</p>
          27  +
    pub fn schema_version(&self) -> &str {
          28  +
        use std::ops::Deref;
          29  +
        self.schema_version.deref()
          30  +
    }
          31  +
    /// <p>The time the inventory information was collected.</p>
          32  +
    pub fn capture_time(&self) -> &str {
          33  +
        use std::ops::Deref;
          34  +
        self.capture_time.deref()
          35  +
    }
          36  +
    /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
          37  +
    pub fn content_hash(&self) -> ::std::option::Option<&str> {
          38  +
        self.content_hash.as_deref()
          39  +
    }
          40  +
    /// <p>The inventory data of the inventory type.</p>
          41  +
    ///
          42  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.content.is_none()`.
          43  +
    pub fn content(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::string::String>] {
          44  +
        self.content.as_deref().unwrap_or_default()
          45  +
    }
          46  +
    /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
          47  +
    pub fn context(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
          48  +
        self.context.as_ref()
          49  +
    }
          50  +
}
          51  +
static INVENTORYITEM_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          52  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$TypeName", "com.amazonaws.ssm", "InventoryItem"),
          53  +
    ::aws_smithy_schema::ShapeType::String,
          54  +
    "TypeName",
          55  +
    0,
          56  +
);
          57  +
static INVENTORYITEM_MEMBER_SCHEMA_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          58  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$SchemaVersion", "com.amazonaws.ssm", "InventoryItem"),
          59  +
    ::aws_smithy_schema::ShapeType::String,
          60  +
    "SchemaVersion",
          61  +
    1,
          62  +
);
          63  +
static INVENTORYITEM_MEMBER_CAPTURE_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$CaptureTime", "com.amazonaws.ssm", "InventoryItem"),
          65  +
    ::aws_smithy_schema::ShapeType::String,
          66  +
    "CaptureTime",
          67  +
    2,
          68  +
);
          69  +
static INVENTORYITEM_MEMBER_CONTENT_HASH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          70  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$ContentHash", "com.amazonaws.ssm", "InventoryItem"),
          71  +
    ::aws_smithy_schema::ShapeType::String,
          72  +
    "ContentHash",
          73  +
    3,
          74  +
);
          75  +
static INVENTORYITEM_MEMBER_CONTENT_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          76  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItemEntry$key", "com.amazonaws.ssm", "InventoryItemEntry"),
          77  +
    ::aws_smithy_schema::ShapeType::String,
          78  +
    "key",
          79  +
    0,
          80  +
);
          81  +
static INVENTORYITEM_MEMBER_CONTENT_MEMBER_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          82  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItemEntry$value", "com.amazonaws.ssm", "InventoryItemEntry"),
          83  +
    ::aws_smithy_schema::ShapeType::String,
          84  +
    "value",
          85  +
    1,
          86  +
);
          87  +
static INVENTORYITEM_MEMBER_CONTENT_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          88  +
    ::aws_smithy_schema::ShapeId::from_parts(
          89  +
        "com.amazonaws.ssm#InventoryItemEntryList$member",
          90  +
        "com.amazonaws.ssm",
          91  +
        "InventoryItemEntryList",
          92  +
    ),
          93  +
    ::aws_smithy_schema::ShapeType::Map,
          94  +
    "member",
          95  +
    0,
          96  +
)
          97  +
.with_map_members(&INVENTORYITEM_MEMBER_CONTENT_MEMBER_KEY, &INVENTORYITEM_MEMBER_CONTENT_MEMBER_VALUE);
          98  +
static INVENTORYITEM_MEMBER_CONTENT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          99  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$Content", "com.amazonaws.ssm", "InventoryItem"),
         100  +
    ::aws_smithy_schema::ShapeType::List,
         101  +
    "Content",
         102  +
    4,
         103  +
)
         104  +
.with_list_member(&INVENTORYITEM_MEMBER_CONTENT_MEMBER);
         105  +
static INVENTORYITEM_MEMBER_CONTEXT_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         106  +
    ::aws_smithy_schema::ShapeId::from_parts(
         107  +
        "com.amazonaws.ssm#InventoryItemContentContext$key",
         108  +
        "com.amazonaws.ssm",
         109  +
        "InventoryItemContentContext",
         110  +
    ),
         111  +
    ::aws_smithy_schema::ShapeType::String,
         112  +
    "key",
         113  +
    0,
         114  +
);
         115  +
static INVENTORYITEM_MEMBER_CONTEXT_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         116  +
    ::aws_smithy_schema::ShapeId::from_parts(
         117  +
        "com.amazonaws.ssm#InventoryItemContentContext$value",
         118  +
        "com.amazonaws.ssm",
         119  +
        "InventoryItemContentContext",
         120  +
    ),
         121  +
    ::aws_smithy_schema::ShapeType::String,
         122  +
    "value",
         123  +
    1,
         124  +
);
         125  +
static INVENTORYITEM_MEMBER_CONTEXT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         126  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem$Context", "com.amazonaws.ssm", "InventoryItem"),
         127  +
    ::aws_smithy_schema::ShapeType::Map,
         128  +
    "Context",
         129  +
    5,
         130  +
)
         131  +
.with_map_members(&INVENTORYITEM_MEMBER_CONTEXT_KEY, &INVENTORYITEM_MEMBER_CONTEXT_VALUE);
         132  +
static INVENTORYITEM_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         133  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItem", "com.amazonaws.ssm", "InventoryItem"),
         134  +
    ::aws_smithy_schema::ShapeType::Structure,
         135  +
    &[
         136  +
        &INVENTORYITEM_MEMBER_TYPE_NAME,
         137  +
        &INVENTORYITEM_MEMBER_SCHEMA_VERSION,
         138  +
        &INVENTORYITEM_MEMBER_CAPTURE_TIME,
         139  +
        &INVENTORYITEM_MEMBER_CONTENT_HASH,
         140  +
        &INVENTORYITEM_MEMBER_CONTENT,
         141  +
        &INVENTORYITEM_MEMBER_CONTEXT,
         142  +
    ],
         143  +
);
         144  +
impl InventoryItem {
         145  +
    /// The schema for this shape.
         146  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INVENTORYITEM_SCHEMA;
         147  +
}
         148  +
impl ::aws_smithy_schema::serde::SerializableStruct for InventoryItem {
         149  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         150  +
    fn serialize_members(
         151  +
        &self,
         152  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         153  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         154  +
        {
         155  +
            let val = &self.type_name;
         156  +
            ser.write_string(&INVENTORYITEM_MEMBER_TYPE_NAME, val)?;
         157  +
        }
         158  +
        {
         159  +
            let val = &self.schema_version;
         160  +
            ser.write_string(&INVENTORYITEM_MEMBER_SCHEMA_VERSION, val)?;
         161  +
        }
         162  +
        {
         163  +
            let val = &self.capture_time;
         164  +
            ser.write_string(&INVENTORYITEM_MEMBER_CAPTURE_TIME, val)?;
         165  +
        }
         166  +
        if let Some(ref val) = self.content_hash {
         167  +
            ser.write_string(&INVENTORYITEM_MEMBER_CONTENT_HASH, val)?;
         168  +
        }
         169  +
        if let Some(ref val) = self.content {
         170  +
            ser.write_list(
         171  +
                &INVENTORYITEM_MEMBER_CONTENT,
         172  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         173  +
                    for item in val {
         174  +
                        ser.write_map(
         175  +
                            &INVENTORYITEM_MEMBER_CONTENT_MEMBER,
         176  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         177  +
                                for (key, value) in item {
         178  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         179  +
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
         180  +
                                }
         181  +
                                Ok(())
         182  +
                            },
         183  +
                        )?;
         184  +
                    }
         185  +
                    Ok(())
         186  +
                },
         187  +
            )?;
         188  +
        }
         189  +
        if let Some(ref val) = self.context {
         190  +
            ser.write_map(
         191  +
                &INVENTORYITEM_MEMBER_CONTEXT,
         192  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         193  +
                    for (key, value) in val {
         194  +
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         195  +
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
         196  +
                    }
         197  +
                    Ok(())
         198  +
                },
         199  +
            )?;
         200  +
        }
         201  +
        Ok(())
         202  +
    }
         203  +
}
         204  +
impl InventoryItem {
         205  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         206  +
    pub fn deserialize(
         207  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         208  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         209  +
        #[allow(unused_variables, unused_mut)]
         210  +
        let mut builder = Self::builder();
         211  +
        #[allow(
         212  +
            unused_variables,
         213  +
            unreachable_code,
         214  +
            clippy::single_match,
         215  +
            clippy::match_single_binding,
         216  +
            clippy::diverging_sub_expression
         217  +
        )]
         218  +
        deserializer.read_struct(&INVENTORYITEM_SCHEMA, &mut |member, deser| {
         219  +
            match member.member_index() {
         220  +
                Some(0) => {
         221  +
                    builder.type_name = Some(deser.read_string(member)?);
         222  +
                }
         223  +
                Some(1) => {
         224  +
                    builder.schema_version = Some(deser.read_string(member)?);
         225  +
                }
         226  +
                Some(2) => {
         227  +
                    builder.capture_time = Some(deser.read_string(member)?);
         228  +
                }
         229  +
                Some(3) => {
         230  +
                    if deser.is_null() {
         231  +
                        deser.read_null()?;
         232  +
                    } else {
         233  +
                        builder.content_hash = Some(deser.read_string(member)?);
         234  +
                    }
         235  +
                }
         236  +
                Some(4) => {
         237  +
                    if deser.is_null() {
         238  +
                        deser.read_null()?;
         239  +
                    } else {
         240  +
                        builder.content = Some({
         241  +
                            let mut container = Vec::new();
         242  +
                            deser.read_list(member, &mut |deser| {
         243  +
                                container.push({
         244  +
                                    let mut map = ::std::collections::HashMap::new();
         245  +
                                    deser.read_map(&INVENTORYITEM_MEMBER_CONTENT_MEMBER, &mut |key, deser| {
         246  +
                                        let value = deser.read_string(&::aws_smithy_schema::prelude::STRING)?;
         247  +
                                        map.insert(key, value);
         248  +
                                        Ok(())
         249  +
                                    })?;
         250  +
                                    map
         251  +
                                });
         252  +
                                Ok(())
         253  +
                            })?;
         254  +
                            container
         255  +
                        });
         256  +
                    }
         257  +
                }
         258  +
                Some(5) => {
         259  +
                    if deser.is_null() {
         260  +
                        deser.read_null()?;
         261  +
                    } else {
         262  +
                        builder.context = Some(deser.read_string_string_map(member)?);
         263  +
                    }
         264  +
                }
         265  +
                _ => {}
         266  +
            }
         267  +
            Ok(())
         268  +
        })?;
         269  +
        builder.type_name = builder.type_name.or(Some(String::new()));
         270  +
        builder.schema_version = builder.schema_version.or(Some(String::new()));
         271  +
        builder.capture_time = builder.capture_time.or(Some(String::new()));
         272  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         273  +
    }
         274  +
}
         275  +
impl InventoryItem {
         276  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         277  +
    pub fn deserialize_with_response(
         278  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         279  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         280  +
        _status: u16,
         281  +
        _body: &[u8],
         282  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         283  +
        Self::deserialize(deserializer)
         284  +
    }
         285  +
}
         286  +
impl InventoryItem {
         287  +
    /// Creates a new builder-style object to manufacture [`InventoryItem`](crate::types::InventoryItem).
         288  +
    pub fn builder() -> crate::types::builders::InventoryItemBuilder {
         289  +
        crate::types::builders::InventoryItemBuilder::default()
         290  +
    }
         291  +
}
         292  +
         293  +
/// A builder for [`InventoryItem`](crate::types::InventoryItem).
         294  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         295  +
#[non_exhaustive]
         296  +
pub struct InventoryItemBuilder {
         297  +
    pub(crate) type_name: ::std::option::Option<::std::string::String>,
         298  +
    pub(crate) schema_version: ::std::option::Option<::std::string::String>,
         299  +
    pub(crate) capture_time: ::std::option::Option<::std::string::String>,
         300  +
    pub(crate) content_hash: ::std::option::Option<::std::string::String>,
         301  +
    pub(crate) content: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
         302  +
    pub(crate) context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
         303  +
}
         304  +
impl InventoryItemBuilder {
         305  +
    /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
         306  +
    /// This field is required.
         307  +
    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         308  +
        self.type_name = ::std::option::Option::Some(input.into());
         309  +
        self
         310  +
    }
         311  +
    /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
         312  +
    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         313  +
        self.type_name = input;
         314  +
        self
         315  +
    }
         316  +
    /// <p>The name of the inventory type. Default inventory item type names start with <code>AWS</code>. Custom inventory type names will start with Custom. Default inventory item types include the following: <code>AWS:AWSComponent</code>, <code>AWS:Application</code>, <code>AWS:InstanceInformation</code>, <code>AWS:Network</code>, and <code>AWS:WindowsUpdate</code>.</p>
         317  +
    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
         318  +
        &self.type_name
         319  +
    }
         320  +
    /// <p>The schema version for the inventory item.</p>
         321  +
    /// This field is required.
         322  +
    pub fn schema_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         323  +
        self.schema_version = ::std::option::Option::Some(input.into());
         324  +
        self
         325  +
    }
         326  +
    /// <p>The schema version for the inventory item.</p>
         327  +
    pub fn set_schema_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         328  +
        self.schema_version = input;
         329  +
        self
         330  +
    }
         331  +
    /// <p>The schema version for the inventory item.</p>
         332  +
    pub fn get_schema_version(&self) -> &::std::option::Option<::std::string::String> {
         333  +
        &self.schema_version
         334  +
    }
         335  +
    /// <p>The time the inventory information was collected.</p>
         336  +
    /// This field is required.
         337  +
    pub fn capture_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         338  +
        self.capture_time = ::std::option::Option::Some(input.into());
         339  +
        self
         340  +
    }
         341  +
    /// <p>The time the inventory information was collected.</p>
         342  +
    pub fn set_capture_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         343  +
        self.capture_time = input;
         344  +
        self
         345  +
    }
         346  +
    /// <p>The time the inventory information was collected.</p>
         347  +
    pub fn get_capture_time(&self) -> &::std::option::Option<::std::string::String> {
         348  +
        &self.capture_time
         349  +
    }
         350  +
    /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
         351  +
    pub fn content_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         352  +
        self.content_hash = ::std::option::Option::Some(input.into());
         353  +
        self
         354  +
    }
         355  +
    /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
         356  +
    pub fn set_content_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         357  +
        self.content_hash = input;
         358  +
        self
         359  +
    }
         360  +
    /// <p>MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn't update the inventory item type contents if the MD5 hash hasn't changed since last update.</p>
         361  +
    pub fn get_content_hash(&self) -> &::std::option::Option<::std::string::String> {
         362  +
        &self.content_hash
         363  +
    }
         364  +
    /// Appends an item to `content`.
         365  +
    ///
         366  +
    /// To override the contents of this collection use [`set_content`](Self::set_content).
         367  +
    ///
         368  +
    /// <p>The inventory data of the inventory type.</p>
         369  +
    pub fn content(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
         370  +
        let mut v = self.content.unwrap_or_default();
         371  +
        v.push(input);
         372  +
        self.content = ::std::option::Option::Some(v);
         373  +
        self
         374  +
    }
         375  +
    /// <p>The inventory data of the inventory type.</p>
         376  +
    pub fn set_content(
         377  +
        mut self,
         378  +
        input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
         379  +
    ) -> Self {
         380  +
        self.content = input;
         381  +
        self
         382  +
    }
         383  +
    /// <p>The inventory data of the inventory type.</p>
         384  +
    pub fn get_content(&self) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>> {
         385  +
        &self.content
         386  +
    }
         387  +
    /// Adds a key-value pair to `context`.
         388  +
    ///
         389  +
    /// To override the contents of this collection use [`set_context`](Self::set_context).
         390  +
    ///
         391  +
    /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
         392  +
    pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
         393  +
        let mut hash_map = self.context.unwrap_or_default();
         394  +
        hash_map.insert(k.into(), v.into());
         395  +
        self.context = ::std::option::Option::Some(hash_map);
         396  +
        self
         397  +
    }
         398  +
    /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
         399  +
    pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
         400  +
        self.context = input;
         401  +
        self
         402  +
    }
         403  +
    /// <p>A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the <code>ExecutionId</code>, <code>ExecutionType</code>, <code>ComplianceType</code> properties of the <code>AWS:ComplianceItem</code> type.</p>
         404  +
    pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         405  +
        &self.context
         406  +
    }
         407  +
    /// Consumes the builder and constructs a [`InventoryItem`](crate::types::InventoryItem).
         408  +
    /// This method will fail if any of the following fields are not set:
         409  +
    /// - [`type_name`](crate::types::builders::InventoryItemBuilder::type_name)
         410  +
    /// - [`schema_version`](crate::types::builders::InventoryItemBuilder::schema_version)
         411  +
    /// - [`capture_time`](crate::types::builders::InventoryItemBuilder::capture_time)
         412  +
    pub fn build(self) -> ::std::result::Result<crate::types::InventoryItem, ::aws_smithy_types::error::operation::BuildError> {
         413  +
        ::std::result::Result::Ok(crate::types::InventoryItem {
         414  +
            type_name: self.type_name.ok_or_else(|| {
         415  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         416  +
                    "type_name",
         417  +
                    "type_name was not specified but it is required when building InventoryItem",
         418  +
                )
         419  +
            })?,
         420  +
            schema_version: self.schema_version.ok_or_else(|| {
         421  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         422  +
                    "schema_version",
         423  +
                    "schema_version was not specified but it is required when building InventoryItem",
         424  +
                )
         425  +
            })?,
         426  +
            capture_time: self.capture_time.ok_or_else(|| {
         427  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         428  +
                    "capture_time",
         429  +
                    "capture_time was not specified but it is required when building InventoryItem",
         430  +
                )
         431  +
            })?,
         432  +
            content_hash: self.content_hash,
         433  +
            content: self.content,
         434  +
            context: self.context,
         435  +
        })
         436  +
    }
         437  +
}

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

@@ -0,1 +0,175 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Attributes are the entries within the inventory item content. It contains name and value.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct InventoryItemAttribute {
           7  +
    /// <p>Name of the inventory item attribute.</p>
           8  +
    pub name: ::std::string::String,
           9  +
    /// <p>The data type of the inventory item attribute.</p>
          10  +
    pub data_type: crate::types::InventoryAttributeDataType,
          11  +
}
          12  +
impl InventoryItemAttribute {
          13  +
    /// <p>Name of the inventory item attribute.</p>
          14  +
    pub fn name(&self) -> &str {
          15  +
        use std::ops::Deref;
          16  +
        self.name.deref()
          17  +
    }
          18  +
    /// <p>The data type of the inventory item attribute.</p>
          19  +
    pub fn data_type(&self) -> &crate::types::InventoryAttributeDataType {
          20  +
        &self.data_type
          21  +
    }
          22  +
}
          23  +
static INVENTORYITEMATTRIBUTE_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          24  +
    ::aws_smithy_schema::ShapeId::from_parts(
          25  +
        "com.amazonaws.ssm#InventoryItemAttribute$Name",
          26  +
        "com.amazonaws.ssm",
          27  +
        "InventoryItemAttribute",
          28  +
    ),
          29  +
    ::aws_smithy_schema::ShapeType::String,
          30  +
    "Name",
          31  +
    0,
          32  +
);
          33  +
static INVENTORYITEMATTRIBUTE_MEMBER_DATA_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm#InventoryItemAttribute$DataType",
          36  +
        "com.amazonaws.ssm",
          37  +
        "InventoryItemAttribute",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::String,
          40  +
    "DataType",
          41  +
    1,
          42  +
);
          43  +
static INVENTORYITEMATTRIBUTE_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryItemAttribute", "com.amazonaws.ssm", "InventoryItemAttribute"),
          45  +
    ::aws_smithy_schema::ShapeType::Structure,
          46  +
    &[&INVENTORYITEMATTRIBUTE_MEMBER_NAME, &INVENTORYITEMATTRIBUTE_MEMBER_DATA_TYPE],
          47  +
);
          48  +
impl InventoryItemAttribute {
          49  +
    /// The schema for this shape.
          50  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INVENTORYITEMATTRIBUTE_SCHEMA;
          51  +
}
          52  +
impl ::aws_smithy_schema::serde::SerializableStruct for InventoryItemAttribute {
          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  +
        {
          59  +
            let val = &self.name;
          60  +
            ser.write_string(&INVENTORYITEMATTRIBUTE_MEMBER_NAME, val)?;
          61  +
        }
          62  +
        {
          63  +
            let val = &self.data_type;
          64  +
            ser.write_string(&INVENTORYITEMATTRIBUTE_MEMBER_DATA_TYPE, val.as_str())?;
          65  +
        }
          66  +
        Ok(())
          67  +
    }
          68  +
}
          69  +
impl InventoryItemAttribute {
          70  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          71  +
    pub fn deserialize(
          72  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          73  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          74  +
        #[allow(unused_variables, unused_mut)]
          75  +
        let mut builder = Self::builder();
          76  +
        #[allow(
          77  +
            unused_variables,
          78  +
            unreachable_code,
          79  +
            clippy::single_match,
          80  +
            clippy::match_single_binding,
          81  +
            clippy::diverging_sub_expression
          82  +
        )]
          83  +
        deserializer.read_struct(&INVENTORYITEMATTRIBUTE_SCHEMA, &mut |member, deser| {
          84  +
            match member.member_index() {
          85  +
                Some(0) => {
          86  +
                    builder.name = Some(deser.read_string(member)?);
          87  +
                }
          88  +
                Some(1) => {
          89  +
                    builder.data_type = Some(crate::types::InventoryAttributeDataType::from(deser.read_string(member)?.as_str()));
          90  +
                }
          91  +
                _ => {}
          92  +
            }
          93  +
            Ok(())
          94  +
        })?;
          95  +
        builder.name = builder.name.or(Some(String::new()));
          96  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          97  +
    }
          98  +
}
          99  +
impl InventoryItemAttribute {
         100  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         101  +
    pub fn deserialize_with_response(
         102  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         103  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         104  +
        _status: u16,
         105  +
        _body: &[u8],
         106  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         107  +
        Self::deserialize(deserializer)
         108  +
    }
         109  +
}
         110  +
impl InventoryItemAttribute {
         111  +
    /// Creates a new builder-style object to manufacture [`InventoryItemAttribute`](crate::types::InventoryItemAttribute).
         112  +
    pub fn builder() -> crate::types::builders::InventoryItemAttributeBuilder {
         113  +
        crate::types::builders::InventoryItemAttributeBuilder::default()
         114  +
    }
         115  +
}
         116  +
         117  +
/// A builder for [`InventoryItemAttribute`](crate::types::InventoryItemAttribute).
         118  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         119  +
#[non_exhaustive]
         120  +
pub struct InventoryItemAttributeBuilder {
         121  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         122  +
    pub(crate) data_type: ::std::option::Option<crate::types::InventoryAttributeDataType>,
         123  +
}
         124  +
impl InventoryItemAttributeBuilder {
         125  +
    /// <p>Name of the inventory item attribute.</p>
         126  +
    /// This field is required.
         127  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         128  +
        self.name = ::std::option::Option::Some(input.into());
         129  +
        self
         130  +
    }
         131  +
    /// <p>Name of the inventory item attribute.</p>
         132  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         133  +
        self.name = input;
         134  +
        self
         135  +
    }
         136  +
    /// <p>Name of the inventory item attribute.</p>
         137  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         138  +
        &self.name
         139  +
    }
         140  +
    /// <p>The data type of the inventory item attribute.</p>
         141  +
    /// This field is required.
         142  +
    pub fn data_type(mut self, input: crate::types::InventoryAttributeDataType) -> Self {
         143  +
        self.data_type = ::std::option::Option::Some(input);
         144  +
        self
         145  +
    }
         146  +
    /// <p>The data type of the inventory item attribute.</p>
         147  +
    pub fn set_data_type(mut self, input: ::std::option::Option<crate::types::InventoryAttributeDataType>) -> Self {
         148  +
        self.data_type = input;
         149  +
        self
         150  +
    }
         151  +
    /// <p>The data type of the inventory item attribute.</p>
         152  +
    pub fn get_data_type(&self) -> &::std::option::Option<crate::types::InventoryAttributeDataType> {
         153  +
        &self.data_type
         154  +
    }
         155  +
    /// Consumes the builder and constructs a [`InventoryItemAttribute`](crate::types::InventoryItemAttribute).
         156  +
    /// This method will fail if any of the following fields are not set:
         157  +
    /// - [`name`](crate::types::builders::InventoryItemAttributeBuilder::name)
         158  +
    /// - [`data_type`](crate::types::builders::InventoryItemAttributeBuilder::data_type)
         159  +
    pub fn build(self) -> ::std::result::Result<crate::types::InventoryItemAttribute, ::aws_smithy_types::error::operation::BuildError> {
         160  +
        ::std::result::Result::Ok(crate::types::InventoryItemAttribute {
         161  +
            name: self.name.ok_or_else(|| {
         162  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         163  +
                    "name",
         164  +
                    "name was not specified but it is required when building InventoryItemAttribute",
         165  +
                )
         166  +
            })?,
         167  +
            data_type: self.data_type.ok_or_else(|| {
         168  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         169  +
                    "data_type",
         170  +
                    "data_type was not specified but it is required when building InventoryItemAttribute",
         171  +
                )
         172  +
            })?,
         173  +
        })
         174  +
    }
         175  +
}