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 DescribePatchPropertiesOutput {
    /// <p>A list of the properties for patches matching the filter request parameters.</p>
    pub properties: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    /// <p>The token for the next set of items to return. (You use this token in the next call.)</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribePatchPropertiesOutput {
    /// <p>A list of the properties for patches matching the filter request parameters.</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 `.properties.is_none()`.
    pub fn properties(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::string::String>] {
        self.properties.as_deref().unwrap_or_default()
    }
    /// <p>The token for the next set of items to return. (You use this token in the next call.)</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
static DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchPropertyEntry$key", "com.amazonaws.ssm", "PatchPropertyEntry"),
    ::aws_smithy_schema::ShapeType::String,
    "key",
    0,
);
static DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchPropertyEntry$value", "com.amazonaws.ssm", "PatchPropertyEntry"),
    ::aws_smithy_schema::ShapeType::String,
    "value",
    1,
);
static DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchPropertiesList$member", "com.amazonaws.ssm", "PatchPropertiesList"),
    ::aws_smithy_schema::ShapeType::Map,
    "member",
    0,
)
.with_map_members(
    &DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER_KEY,
    &DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER_VALUE,
);
static DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribePatchPropertiesOutput$Properties",
        "com.amazonaws.ssm.synthetic",
        "DescribePatchPropertiesOutput",
    ),
    ::aws_smithy_schema::ShapeType::List,
    "Properties",
    0,
)
.with_list_member(&DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER);
static DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribePatchPropertiesOutput$NextToken",
        "com.amazonaws.ssm.synthetic",
        "DescribePatchPropertiesOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "NextToken",
    1,
);
static DESCRIBEPATCHPROPERTIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribePatchPropertiesOutput",
        "com.amazonaws.ssm.synthetic",
        "DescribePatchPropertiesOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES,
        &DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_NEXT_TOKEN,
    ],
)
.with_original_name("DescribePatchPropertiesResult");
impl DescribePatchPropertiesOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEPATCHPROPERTIESOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DescribePatchPropertiesOutput {
    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.properties {
            ser.write_list(
                &DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for item in val {
                        ser.write_map(
                            &DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER,
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                                for (key, value) in item {
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
                                    ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
                                }
                                Ok(())
                            },
                        )?;
                    }
                    Ok(())
                },
            )?;
        }
        if let Some(ref val) = self.next_token {
            ser.write_string(&DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_NEXT_TOKEN, val)?;
        }
        Ok(())
    }
}
impl crate::operation::describe_patch_properties::builders::DescribePatchPropertiesOutputBuilder {
    #[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(&DESCRIBEPATCHPROPERTIESOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.properties = Some({
                            let mut container = Vec::new();
                            deser.read_list(member, &mut |deser| {
                                container.push({
                                    let mut map = ::std::collections::HashMap::new();
                                    deser.read_map(&DESCRIBEPATCHPROPERTIESOUTPUT_MEMBER_PROPERTIES_MEMBER, &mut |key, deser| {
                                        let value = deser.read_string(&::aws_smithy_schema::prelude::STRING)?;
                                        map.insert(key, value);
                                        Ok(())
                                    })?;
                                    map
                                });
                                Ok(())
                            })?;
                            container
                        });
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.next_token = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl DescribePatchPropertiesOutput {
    /// 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)?;
        Ok(builder.build())
    }
}
impl ::aws_types::request_id::RequestId for DescribePatchPropertiesOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribePatchPropertiesOutput {
    /// Creates a new builder-style object to manufacture [`DescribePatchPropertiesOutput`](crate::operation::describe_patch_properties::DescribePatchPropertiesOutput).
    pub fn builder() -> crate::operation::describe_patch_properties::builders::DescribePatchPropertiesOutputBuilder {
        crate::operation::describe_patch_properties::builders::DescribePatchPropertiesOutputBuilder::default()
    }
}

/// A builder for [`DescribePatchPropertiesOutput`](crate::operation::describe_patch_properties::DescribePatchPropertiesOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribePatchPropertiesOutputBuilder {
    pub(crate) properties: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribePatchPropertiesOutputBuilder {
    /// Appends an item to `properties`.
    ///
    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
    ///
    /// <p>A list of the properties for patches matching the filter request parameters.</p>
    pub fn properties(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
        let mut v = self.properties.unwrap_or_default();
        v.push(input);
        self.properties = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of the properties for patches matching the filter request parameters.</p>
    pub fn set_properties(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>>,
    ) -> Self {
        self.properties = input;
        self
    }
    /// <p>A list of the properties for patches matching the filter request parameters.</p>
    pub fn get_properties(
        &self,
    ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>> {
        &self.properties
    }
    /// <p>The token for the next set of items to return. (You use this token in the next call.)</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 for the next set of items to return. (You use this token in the next call.)</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The token for the next set of items to return. (You use this token in the next call.)</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribePatchPropertiesOutput`](crate::operation::describe_patch_properties::DescribePatchPropertiesOutput).
    pub fn build(self) -> crate::operation::describe_patch_properties::DescribePatchPropertiesOutput {
        crate::operation::describe_patch_properties::DescribePatchPropertiesOutput {
            properties: self.properties,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}