// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Name of the step from the SSM document.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RemediationExecutionStep {
    /// <p>The details of the step.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The valid status of the step.</p>
    pub state: ::std::option::Option<crate::types::RemediationExecutionStepState>,
    /// <p>An error message if the step was interrupted during execution.</p>
    pub error_message: ::std::option::Option<::std::string::String>,
    /// <p>The time when the step started.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time when the step stopped.</p>
    pub stop_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl RemediationExecutionStep {
    /// <p>The details of the step.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The valid status of the step.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::RemediationExecutionStepState> {
        self.state.as_ref()
    }
    /// <p>An error message if the step was interrupted during execution.</p>
    pub fn error_message(&self) -> ::std::option::Option<&str> {
        self.error_message.as_deref()
    }
    /// <p>The time when the step started.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>The time when the step stopped.</p>
    pub fn stop_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.stop_time.as_ref()
    }
}
impl RemediationExecutionStep {
    /// Creates a new builder-style object to manufacture [`RemediationExecutionStep`](crate::types::RemediationExecutionStep).
    pub fn builder() -> crate::types::builders::RemediationExecutionStepBuilder {
        crate::types::builders::RemediationExecutionStepBuilder::default()
    }
}

/// A builder for [`RemediationExecutionStep`](crate::types::RemediationExecutionStep).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RemediationExecutionStepBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::RemediationExecutionStepState>,
    pub(crate) error_message: ::std::option::Option<::std::string::String>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) stop_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl RemediationExecutionStepBuilder {
    /// <p>The details of the step.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The details of the step.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The details of the step.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The valid status of the step.</p>
    pub fn state(mut self, input: crate::types::RemediationExecutionStepState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The valid status of the step.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::RemediationExecutionStepState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The valid status of the step.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::RemediationExecutionStepState> {
        &self.state
    }
    /// <p>An error message if the step was interrupted during execution.</p>
    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An error message if the step was interrupted during execution.</p>
    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_message = input;
        self
    }
    /// <p>An error message if the step was interrupted during execution.</p>
    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_message
    }
    /// <p>The time when the step started.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the step started.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The time when the step started.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The time when the step stopped.</p>
    pub fn stop_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.stop_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the step stopped.</p>
    pub fn set_stop_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.stop_time = input;
        self
    }
    /// <p>The time when the step stopped.</p>
    pub fn get_stop_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.stop_time
    }
    /// Consumes the builder and constructs a [`RemediationExecutionStep`](crate::types::RemediationExecutionStep).
    pub fn build(self) -> crate::types::RemediationExecutionStep {
        crate::types::RemediationExecutionStep {
            name: self.name,
            state: self.state,
            error_message: self.error_message,
            start_time: self.start_time,
            stop_time: self.stop_time,
        }
    }
}
