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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about an operation within a durable execution.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Operation {
/// <p>The unique identifier for this operation.</p>
pub id: ::std::string::String,
/// <p>The unique identifier of the parent operation, if this operation is running within a child context.</p>
pub parent_id: ::std::option::Option<::std::string::String>,
/// <p>The customer-provided name for this operation.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The type of operation.</p>
pub r#type: crate::types::OperationType,
/// <p>The subtype of the operation, providing additional categorization.</p>
pub sub_type: ::std::option::Option<::std::string::String>,
/// <p>The date and time when the operation 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 operation 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>,
/// <p>The current status of the operation.</p>
pub status: crate::types::OperationStatus,
/// <p>Details about the execution, if this operation represents an execution.</p>
pub execution_details: ::std::option::Option<crate::types::ExecutionDetails>,
/// <p>Details about the context, if this operation represents a context.</p>
pub context_details: ::std::option::Option<crate::types::ContextDetails>,
/// <p>Details about the step, if this operation represents a step.</p>
pub step_details: ::std::option::Option<crate::types::StepDetails>,
/// <p>Details about the wait operation, if this operation represents a wait.</p>
pub wait_details: ::std::option::Option<crate::types::WaitDetails>,
/// <p>Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.</p>
pub callback_details: ::std::option::Option<crate::types::CallbackDetails>,
/// <p>Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.</p>
pub chained_invoke_details: ::std::option::Option<crate::types::ChainedInvokeDetails>,
}
impl Operation {
/// <p>The unique identifier for this operation.</p>
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
/// <p>The unique identifier of the parent operation, if this operation is running within a child context.</p>
pub fn parent_id(&self) -> ::std::option::Option<&str> {
self.parent_id.as_deref()
}
/// <p>The customer-provided name for this operation.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The type of operation.</p>
pub fn r#type(&self) -> &crate::types::OperationType {
&self.r#type
}
/// <p>The subtype of the operation, providing additional categorization.</p>
pub fn sub_type(&self) -> ::std::option::Option<&str> {
self.sub_type.as_deref()
}
/// <p>The date and time when the operation 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 operation 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()
}
/// <p>The current status of the operation.</p>
pub fn status(&self) -> &crate::types::OperationStatus {
&self.status
}
/// <p>Details about the execution, if this operation represents an execution.</p>
pub fn execution_details(&self) -> ::std::option::Option<&crate::types::ExecutionDetails> {
self.execution_details.as_ref()
}
/// <p>Details about the context, if this operation represents a context.</p>
pub fn context_details(&self) -> ::std::option::Option<&crate::types::ContextDetails> {
self.context_details.as_ref()
}
/// <p>Details about the step, if this operation represents a step.</p>
pub fn step_details(&self) -> ::std::option::Option<&crate::types::StepDetails> {
self.step_details.as_ref()
}
/// <p>Details about the wait operation, if this operation represents a wait.</p>
pub fn wait_details(&self) -> ::std::option::Option<&crate::types::WaitDetails> {
self.wait_details.as_ref()
}
/// <p>Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.</p>
pub fn callback_details(&self) -> ::std::option::Option<&crate::types::CallbackDetails> {
self.callback_details.as_ref()
}
/// <p>Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.</p>
pub fn chained_invoke_details(&self) -> ::std::option::Option<&crate::types::ChainedInvokeDetails> {
self.chained_invoke_details.as_ref()
}
}
impl Operation {
/// Creates a new builder-style object to manufacture [`Operation`](crate::types::Operation).
pub fn builder() -> crate::types::builders::OperationBuilder {
crate::types::builders::OperationBuilder::default()
}
}
/// A builder for [`Operation`](crate::types::Operation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OperationBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) parent_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::OperationType>,
pub(crate) sub_type: ::std::option::Option<::std::string::String>,
pub(crate) start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) status: ::std::option::Option<crate::types::OperationStatus>,
pub(crate) execution_details: ::std::option::Option<crate::types::ExecutionDetails>,
pub(crate) context_details: ::std::option::Option<crate::types::ContextDetails>,
pub(crate) step_details: ::std::option::Option<crate::types::StepDetails>,
pub(crate) wait_details: ::std::option::Option<crate::types::WaitDetails>,
pub(crate) callback_details: ::std::option::Option<crate::types::CallbackDetails>,
pub(crate) chained_invoke_details: ::std::option::Option<crate::types::ChainedInvokeDetails>,
}
impl OperationBuilder {
/// <p>The unique identifier for this operation.</p>
/// This field is required.
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier for this operation.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The unique identifier for this operation.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The unique identifier of the parent operation, if this operation is running within a child context.</p>
pub fn parent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.parent_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the parent operation, if this operation is running within a child context.</p>
pub fn set_parent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.parent_id = input;
self
}
/// <p>The unique identifier of the parent operation, if this operation is running within a child context.</p>
pub fn get_parent_id(&self) -> &::std::option::Option<::std::string::String> {
&self.parent_id
}
/// <p>The customer-provided name for this operation.</p>
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 customer-provided name for this operation.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The customer-provided name for this operation.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The type of operation.</p>
/// This field is required.
pub fn r#type(mut self, input: crate::types::OperationType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The type of operation.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::OperationType>) -> Self {
self.r#type = input;
self
}
/// <p>The type of operation.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::OperationType> {
&self.r#type
}
/// <p>The subtype of the operation, providing additional categorization.</p>
pub fn sub_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sub_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The subtype of the operation, providing additional categorization.</p>
pub fn set_sub_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sub_type = input;
self
}
/// <p>The subtype of the operation, providing additional categorization.</p>
pub fn get_sub_type(&self) -> &::std::option::Option<::std::string::String> {
&self.sub_type
}
/// <p>The date and time when the operation 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 operation 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 operation 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 operation 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 operation 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 operation 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
}
/// <p>The current status of the operation.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::OperationStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the operation.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::OperationStatus>) -> Self {
self.status = input;
self
}
/// <p>The current status of the operation.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::OperationStatus> {
&self.status
}
/// <p>Details about the execution, if this operation represents an execution.</p>
pub fn execution_details(mut self, input: crate::types::ExecutionDetails) -> Self {
self.execution_details = ::std::option::Option::Some(input);
self
}
/// <p>Details about the execution, if this operation represents an execution.</p>
pub fn set_execution_details(mut self, input: ::std::option::Option<crate::types::ExecutionDetails>) -> Self {
self.execution_details = input;
self
}
/// <p>Details about the execution, if this operation represents an execution.</p>
pub fn get_execution_details(&self) -> &::std::option::Option<crate::types::ExecutionDetails> {
&self.execution_details
}
/// <p>Details about the context, if this operation represents a context.</p>
pub fn context_details(mut self, input: crate::types::ContextDetails) -> Self {
self.context_details = ::std::option::Option::Some(input);
self
}
/// <p>Details about the context, if this operation represents a context.</p>
pub fn set_context_details(mut self, input: ::std::option::Option<crate::types::ContextDetails>) -> Self {
self.context_details = input;
self
}
/// <p>Details about the context, if this operation represents a context.</p>
pub fn get_context_details(&self) -> &::std::option::Option<crate::types::ContextDetails> {
&self.context_details
}
/// <p>Details about the step, if this operation represents a step.</p>
pub fn step_details(mut self, input: crate::types::StepDetails) -> Self {
self.step_details = ::std::option::Option::Some(input);
self
}
/// <p>Details about the step, if this operation represents a step.</p>
pub fn set_step_details(mut self, input: ::std::option::Option<crate::types::StepDetails>) -> Self {
self.step_details = input;
self
}
/// <p>Details about the step, if this operation represents a step.</p>
pub fn get_step_details(&self) -> &::std::option::Option<crate::types::StepDetails> {
&self.step_details
}
/// <p>Details about the wait operation, if this operation represents a wait.</p>
pub fn wait_details(mut self, input: crate::types::WaitDetails) -> Self {
self.wait_details = ::std::option::Option::Some(input);
self
}
/// <p>Details about the wait operation, if this operation represents a wait.</p>
pub fn set_wait_details(mut self, input: ::std::option::Option<crate::types::WaitDetails>) -> Self {
self.wait_details = input;
self
}
/// <p>Details about the wait operation, if this operation represents a wait.</p>
pub fn get_wait_details(&self) -> &::std::option::Option<crate::types::WaitDetails> {
&self.wait_details
}
/// <p>Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.</p>
pub fn callback_details(mut self, input: crate::types::CallbackDetails) -> Self {
self.callback_details = ::std::option::Option::Some(input);
self
}
/// <p>Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.</p>
pub fn set_callback_details(mut self, input: ::std::option::Option<crate::types::CallbackDetails>) -> Self {
self.callback_details = input;
self
}
/// <p>Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.</p>
pub fn get_callback_details(&self) -> &::std::option::Option<crate::types::CallbackDetails> {
&self.callback_details
}
/// <p>Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.</p>
pub fn chained_invoke_details(mut self, input: crate::types::ChainedInvokeDetails) -> Self {
self.chained_invoke_details = ::std::option::Option::Some(input);
self
}
/// <p>Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.</p>
pub fn set_chained_invoke_details(mut self, input: ::std::option::Option<crate::types::ChainedInvokeDetails>) -> Self {
self.chained_invoke_details = input;
self
}
/// <p>Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.</p>
pub fn get_chained_invoke_details(&self) -> &::std::option::Option<crate::types::ChainedInvokeDetails> {
&self.chained_invoke_details
}
/// Consumes the builder and constructs a [`Operation`](crate::types::Operation).
/// This method will fail if any of the following fields are not set:
/// - [`id`](crate::types::builders::OperationBuilder::id)
/// - [`r#type`](crate::types::builders::OperationBuilder::type)
/// - [`start_timestamp`](crate::types::builders::OperationBuilder::start_timestamp)
/// - [`status`](crate::types::builders::OperationBuilder::status)
pub fn build(self) -> ::std::result::Result<crate::types::Operation, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Operation {
id: self.id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"id",
"id was not specified but it is required when building Operation",
)
})?,
parent_id: self.parent_id,
name: self.name,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Operation",
)
})?,
sub_type: self.sub_type,
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 Operation",
)
})?,
end_timestamp: self.end_timestamp,
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 Operation",
)
})?,
execution_details: self.execution_details,
context_details: self.context_details,
step_details: self.step_details,
wait_details: self.wait_details,
callback_details: self.callback_details,
chained_invoke_details: self.chained_invoke_details,
})
}
}