aws-sdk-lambda 1.121.0

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

/// <p>Information about a <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html">durable execution</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Execution {
    /// <p>The Amazon Resource Name (ARN) of the durable execution, if this execution is a durable execution.</p>
    pub durable_execution_arn: ::std::string::String,
    /// <p>The unique name of the durable execution, if one was provided when the execution was started.</p>
    pub durable_execution_name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the Lambda function.</p>
    pub function_arn: ::std::string::String,
    /// <p>The current status of the durable execution.</p>
    pub status: crate::types::ExecutionStatus,
    /// <p>The date and time when the durable execution started, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub start_timestamp: ::aws_smithy_types::DateTime,
    /// <p>The date and time when the durable execution ended, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Execution {
    /// <p>The Amazon Resource Name (ARN) of the durable execution, if this execution is a durable execution.</p>
    pub fn durable_execution_arn(&self) -> &str {
        use std::ops::Deref;
        self.durable_execution_arn.deref()
    }
    /// <p>The unique name of the durable execution, if one was provided when the execution was started.</p>
    pub fn durable_execution_name(&self) -> &str {
        use std::ops::Deref;
        self.durable_execution_name.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the Lambda function.</p>
    pub fn function_arn(&self) -> &str {
        use std::ops::Deref;
        self.function_arn.deref()
    }
    /// <p>The current status of the durable execution.</p>
    pub fn status(&self) -> &crate::types::ExecutionStatus {
        &self.status
    }
    /// <p>The date and time when the durable execution started, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn start_timestamp(&self) -> &::aws_smithy_types::DateTime {
        &self.start_timestamp
    }
    /// <p>The date and time when the durable execution ended, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn end_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_timestamp.as_ref()
    }
}
impl Execution {
    /// Creates a new builder-style object to manufacture [`Execution`](crate::types::Execution).
    pub fn builder() -> crate::types::builders::ExecutionBuilder {
        crate::types::builders::ExecutionBuilder::default()
    }
}

/// A builder for [`Execution`](crate::types::Execution).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExecutionBuilder {
    pub(crate) durable_execution_arn: ::std::option::Option<::std::string::String>,
    pub(crate) durable_execution_name: ::std::option::Option<::std::string::String>,
    pub(crate) function_arn: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ExecutionStatus>,
    pub(crate) start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ExecutionBuilder {
    /// <p>The Amazon Resource Name (ARN) of the durable execution, if this execution is a durable execution.</p>
    /// This field is required.
    pub fn durable_execution_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.durable_execution_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the durable execution, if this execution is a durable execution.</p>
    pub fn set_durable_execution_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.durable_execution_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the durable execution, if this execution is a durable execution.</p>
    pub fn get_durable_execution_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.durable_execution_arn
    }
    /// <p>The unique name of the durable execution, if one was provided when the execution was started.</p>
    /// This field is required.
    pub fn durable_execution_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.durable_execution_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique name of the durable execution, if one was provided when the execution was started.</p>
    pub fn set_durable_execution_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.durable_execution_name = input;
        self
    }
    /// <p>The unique name of the durable execution, if one was provided when the execution was started.</p>
    pub fn get_durable_execution_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.durable_execution_name
    }
    /// <p>The Amazon Resource Name (ARN) of the Lambda function.</p>
    /// This field is required.
    pub fn function_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.function_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Lambda function.</p>
    pub fn set_function_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.function_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Lambda function.</p>
    pub fn get_function_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.function_arn
    }
    /// <p>The current status of the durable execution.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ExecutionStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the durable execution.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ExecutionStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the durable execution.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ExecutionStatus> {
        &self.status
    }
    /// <p>The date and time when the durable execution started, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    /// This field is required.
    pub fn start_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the durable execution started, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn set_start_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_timestamp = input;
        self
    }
    /// <p>The date and time when the durable execution started, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn get_start_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_timestamp
    }
    /// <p>The date and time when the durable execution ended, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn end_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the durable execution ended, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn set_end_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_timestamp = input;
        self
    }
    /// <p>The date and time when the durable execution ended, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
    pub fn get_end_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_timestamp
    }
    /// Consumes the builder and constructs a [`Execution`](crate::types::Execution).
    /// This method will fail if any of the following fields are not set:
    /// - [`durable_execution_arn`](crate::types::builders::ExecutionBuilder::durable_execution_arn)
    /// - [`durable_execution_name`](crate::types::builders::ExecutionBuilder::durable_execution_name)
    /// - [`function_arn`](crate::types::builders::ExecutionBuilder::function_arn)
    /// - [`status`](crate::types::builders::ExecutionBuilder::status)
    /// - [`start_timestamp`](crate::types::builders::ExecutionBuilder::start_timestamp)
    pub fn build(self) -> ::std::result::Result<crate::types::Execution, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Execution {
            durable_execution_arn: self.durable_execution_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "durable_execution_arn",
                    "durable_execution_arn was not specified but it is required when building Execution",
                )
            })?,
            durable_execution_name: self.durable_execution_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "durable_execution_name",
                    "durable_execution_name was not specified but it is required when building Execution",
                )
            })?,
            function_arn: self.function_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "function_arn",
                    "function_arn was not specified but it is required when building Execution",
                )
            })?,
            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 Execution",
                )
            })?,
            start_timestamp: self.start_timestamp.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "start_timestamp",
                    "start_timestamp was not specified but it is required when building Execution",
                )
            })?,
            end_timestamp: self.end_timestamp,
        })
    }
}