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 DescribeAssociationInput {
    /// <p>The name of the SSM document.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The managed node ID.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The association ID for which you want information.</p>
    pub association_id: ::std::option::Option<::std::string::String>,
    /// <p>Specify the association version to retrieve. To view the latest version, either specify <code>$LATEST</code> for this parameter, or omit this parameter. To view a list of all associations for a managed node, use <code>ListAssociations</code>. To get a list of versions for a specific association, use <code>ListAssociationVersions</code>.</p>
    pub association_version: ::std::option::Option<::std::string::String>,
}
impl DescribeAssociationInput {
    /// <p>The name of the SSM document.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The managed node ID.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The association ID for which you want information.</p>
    pub fn association_id(&self) -> ::std::option::Option<&str> {
        self.association_id.as_deref()
    }
    /// <p>Specify the association version to retrieve. To view the latest version, either specify <code>$LATEST</code> for this parameter, or omit this parameter. To view a list of all associations for a managed node, use <code>ListAssociations</code>. To get a list of versions for a specific association, use <code>ListAssociationVersions</code>.</p>
    pub fn association_version(&self) -> ::std::option::Option<&str> {
        self.association_version.as_deref()
    }
}
static DESCRIBEASSOCIATIONINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeAssociationInput$Name",
        "com.amazonaws.ssm.synthetic",
        "DescribeAssociationInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Name",
    0,
);
static DESCRIBEASSOCIATIONINPUT_MEMBER_INSTANCE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeAssociationInput$InstanceId",
        "com.amazonaws.ssm.synthetic",
        "DescribeAssociationInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "InstanceId",
    1,
);
static DESCRIBEASSOCIATIONINPUT_MEMBER_ASSOCIATION_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeAssociationInput$AssociationId",
        "com.amazonaws.ssm.synthetic",
        "DescribeAssociationInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "AssociationId",
    2,
);
static DESCRIBEASSOCIATIONINPUT_MEMBER_ASSOCIATION_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeAssociationInput$AssociationVersion",
        "com.amazonaws.ssm.synthetic",
        "DescribeAssociationInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "AssociationVersion",
    3,
);
static DESCRIBEASSOCIATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DescribeAssociationInput",
        "com.amazonaws.ssm.synthetic",
        "DescribeAssociationInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &DESCRIBEASSOCIATIONINPUT_MEMBER_NAME,
        &DESCRIBEASSOCIATIONINPUT_MEMBER_INSTANCE_ID,
        &DESCRIBEASSOCIATIONINPUT_MEMBER_ASSOCIATION_ID,
        &DESCRIBEASSOCIATIONINPUT_MEMBER_ASSOCIATION_VERSION,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DescribeAssociationRequest");
impl DescribeAssociationInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEASSOCIATIONINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeAssociationInput {
    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.name {
            ser.write_string(&DESCRIBEASSOCIATIONINPUT_MEMBER_NAME, val)?;
        }
        if let Some(ref val) = self.instance_id {
            ser.write_string(&DESCRIBEASSOCIATIONINPUT_MEMBER_INSTANCE_ID, val)?;
        }
        if let Some(ref val) = self.association_id {
            ser.write_string(&DESCRIBEASSOCIATIONINPUT_MEMBER_ASSOCIATION_ID, val)?;
        }
        if let Some(ref val) = self.association_version {
            ser.write_string(&DESCRIBEASSOCIATIONINPUT_MEMBER_ASSOCIATION_VERSION, val)?;
        }
        Ok(())
    }
}
impl crate::operation::describe_association::builders::DescribeAssociationInputBuilder {
    #[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(&DESCRIBEASSOCIATIONINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.name = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.instance_id = Some(deser.read_string(member)?);
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.association_id = Some(deser.read_string(member)?);
                    }
                }
                Some(3) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.association_version = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl DescribeAssociationInput {
    /// 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 DescribeAssociationInput {
    /// Creates a new builder-style object to manufacture [`DescribeAssociationInput`](crate::operation::describe_association::DescribeAssociationInput).
    pub fn builder() -> crate::operation::describe_association::builders::DescribeAssociationInputBuilder {
        crate::operation::describe_association::builders::DescribeAssociationInputBuilder::default()
    }
}

/// A builder for [`DescribeAssociationInput`](crate::operation::describe_association::DescribeAssociationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeAssociationInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) association_id: ::std::option::Option<::std::string::String>,
    pub(crate) association_version: ::std::option::Option<::std::string::String>,
}
impl DescribeAssociationInputBuilder {
    /// <p>The name of the SSM document.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the SSM document.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the SSM document.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The managed node ID.</p>
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The managed node ID.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The managed node ID.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The association ID for which you want information.</p>
    pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.association_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The association ID for which you want information.</p>
    pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.association_id = input;
        self
    }
    /// <p>The association ID for which you want information.</p>
    pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.association_id
    }
    /// <p>Specify the association version to retrieve. To view the latest version, either specify <code>$LATEST</code> for this parameter, or omit this parameter. To view a list of all associations for a managed node, use <code>ListAssociations</code>. To get a list of versions for a specific association, use <code>ListAssociationVersions</code>.</p>
    pub fn association_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.association_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specify the association version to retrieve. To view the latest version, either specify <code>$LATEST</code> for this parameter, or omit this parameter. To view a list of all associations for a managed node, use <code>ListAssociations</code>. To get a list of versions for a specific association, use <code>ListAssociationVersions</code>.</p>
    pub fn set_association_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.association_version = input;
        self
    }
    /// <p>Specify the association version to retrieve. To view the latest version, either specify <code>$LATEST</code> for this parameter, or omit this parameter. To view a list of all associations for a managed node, use <code>ListAssociations</code>. To get a list of versions for a specific association, use <code>ListAssociationVersions</code>.</p>
    pub fn get_association_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.association_version
    }
    /// Consumes the builder and constructs a [`DescribeAssociationInput`](crate::operation::describe_association::DescribeAssociationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::describe_association::DescribeAssociationInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::describe_association::DescribeAssociationInput {
            name: self.name,
            instance_id: self.instance_id,
            association_id: self.association_id,
            association_version: self.association_version,
        })
    }
}