#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StopAutomationExecutionInput {
pub automation_execution_id: ::std::option::Option<::std::string::String>,
pub r#type: ::std::option::Option<crate::types::StopType>,
}
impl StopAutomationExecutionInput {
pub fn automation_execution_id(&self) -> ::std::option::Option<&str> {
self.automation_execution_id.as_deref()
}
pub fn r#type(&self) -> ::std::option::Option<&crate::types::StopType> {
self.r#type.as_ref()
}
}
static STOPAUTOMATIONEXECUTIONINPUT_MEMBER_AUTOMATION_EXECUTION_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#StopAutomationExecutionInput$AutomationExecutionId",
"com.amazonaws.ssm.synthetic",
"StopAutomationExecutionInput",
),
::aws_smithy_schema::ShapeType::String,
"AutomationExecutionId",
0,
);
static STOPAUTOMATIONEXECUTIONINPUT_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#StopAutomationExecutionInput$Type",
"com.amazonaws.ssm.synthetic",
"StopAutomationExecutionInput",
),
::aws_smithy_schema::ShapeType::String,
"Type",
1,
);
static STOPAUTOMATIONEXECUTIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#StopAutomationExecutionInput",
"com.amazonaws.ssm.synthetic",
"StopAutomationExecutionInput",
),
::aws_smithy_schema::ShapeType::Structure,
&[
&STOPAUTOMATIONEXECUTIONINPUT_MEMBER_AUTOMATION_EXECUTION_ID,
&STOPAUTOMATIONEXECUTIONINPUT_MEMBER_TYPE,
],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("StopAutomationExecutionRequest");
impl StopAutomationExecutionInput {
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STOPAUTOMATIONEXECUTIONINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for StopAutomationExecutionInput {
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.automation_execution_id {
ser.write_string(&STOPAUTOMATIONEXECUTIONINPUT_MEMBER_AUTOMATION_EXECUTION_ID, val)?;
}
if let Some(ref val) = self.r#type {
ser.write_string(&STOPAUTOMATIONEXECUTIONINPUT_MEMBER_TYPE, val.as_str())?;
}
Ok(())
}
}
impl crate::operation::stop_automation_execution::builders::StopAutomationExecutionInputBuilder {
#[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(&STOPAUTOMATIONEXECUTIONINPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.automation_execution_id = Some(deser.read_string(member)?);
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.r#type = Some(crate::types::StopType::from(deser.read_string(member)?.as_str()));
}
}
_ => {}
}
Ok(())
})
}
}
impl StopAutomationExecutionInput {
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.automation_execution_id = builder.automation_execution_id.or(Some(String::new()));
builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
}
}
impl StopAutomationExecutionInput {
pub fn builder() -> crate::operation::stop_automation_execution::builders::StopAutomationExecutionInputBuilder {
crate::operation::stop_automation_execution::builders::StopAutomationExecutionInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StopAutomationExecutionInputBuilder {
pub(crate) automation_execution_id: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::StopType>,
}
impl StopAutomationExecutionInputBuilder {
pub fn automation_execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.automation_execution_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_automation_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.automation_execution_id = input;
self
}
pub fn get_automation_execution_id(&self) -> &::std::option::Option<::std::string::String> {
&self.automation_execution_id
}
pub fn r#type(mut self, input: crate::types::StopType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
pub fn set_type(mut self, input: ::std::option::Option<crate::types::StopType>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<crate::types::StopType> {
&self.r#type
}
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::stop_automation_execution::StopAutomationExecutionInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::stop_automation_execution::StopAutomationExecutionInput {
automation_execution_id: self.automation_execution_id,
r#type: self.r#type,
})
}
}