#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetCalendarStateOutput {
pub state: ::std::option::Option<crate::types::CalendarState>,
pub at_time: ::std::option::Option<::std::string::String>,
pub next_transition_time: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetCalendarStateOutput {
pub fn state(&self) -> ::std::option::Option<&crate::types::CalendarState> {
self.state.as_ref()
}
pub fn at_time(&self) -> ::std::option::Option<&str> {
self.at_time.as_deref()
}
pub fn next_transition_time(&self) -> ::std::option::Option<&str> {
self.next_transition_time.as_deref()
}
}
static GETCALENDARSTATEOUTPUT_MEMBER_STATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#GetCalendarStateOutput$State",
"com.amazonaws.ssm.synthetic",
"GetCalendarStateOutput",
),
::aws_smithy_schema::ShapeType::String,
"State",
0,
);
static GETCALENDARSTATEOUTPUT_MEMBER_AT_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#GetCalendarStateOutput$AtTime",
"com.amazonaws.ssm.synthetic",
"GetCalendarStateOutput",
),
::aws_smithy_schema::ShapeType::String,
"AtTime",
1,
);
static GETCALENDARSTATEOUTPUT_MEMBER_NEXT_TRANSITION_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#GetCalendarStateOutput$NextTransitionTime",
"com.amazonaws.ssm.synthetic",
"GetCalendarStateOutput",
),
::aws_smithy_schema::ShapeType::String,
"NextTransitionTime",
2,
);
static GETCALENDARSTATEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#GetCalendarStateOutput",
"com.amazonaws.ssm.synthetic",
"GetCalendarStateOutput",
),
::aws_smithy_schema::ShapeType::Structure,
&[
&GETCALENDARSTATEOUTPUT_MEMBER_STATE,
&GETCALENDARSTATEOUTPUT_MEMBER_AT_TIME,
&GETCALENDARSTATEOUTPUT_MEMBER_NEXT_TRANSITION_TIME,
],
)
.with_original_name("GetCalendarStateResponse");
impl GetCalendarStateOutput {
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETCALENDARSTATEOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetCalendarStateOutput {
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.state {
ser.write_string(&GETCALENDARSTATEOUTPUT_MEMBER_STATE, val.as_str())?;
}
if let Some(ref val) = self.at_time {
ser.write_string(&GETCALENDARSTATEOUTPUT_MEMBER_AT_TIME, val)?;
}
if let Some(ref val) = self.next_transition_time {
ser.write_string(&GETCALENDARSTATEOUTPUT_MEMBER_NEXT_TRANSITION_TIME, val)?;
}
Ok(())
}
}
impl crate::operation::get_calendar_state::builders::GetCalendarStateOutputBuilder {
#[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(&GETCALENDARSTATEOUTPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.state = Some(crate::types::CalendarState::from(deser.read_string(member)?.as_str()));
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.at_time = Some(deser.read_string(member)?);
}
}
Some(2) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.next_transition_time = Some(deser.read_string(member)?);
}
}
_ => {}
}
Ok(())
})
}
}
impl GetCalendarStateOutput {
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 GetCalendarStateOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetCalendarStateOutput {
pub fn builder() -> crate::operation::get_calendar_state::builders::GetCalendarStateOutputBuilder {
crate::operation::get_calendar_state::builders::GetCalendarStateOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetCalendarStateOutputBuilder {
pub(crate) state: ::std::option::Option<crate::types::CalendarState>,
pub(crate) at_time: ::std::option::Option<::std::string::String>,
pub(crate) next_transition_time: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetCalendarStateOutputBuilder {
pub fn state(mut self, input: crate::types::CalendarState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
pub fn set_state(mut self, input: ::std::option::Option<crate::types::CalendarState>) -> Self {
self.state = input;
self
}
pub fn get_state(&self) -> &::std::option::Option<crate::types::CalendarState> {
&self.state
}
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 next_transition_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_transition_time = ::std::option::Option::Some(input.into());
self
}
pub fn set_next_transition_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_transition_time = input;
self
}
pub fn get_next_transition_time(&self) -> &::std::option::Option<::std::string::String> {
&self.next_transition_time
}
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
}
pub fn build(self) -> crate::operation::get_calendar_state::GetCalendarStateOutput {
crate::operation::get_calendar_state::GetCalendarStateOutput {
state: self.state,
at_time: self.at_time,
next_transition_time: self.next_transition_time,
_request_id: self._request_id,
}
}
}