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 StartAssociationsOnceInput {
    /// <p>The association IDs that you want to run immediately and only one time.</p>
    pub association_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl StartAssociationsOnceInput {
    /// <p>The association IDs that you want to run immediately and only one time.</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 `.association_ids.is_none()`.
    pub fn association_ids(&self) -> &[::std::string::String] {
        self.association_ids.as_deref().unwrap_or_default()
    }
}
static STARTASSOCIATIONSONCEINPUT_MEMBER_ASSOCIATION_IDS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#AssociationIdList$member", "com.amazonaws.ssm", "AssociationIdList"),
    ::aws_smithy_schema::ShapeType::String,
    "member",
    0,
);
static STARTASSOCIATIONSONCEINPUT_MEMBER_ASSOCIATION_IDS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#StartAssociationsOnceInput$AssociationIds",
        "com.amazonaws.ssm.synthetic",
        "StartAssociationsOnceInput",
    ),
    ::aws_smithy_schema::ShapeType::List,
    "AssociationIds",
    0,
)
.with_list_member(&STARTASSOCIATIONSONCEINPUT_MEMBER_ASSOCIATION_IDS_MEMBER);
static STARTASSOCIATIONSONCEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#StartAssociationsOnceInput",
        "com.amazonaws.ssm.synthetic",
        "StartAssociationsOnceInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&STARTASSOCIATIONSONCEINPUT_MEMBER_ASSOCIATION_IDS],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("StartAssociationsOnceRequest");
impl StartAssociationsOnceInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STARTASSOCIATIONSONCEINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for StartAssociationsOnceInput {
    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.association_ids {
            ser.write_list(
                &STARTASSOCIATIONSONCEINPUT_MEMBER_ASSOCIATION_IDS,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for item in val {
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
                    }
                    Ok(())
                },
            )?;
        }
        Ok(())
    }
}
impl crate::operation::start_associations_once::builders::StartAssociationsOnceInputBuilder {
    #[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(&STARTASSOCIATIONSONCEINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.association_ids = Some(deser.read_string_list(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl StartAssociationsOnceInput {
    /// 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.association_ids = builder.association_ids.or(Some(Vec::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl StartAssociationsOnceInput {
    /// Creates a new builder-style object to manufacture [`StartAssociationsOnceInput`](crate::operation::start_associations_once::StartAssociationsOnceInput).
    pub fn builder() -> crate::operation::start_associations_once::builders::StartAssociationsOnceInputBuilder {
        crate::operation::start_associations_once::builders::StartAssociationsOnceInputBuilder::default()
    }
}

/// A builder for [`StartAssociationsOnceInput`](crate::operation::start_associations_once::StartAssociationsOnceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartAssociationsOnceInputBuilder {
    pub(crate) association_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl StartAssociationsOnceInputBuilder {
    /// Appends an item to `association_ids`.
    ///
    /// To override the contents of this collection use [`set_association_ids`](Self::set_association_ids).
    ///
    /// <p>The association IDs that you want to run immediately and only one time.</p>
    pub fn association_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.association_ids.unwrap_or_default();
        v.push(input.into());
        self.association_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The association IDs that you want to run immediately and only one time.</p>
    pub fn set_association_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.association_ids = input;
        self
    }
    /// <p>The association IDs that you want to run immediately and only one time.</p>
    pub fn get_association_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.association_ids
    }
    /// Consumes the builder and constructs a [`StartAssociationsOnceInput`](crate::operation::start_associations_once::StartAssociationsOnceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_associations_once::StartAssociationsOnceInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_associations_once::StartAssociationsOnceInput {
            association_ids: self.association_ids,
        })
    }
}