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 GetCalendarStateInput {
    /// <p>The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.</p>
    pub calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>(Optional) The specific time for which you want to get calendar state information, in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you don't specify a value or <code>AtTime</code>, the current time is used.</p>
    pub at_time: ::std::option::Option<::std::string::String>,
}
impl GetCalendarStateInput {
    /// <p>The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.</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 `.calendar_names.is_none()`.
    pub fn calendar_names(&self) -> &[::std::string::String] {
        self.calendar_names.as_deref().unwrap_or_default()
    }
    /// <p>(Optional) The specific time for which you want to get calendar state information, in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you don't specify a value or <code>AtTime</code>, the current time is used.</p>
    pub fn at_time(&self) -> ::std::option::Option<&str> {
        self.at_time.as_deref()
    }
}
static GETCALENDARSTATEINPUT_MEMBER_CALENDAR_NAMES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm#CalendarNameOrARNList$member",
        "com.amazonaws.ssm",
        "CalendarNameOrARNList",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "member",
    0,
);
static GETCALENDARSTATEINPUT_MEMBER_CALENDAR_NAMES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetCalendarStateInput$CalendarNames",
        "com.amazonaws.ssm.synthetic",
        "GetCalendarStateInput",
    ),
    ::aws_smithy_schema::ShapeType::List,
    "CalendarNames",
    0,
)
.with_list_member(&GETCALENDARSTATEINPUT_MEMBER_CALENDAR_NAMES_MEMBER);
static GETCALENDARSTATEINPUT_MEMBER_AT_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetCalendarStateInput$AtTime",
        "com.amazonaws.ssm.synthetic",
        "GetCalendarStateInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "AtTime",
    1,
);
static GETCALENDARSTATEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetCalendarStateInput",
        "com.amazonaws.ssm.synthetic",
        "GetCalendarStateInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&GETCALENDARSTATEINPUT_MEMBER_CALENDAR_NAMES, &GETCALENDARSTATEINPUT_MEMBER_AT_TIME],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("GetCalendarStateRequest");
impl GetCalendarStateInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETCALENDARSTATEINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetCalendarStateInput {
    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.calendar_names {
            ser.write_list(
                &GETCALENDARSTATEINPUT_MEMBER_CALENDAR_NAMES,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for item in val {
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
                    }
                    Ok(())
                },
            )?;
        }
        if let Some(ref val) = self.at_time {
            ser.write_string(&GETCALENDARSTATEINPUT_MEMBER_AT_TIME, val)?;
        }
        Ok(())
    }
}
impl crate::operation::get_calendar_state::builders::GetCalendarStateInputBuilder {
    #[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(&GETCALENDARSTATEINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.calendar_names = Some(deser.read_string_list(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.at_time = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

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

/// A builder for [`GetCalendarStateInput`](crate::operation::get_calendar_state::GetCalendarStateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetCalendarStateInputBuilder {
    pub(crate) calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) at_time: ::std::option::Option<::std::string::String>,
}
impl GetCalendarStateInputBuilder {
    /// Appends an item to `calendar_names`.
    ///
    /// To override the contents of this collection use [`set_calendar_names`](Self::set_calendar_names).
    ///
    /// <p>The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.</p>
    pub fn calendar_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.calendar_names.unwrap_or_default();
        v.push(input.into());
        self.calendar_names = ::std::option::Option::Some(v);
        self
    }
    /// <p>The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.</p>
    pub fn set_calendar_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.calendar_names = input;
        self
    }
    /// <p>The names of Amazon Resource Names (ARNs) of the Systems Manager documents (SSM documents) that represent the calendar entries for which you want to get the state.</p>
    pub fn get_calendar_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.calendar_names
    }
    /// <p>(Optional) The specific time for which you want to get calendar state information, in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you don't specify a value or <code>AtTime</code>, the current time is used.</p>
    pub fn at_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.at_time = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>(Optional) The specific time for which you want to get calendar state information, in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you don't specify a value or <code>AtTime</code>, the current time is used.</p>
    pub fn set_at_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.at_time = input;
        self
    }
    /// <p>(Optional) The specific time for which you want to get calendar state information, in <a href="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you don't specify a value or <code>AtTime</code>, the current time is used.</p>
    pub fn get_at_time(&self) -> &::std::option::Option<::std::string::String> {
        &self.at_time
    }
    /// Consumes the builder and constructs a [`GetCalendarStateInput`](crate::operation::get_calendar_state::GetCalendarStateInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_calendar_state::GetCalendarStateInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_calendar_state::GetCalendarStateInput {
            calendar_names: self.calendar_names,
            at_time: self.at_time,
        })
    }
}