1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// 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,
})
}
}