aws-sdk-amplify 1.111.0

AWS SDK for AWS Amplify
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes an execution step, for an execution job, for an Amplify app.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Step {
    /// <p>The name of the execution step.</p>
    pub step_name: ::std::string::String,
    /// <p>The start date and time of the execution step.</p>
    pub start_time: ::aws_smithy_types::DateTime,
    /// <p>The status of the execution step.</p>
    pub status: crate::types::JobStatus,
    /// <p>The end date and time of the execution step.</p>
    pub end_time: ::aws_smithy_types::DateTime,
    /// <p>The URL to the logs for the execution step.</p>
    pub log_url: ::std::option::Option<::std::string::String>,
    /// <p>The URL to the build artifact for the execution step.</p>
    pub artifacts_url: ::std::option::Option<::std::string::String>,
    /// <p>The URL to the test artifact for the execution step.</p>
    pub test_artifacts_url: ::std::option::Option<::std::string::String>,
    /// <p>The URL to the test configuration for the execution step.</p>
    pub test_config_url: ::std::option::Option<::std::string::String>,
    /// <p>The list of screenshot URLs for the execution step, if relevant.</p>
    pub screenshots: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The reason for the current step status.</p>
    pub status_reason: ::std::option::Option<::std::string::String>,
    /// <p>The context for the current step. Includes a build image if the step is build.</p>
    pub context: ::std::option::Option<::std::string::String>,
}
impl Step {
    /// <p>The name of the execution step.</p>
    pub fn step_name(&self) -> &str {
        use std::ops::Deref;
        self.step_name.deref()
    }
    /// <p>The start date and time of the execution step.</p>
    pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.start_time
    }
    /// <p>The status of the execution step.</p>
    pub fn status(&self) -> &crate::types::JobStatus {
        &self.status
    }
    /// <p>The end date and time of the execution step.</p>
    pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
        &self.end_time
    }
    /// <p>The URL to the logs for the execution step.</p>
    pub fn log_url(&self) -> ::std::option::Option<&str> {
        self.log_url.as_deref()
    }
    /// <p>The URL to the build artifact for the execution step.</p>
    pub fn artifacts_url(&self) -> ::std::option::Option<&str> {
        self.artifacts_url.as_deref()
    }
    /// <p>The URL to the test artifact for the execution step.</p>
    pub fn test_artifacts_url(&self) -> ::std::option::Option<&str> {
        self.test_artifacts_url.as_deref()
    }
    /// <p>The URL to the test configuration for the execution step.</p>
    pub fn test_config_url(&self) -> ::std::option::Option<&str> {
        self.test_config_url.as_deref()
    }
    /// <p>The list of screenshot URLs for the execution step, if relevant.</p>
    pub fn screenshots(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.screenshots.as_ref()
    }
    /// <p>The reason for the current step status.</p>
    pub fn status_reason(&self) -> ::std::option::Option<&str> {
        self.status_reason.as_deref()
    }
    /// <p>The context for the current step. Includes a build image if the step is build.</p>
    pub fn context(&self) -> ::std::option::Option<&str> {
        self.context.as_deref()
    }
}
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) step_name: ::std::option::Option<::std::string::String>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) status: ::std::option::Option<crate::types::JobStatus>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) log_url: ::std::option::Option<::std::string::String>,
    pub(crate) artifacts_url: ::std::option::Option<::std::string::String>,
    pub(crate) test_artifacts_url: ::std::option::Option<::std::string::String>,
    pub(crate) test_config_url: ::std::option::Option<::std::string::String>,
    pub(crate) screenshots: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) status_reason: ::std::option::Option<::std::string::String>,
    pub(crate) context: ::std::option::Option<::std::string::String>,
}
impl StepBuilder {
    /// <p>The name of the execution step.</p>
    /// This field is required.
    pub fn step_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.step_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the execution step.</p>
    pub fn set_step_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.step_name = input;
        self
    }
    /// <p>The name of the execution step.</p>
    pub fn get_step_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.step_name
    }
    /// <p>The start date and time of the execution step.</p>
    /// This field is required.
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start date and time of the execution step.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The start date and time of the execution step.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The status of the execution step.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::JobStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the execution step.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the execution step.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
        &self.status
    }
    /// <p>The end date and time of the execution step.</p>
    /// This field is required.
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end date and time of the execution step.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>The end date and time of the execution step.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// <p>The URL to the logs for the execution step.</p>
    pub fn log_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.log_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL to the logs for the execution step.</p>
    pub fn set_log_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.log_url = input;
        self
    }
    /// <p>The URL to the logs for the execution step.</p>
    pub fn get_log_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.log_url
    }
    /// <p>The URL to the build artifact for the execution step.</p>
    pub fn artifacts_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.artifacts_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL to the build artifact for the execution step.</p>
    pub fn set_artifacts_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.artifacts_url = input;
        self
    }
    /// <p>The URL to the build artifact for the execution step.</p>
    pub fn get_artifacts_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.artifacts_url
    }
    /// <p>The URL to the test artifact for the execution step.</p>
    pub fn test_artifacts_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.test_artifacts_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL to the test artifact for the execution step.</p>
    pub fn set_test_artifacts_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.test_artifacts_url = input;
        self
    }
    /// <p>The URL to the test artifact for the execution step.</p>
    pub fn get_test_artifacts_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.test_artifacts_url
    }
    /// <p>The URL to the test configuration for the execution step.</p>
    pub fn test_config_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.test_config_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL to the test configuration for the execution step.</p>
    pub fn set_test_config_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.test_config_url = input;
        self
    }
    /// <p>The URL to the test configuration for the execution step.</p>
    pub fn get_test_config_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.test_config_url
    }
    /// Adds a key-value pair to `screenshots`.
    ///
    /// To override the contents of this collection use [`set_screenshots`](Self::set_screenshots).
    ///
    /// <p>The list of screenshot URLs for the execution step, if relevant.</p>
    pub fn screenshots(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.screenshots.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.screenshots = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The list of screenshot URLs for the execution step, if relevant.</p>
    pub fn set_screenshots(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.screenshots = input;
        self
    }
    /// <p>The list of screenshot URLs for the execution step, if relevant.</p>
    pub fn get_screenshots(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.screenshots
    }
    /// <p>The reason for the current step status.</p>
    pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason for the current step status.</p>
    pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_reason = input;
        self
    }
    /// <p>The reason for the current step status.</p>
    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_reason
    }
    /// <p>The context for the current step. Includes a build image if the step is build.</p>
    pub fn context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.context = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The context for the current step. Includes a build image if the step is build.</p>
    pub fn set_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.context = input;
        self
    }
    /// <p>The context for the current step. Includes a build image if the step is build.</p>
    pub fn get_context(&self) -> &::std::option::Option<::std::string::String> {
        &self.context
    }
    /// Consumes the builder and constructs a [`Step`](crate::types::Step).
    /// This method will fail if any of the following fields are not set:
    /// - [`step_name`](crate::types::builders::StepBuilder::step_name)
    /// - [`start_time`](crate::types::builders::StepBuilder::start_time)
    /// - [`status`](crate::types::builders::StepBuilder::status)
    /// - [`end_time`](crate::types::builders::StepBuilder::end_time)
    pub fn build(self) -> ::std::result::Result<crate::types::Step, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Step {
            step_name: self.step_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "step_name",
                    "step_name was not specified but it is required when building Step",
                )
            })?,
            start_time: self.start_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "start_time",
                    "start_time was not specified but it is required when building Step",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building Step",
                )
            })?,
            end_time: self.end_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "end_time",
                    "end_time was not specified but it is required when building Step",
                )
            })?,
            log_url: self.log_url,
            artifacts_url: self.artifacts_url,
            test_artifacts_url: self.test_artifacts_url,
            test_config_url: self.test_config_url,
            screenshots: self.screenshots,
            status_reason: self.status_reason,
            context: self.context,
        })
    }
}