aws-sdk-apptest 1.57.0

AWS SDK for AWS Mainframe Modernization Application Testing
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Defines a step.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Step {
    /// <p>The name of the step.</p>
    pub name: ::std::string::String,
    /// <p>The description of the step.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The action of the step.</p>
    pub action: ::std::option::Option<crate::types::StepAction>,
}
impl Step {
    /// <p>The name of the step.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The description of the step.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The action of the step.</p>
    pub fn action(&self) -> ::std::option::Option<&crate::types::StepAction> {
        self.action.as_ref()
    }
}
impl Step {
    /// Creates a new builder-style object to manufacture [`Step`](crate::types::Step).
    pub fn builder() -> crate::types::builders::StepBuilder {
        crate::types::builders::StepBuilder::default()
    }
}

/// A builder for [`Step`](crate::types::Step).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StepBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) action: ::std::option::Option<crate::types::StepAction>,
}
impl StepBuilder {
    /// <p>The name of the step.</p>
    /// This field is required.
    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 name of the step.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the step.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The description of the step.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the step.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the step.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The action of the step.</p>
    /// This field is required.
    pub fn action(mut self, input: crate::types::StepAction) -> Self {
        self.action = ::std::option::Option::Some(input);
        self
    }
    /// <p>The action of the step.</p>
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::StepAction>) -> Self {
        self.action = input;
        self
    }
    /// <p>The action of the step.</p>
    pub fn get_action(&self) -> &::std::option::Option<crate::types::StepAction> {
        &self.action
    }
    /// Consumes the builder and constructs a [`Step`](crate::types::Step).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::StepBuilder::name)
    pub fn build(self) -> ::std::result::Result<crate::types::Step, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Step {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building Step",
                )
            })?,
            description: self.description,
            action: self.action,
        })
    }
}