aws-sdk-ssm 1.131.0

AWS SDK for Amazon Simple Systems Manager (SSM)
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeInstancePropertiesInput {
    /// <p>An array of instance property filters.</p>
    pub instance_property_filter_list: ::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyFilter>>,
    /// <p>The request filters to use with the operator.</p>
    pub filters_with_operator: ::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyStringFilter>>,
    /// <p>The maximum number of items to return for the call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <p>The token provided by a previous request to use to return the next set of properties.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
}
impl DescribeInstancePropertiesInput {
    /// <p>An array of instance property filters.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_property_filter_list.is_none()`.
    pub fn instance_property_filter_list(&self) -> &[crate::types::InstancePropertyFilter] {
        self.instance_property_filter_list.as_deref().unwrap_or_default()
    }
    /// <p>The request filters to use with the operator.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters_with_operator.is_none()`.
    pub fn filters_with_operator(&self) -> &[crate::types::InstancePropertyStringFilter] {
        self.filters_with_operator.as_deref().unwrap_or_default()
    }
    /// <p>The maximum number of items to return for the call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// <p>The token provided by a previous request to use to return the next set of properties.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
static DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_INSTANCE_PROPERTY_FILTER_LIST_MEMBER: ::aws_smithy_schema::Schema<'static> =
    ::aws_smithy_schema::Schema::new_member(
        ::aws_smithy_schema::ShapeId::from_parts(
            "com.amazonaws.ssm#InstancePropertyFilterList$member",
            "com.amazonaws.ssm",
            "InstancePropertyFilterList",
        ),
        ::aws_smithy_schema::ShapeType::Structure,
        "member",
        0,
    )
    .with_xml_name("InstancePropertyFilter");
static DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_INSTANCE_PROPERTY_FILTER_LIST: ::aws_smithy_schema::Schema<'static> =
    ::aws_smithy_schema::Schema::new_member(
        ::aws_smithy_schema::ShapeId::from_parts(
            "com.amazonaws.ssm.synthetic#DescribeInstancePropertiesInput$InstancePropertyFilterList",
            "com.amazonaws.ssm.synthetic",
            "DescribeInstancePropertiesInput",
        ),
        ::aws_smithy_schema::ShapeType::List,
        "InstancePropertyFilterList",
        0,
    )
    .with_list_member(&DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_INSTANCE_PROPERTY_FILTER_LIST_MEMBER);
static DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_FILTERS_WITH_OPERATOR_MEMBER: ::aws_smithy_schema::Schema<'static> =
    ::aws_smithy_schema::Schema::new_member(
        ::aws_smithy_schema::ShapeId::from_parts(
            "com.amazonaws.ssm#InstancePropertyStringFilterList$member",
            "com.amazonaws.ssm",
            "InstancePropertyStringFilterList",
        ),
        ::aws_smithy_schema::ShapeType::Structure,
        "member",
        0,
    )
    .with_xml_name("InstancePropertyStringFilter");
static DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_FILTERS_WITH_OPERATOR: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeInstancePropertiesInput$FiltersWithOperator",
        "com.amazonaws.ssm.synthetic",
        "DescribeInstancePropertiesInput",
    ),
    ::aws_smithy_schema::ShapeType::List,
    "FiltersWithOperator",
    1,
)
.with_list_member(&DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_FILTERS_WITH_OPERATOR_MEMBER);
static DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeInstancePropertiesInput$MaxResults",
        "com.amazonaws.ssm.synthetic",
        "DescribeInstancePropertiesInput",
    ),
    ::aws_smithy_schema::ShapeType::Integer,
    "MaxResults",
    2,
);
static DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeInstancePropertiesInput$NextToken",
        "com.amazonaws.ssm.synthetic",
        "DescribeInstancePropertiesInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "NextToken",
    3,
);
static DESCRIBEINSTANCEPROPERTIESINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeInstancePropertiesInput",
        "com.amazonaws.ssm.synthetic",
        "DescribeInstancePropertiesInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_INSTANCE_PROPERTY_FILTER_LIST,
        &DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_FILTERS_WITH_OPERATOR,
        &DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_MAX_RESULTS,
        &DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_NEXT_TOKEN,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DescribeInstancePropertiesRequest");
impl DescribeInstancePropertiesInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEINSTANCEPROPERTIESINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeInstancePropertiesInput {
    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
        Self::SCHEMA
    }

    #[allow(unused_variables, clippy::diverging_sub_expression)]
    fn serialize_members(
        &self,
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        if let Some(ref val) = self.instance_property_filter_list {
            ser.write_list(
                &DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_INSTANCE_PROPERTY_FILTER_LIST,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for item in val {
                        ser.write_struct(crate::types::InstancePropertyFilter::SCHEMA, item)?;
                    }
                    Ok(())
                },
            )?;
        }
        if let Some(ref val) = self.filters_with_operator {
            ser.write_list(
                &DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_FILTERS_WITH_OPERATOR,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for item in val {
                        ser.write_struct(crate::types::InstancePropertyStringFilter::SCHEMA, item)?;
                    }
                    Ok(())
                },
            )?;
        }
        if let Some(ref val) = self.max_results {
            ser.write_integer(&DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_MAX_RESULTS, *val)?;
        }
        if let Some(ref val) = self.next_token {
            ser.write_string(&DESCRIBEINSTANCEPROPERTIESINPUT_MEMBER_NEXT_TOKEN, val)?;
        }
        Ok(())
    }
}
impl crate::operation::describe_instance_properties::builders::DescribeInstancePropertiesInputBuilder {
    #[allow(
        unused_variables,
        unreachable_code,
        clippy::single_match,
        clippy::match_single_binding,
        clippy::diverging_sub_expression
    )]
    pub(crate) fn deserialize_members(
        &mut self,
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        deserializer.read_struct(&DESCRIBEINSTANCEPROPERTIESINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.instance_property_filter_list = Some({
                            let mut container = Vec::new();
                            deser.read_list(member, &mut |deser| {
                                container.push(crate::types::InstancePropertyFilter::deserialize(deser)?);
                                Ok(())
                            })?;
                            container
                        });
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.filters_with_operator = Some({
                            let mut container = Vec::new();
                            deser.read_list(member, &mut |deser| {
                                container.push(crate::types::InstancePropertyStringFilter::deserialize(deser)?);
                                Ok(())
                            })?;
                            container
                        });
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.max_results = Some(deser.read_integer(member)?);
                    }
                }
                Some(3) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.next_token = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl DescribeInstancePropertiesInput {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    pub fn deserialize(
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
        let mut builder = Self::builder();
        builder.deserialize_members(deserializer)?;
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl DescribeInstancePropertiesInput {
    /// Creates a new builder-style object to manufacture [`DescribeInstancePropertiesInput`](crate::operation::describe_instance_properties::DescribeInstancePropertiesInput).
    pub fn builder() -> crate::operation::describe_instance_properties::builders::DescribeInstancePropertiesInputBuilder {
        crate::operation::describe_instance_properties::builders::DescribeInstancePropertiesInputBuilder::default()
    }
}

/// A builder for [`DescribeInstancePropertiesInput`](crate::operation::describe_instance_properties::DescribeInstancePropertiesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeInstancePropertiesInputBuilder {
    pub(crate) instance_property_filter_list: ::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyFilter>>,
    pub(crate) filters_with_operator: ::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyStringFilter>>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
}
impl DescribeInstancePropertiesInputBuilder {
    /// Appends an item to `instance_property_filter_list`.
    ///
    /// To override the contents of this collection use [`set_instance_property_filter_list`](Self::set_instance_property_filter_list).
    ///
    /// <p>An array of instance property filters.</p>
    pub fn instance_property_filter_list(mut self, input: crate::types::InstancePropertyFilter) -> Self {
        let mut v = self.instance_property_filter_list.unwrap_or_default();
        v.push(input);
        self.instance_property_filter_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of instance property filters.</p>
    pub fn set_instance_property_filter_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyFilter>>) -> Self {
        self.instance_property_filter_list = input;
        self
    }
    /// <p>An array of instance property filters.</p>
    pub fn get_instance_property_filter_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyFilter>> {
        &self.instance_property_filter_list
    }
    /// Appends an item to `filters_with_operator`.
    ///
    /// To override the contents of this collection use [`set_filters_with_operator`](Self::set_filters_with_operator).
    ///
    /// <p>The request filters to use with the operator.</p>
    pub fn filters_with_operator(mut self, input: crate::types::InstancePropertyStringFilter) -> Self {
        let mut v = self.filters_with_operator.unwrap_or_default();
        v.push(input);
        self.filters_with_operator = ::std::option::Option::Some(v);
        self
    }
    /// <p>The request filters to use with the operator.</p>
    pub fn set_filters_with_operator(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyStringFilter>>) -> Self {
        self.filters_with_operator = input;
        self
    }
    /// <p>The request filters to use with the operator.</p>
    pub fn get_filters_with_operator(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstancePropertyStringFilter>> {
        &self.filters_with_operator
    }
    /// <p>The maximum number of items to return for the call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of items to return for the call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>The maximum number of items to return for the call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// <p>The token provided by a previous request to use to return the next set of properties.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The token provided by a previous request to use to return the next set of properties.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The token provided by a previous request to use to return the next set of properties.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Consumes the builder and constructs a [`DescribeInstancePropertiesInput`](crate::operation::describe_instance_properties::DescribeInstancePropertiesInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::describe_instance_properties::DescribeInstancePropertiesInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::describe_instance_properties::DescribeInstancePropertiesInput {
            instance_property_filter_list: self.instance_property_filter_list,
            filters_with_operator: self.filters_with_operator,
            max_results: self.max_results,
            next_token: self.next_token,
        })
    }
}