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>The response from the GetDurableExecution operation, containing detailed information about the durable execution.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetDurableExecutionOutput {
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    pub durable_execution_arn: ::std::string::String,
    /// <p>The name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided.</p>
    pub durable_execution_name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the Lambda function that was invoked to start this durable execution.</p>
    pub function_arn: ::std::string::String,
    /// <p>The JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.</p>
    pub input_payload: ::std::option::Option<::std::string::String>,
    /// <p>The JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is <code>SUCCEEDED</code>. The result is limited to 256 KB.</p>
    pub result: ::std::option::Option<::std::string::String>,
    /// <p>Error information if the durable execution failed. This field is only present when the execution status is <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>. The combined size of all error fields is limited to 256 KB.</p>
    pub error: ::std::option::Option<crate::types::ErrorObject>,
    /// <p>The date and time when the durable execution started, in Unix timestamp format.</p>
    pub start_timestamp: ::aws_smithy_types::DateTime,
    /// <p>The current status of the durable execution. Valid values are <code>RUNNING</code>, <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, and <code>STOPPED</code>.</p>
    pub status: crate::types::ExecutionStatus,
    /// <p>The date and time when the durable execution ended, in Unix timestamp format. This field is only present if the execution has completed (status is <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>).</p>
    pub end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version.</p>
    pub version: ::std::option::Option<::std::string::String>,
    /// <p>The trace headers associated with the durable execution.</p>
    pub trace_header: ::std::option::Option<crate::types::TraceHeader>,
    _request_id: Option<String>,
}
impl GetDurableExecutionOutput {
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    pub fn durable_execution_arn(&self) -> &str {
        use std::ops::Deref;
        self.durable_execution_arn.deref()
    }
    /// <p>The name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided.</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 that was invoked to start this durable execution.</p>
    pub fn function_arn(&self) -> &str {
        use std::ops::Deref;
        self.function_arn.deref()
    }
    /// <p>The JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.</p>
    pub fn input_payload(&self) -> ::std::option::Option<&str> {
        self.input_payload.as_deref()
    }
    /// <p>The JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is <code>SUCCEEDED</code>. The result is limited to 256 KB.</p>
    pub fn result(&self) -> ::std::option::Option<&str> {
        self.result.as_deref()
    }
    /// <p>Error information if the durable execution failed. This field is only present when the execution status is <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>. The combined size of all error fields is limited to 256 KB.</p>
    pub fn error(&self) -> ::std::option::Option<&crate::types::ErrorObject> {
        self.error.as_ref()
    }
    /// <p>The date and time when the durable execution started, in Unix timestamp format.</p>
    pub fn start_timestamp(&self) -> &::aws_smithy_types::DateTime {
        &self.start_timestamp
    }
    /// <p>The current status of the durable execution. Valid values are <code>RUNNING</code>, <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, and <code>STOPPED</code>.</p>
    pub fn status(&self) -> &crate::types::ExecutionStatus {
        &self.status
    }
    /// <p>The date and time when the durable execution ended, in Unix timestamp format. This field is only present if the execution has completed (status is <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>).</p>
    pub fn end_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_timestamp.as_ref()
    }
    /// <p>The version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version.</p>
    pub fn version(&self) -> ::std::option::Option<&str> {
        self.version.as_deref()
    }
    /// <p>The trace headers associated with the durable execution.</p>
    pub fn trace_header(&self) -> ::std::option::Option<&crate::types::TraceHeader> {
        self.trace_header.as_ref()
    }
}
impl ::std::fmt::Debug for GetDurableExecutionOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDurableExecutionOutput");
        formatter.field("durable_execution_arn", &self.durable_execution_arn);
        formatter.field("durable_execution_name", &self.durable_execution_name);
        formatter.field("function_arn", &self.function_arn);
        formatter.field("input_payload", &"*** Sensitive Data Redacted ***");
        formatter.field("result", &"*** Sensitive Data Redacted ***");
        formatter.field("error", &self.error);
        formatter.field("start_timestamp", &self.start_timestamp);
        formatter.field("status", &self.status);
        formatter.field("end_timestamp", &self.end_timestamp);
        formatter.field("version", &self.version);
        formatter.field("trace_header", &self.trace_header);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetDurableExecutionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetDurableExecutionOutput {
    /// Creates a new builder-style object to manufacture [`GetDurableExecutionOutput`](crate::operation::get_durable_execution::GetDurableExecutionOutput).
    pub fn builder() -> crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder {
        crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder::default()
    }
}

/// A builder for [`GetDurableExecutionOutput`](crate::operation::get_durable_execution::GetDurableExecutionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetDurableExecutionOutputBuilder {
    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) input_payload: ::std::option::Option<::std::string::String>,
    pub(crate) result: ::std::option::Option<::std::string::String>,
    pub(crate) error: ::std::option::Option<crate::types::ErrorObject>,
    pub(crate) start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) status: ::std::option::Option<crate::types::ExecutionStatus>,
    pub(crate) end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
    pub(crate) trace_header: ::std::option::Option<crate::types::TraceHeader>,
    _request_id: Option<String>,
}
impl GetDurableExecutionOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the 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.</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.</p>
    pub fn get_durable_execution_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.durable_execution_arn
    }
    /// <p>The name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided.</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 name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided.</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 name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided.</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 that was invoked to start this durable execution.</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 that was invoked to start this durable execution.</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 that was invoked to start this durable execution.</p>
    pub fn get_function_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.function_arn
    }
    /// <p>The JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.</p>
    pub fn input_payload(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.input_payload = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.</p>
    pub fn set_input_payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.input_payload = input;
        self
    }
    /// <p>The JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.</p>
    pub fn get_input_payload(&self) -> &::std::option::Option<::std::string::String> {
        &self.input_payload
    }
    /// <p>The JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is <code>SUCCEEDED</code>. The result is limited to 256 KB.</p>
    pub fn result(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.result = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is <code>SUCCEEDED</code>. The result is limited to 256 KB.</p>
    pub fn set_result(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.result = input;
        self
    }
    /// <p>The JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is <code>SUCCEEDED</code>. The result is limited to 256 KB.</p>
    pub fn get_result(&self) -> &::std::option::Option<::std::string::String> {
        &self.result
    }
    /// <p>Error information if the durable execution failed. This field is only present when the execution status is <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>. The combined size of all error fields is limited to 256 KB.</p>
    pub fn error(mut self, input: crate::types::ErrorObject) -> Self {
        self.error = ::std::option::Option::Some(input);
        self
    }
    /// <p>Error information if the durable execution failed. This field is only present when the execution status is <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>. The combined size of all error fields is limited to 256 KB.</p>
    pub fn set_error(mut self, input: ::std::option::Option<crate::types::ErrorObject>) -> Self {
        self.error = input;
        self
    }
    /// <p>Error information if the durable execution failed. This field is only present when the execution status is <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>. The combined size of all error fields is limited to 256 KB.</p>
    pub fn get_error(&self) -> &::std::option::Option<crate::types::ErrorObject> {
        &self.error
    }
    /// <p>The date and time when the durable execution started, in Unix timestamp format.</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 Unix timestamp format.</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 Unix timestamp format.</p>
    pub fn get_start_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_timestamp
    }
    /// <p>The current status of the durable execution. Valid values are <code>RUNNING</code>, <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, and <code>STOPPED</code>.</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. Valid values are <code>RUNNING</code>, <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, and <code>STOPPED</code>.</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. Valid values are <code>RUNNING</code>, <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, and <code>STOPPED</code>.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ExecutionStatus> {
        &self.status
    }
    /// <p>The date and time when the durable execution ended, in Unix timestamp format. This field is only present if the execution has completed (status is <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>).</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 Unix timestamp format. This field is only present if the execution has completed (status is <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>).</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 Unix timestamp format. This field is only present if the execution has completed (status is <code>SUCCEEDED</code>, <code>FAILED</code>, <code>TIMED_OUT</code>, or <code>STOPPED</code>).</p>
    pub fn get_end_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_timestamp
    }
    /// <p>The version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version.</p>
    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version.</p>
    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version = input;
        self
    }
    /// <p>The version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    /// <p>The trace headers associated with the durable execution.</p>
    pub fn trace_header(mut self, input: crate::types::TraceHeader) -> Self {
        self.trace_header = ::std::option::Option::Some(input);
        self
    }
    /// <p>The trace headers associated with the durable execution.</p>
    pub fn set_trace_header(mut self, input: ::std::option::Option<crate::types::TraceHeader>) -> Self {
        self.trace_header = input;
        self
    }
    /// <p>The trace headers associated with the durable execution.</p>
    pub fn get_trace_header(&self) -> &::std::option::Option<crate::types::TraceHeader> {
        &self.trace_header
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetDurableExecutionOutput`](crate::operation::get_durable_execution::GetDurableExecutionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`durable_execution_arn`](crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder::durable_execution_arn)
    /// - [`durable_execution_name`](crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder::durable_execution_name)
    /// - [`function_arn`](crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder::function_arn)
    /// - [`start_timestamp`](crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder::start_timestamp)
    /// - [`status`](crate::operation::get_durable_execution::builders::GetDurableExecutionOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_durable_execution::GetDurableExecutionOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_durable_execution::GetDurableExecutionOutput {
            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 GetDurableExecutionOutput",
                )
            })?,
            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 GetDurableExecutionOutput",
                )
            })?,
            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 GetDurableExecutionOutput",
                )
            })?,
            input_payload: self.input_payload,
            result: self.result,
            error: self.error,
            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 GetDurableExecutionOutput",
                )
            })?,
            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 GetDurableExecutionOutput",
                )
            })?,
            end_timestamp: self.end_timestamp,
            version: self.version,
            trace_header: self.trace_header,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetDurableExecutionOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDurableExecutionOutputBuilder");
        formatter.field("durable_execution_arn", &self.durable_execution_arn);
        formatter.field("durable_execution_name", &self.durable_execution_name);
        formatter.field("function_arn", &self.function_arn);
        formatter.field("input_payload", &"*** Sensitive Data Redacted ***");
        formatter.field("result", &"*** Sensitive Data Redacted ***");
        formatter.field("error", &self.error);
        formatter.field("start_timestamp", &self.start_timestamp);
        formatter.field("status", &self.status);
        formatter.field("end_timestamp", &self.end_timestamp);
        formatter.field("version", &self.version);
        formatter.field("trace_header", &self.trace_header);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}