#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetCalendarStateInput {
pub calendar_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub at_time: ::std::option::Option<::std::string::String>,
}
impl GetCalendarStateInput {
pub fn calendar_names(&self) -> &[::std::string::String] {
self.calendar_names.as_deref().unwrap_or_default()
}
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 {
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 {
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 {
pub fn builder() -> crate::operation::get_calendar_state::builders::GetCalendarStateInputBuilder {
crate::operation::get_calendar_state::builders::GetCalendarStateInputBuilder::default()
}
}
#[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 {
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
}
pub fn set_calendar_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.calendar_names = input;
self
}
pub fn get_calendar_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.calendar_names
}
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
}
pub fn set_at_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.at_time = input;
self
}
pub fn get_at_time(&self) -> &::std::option::Option<::std::string::String> {
&self.at_time
}
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,
})
}
}