aws-sdk-devopsagent 1.4.0

AWS SDK for AWS DevOps Agent Service
Documentation
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Represents a backlog task with all its properties and metadata
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
    /// The unique identifier for the agent space containing this task
    pub agent_space_id: ::std::string::String,
    /// The unique identifier for this task
    pub task_id: ::std::string::String,
    /// The execution ID associated with this task, if any
    pub execution_id: ::std::option::Option<::std::string::String>,
    /// The title of the task
    pub title: ::std::string::String,
    /// Optional detailed description of the task
    pub description: ::std::option::Option<::std::string::String>,
    /// Optional reference information linking this task to external systems
    pub reference: ::std::option::Option<crate::types::ReferenceOutput>,
    /// The type of this task
    pub task_type: crate::types::TaskType,
    /// The priority level of this task
    pub priority: crate::types::Priority,
    /// The current status of this task
    pub status: crate::types::TaskStatus,
    /// Timestamp when this task was created
    pub created_at: ::aws_smithy_types::DateTime,
    /// Timestamp when this task was last updated
    pub updated_at: ::aws_smithy_types::DateTime,
    /// Version number for optimistic locking
    pub version: i32,
    /// Optional support metadata for the task
    pub support_metadata: ::std::option::Option<::aws_smithy_types::Document>,
    /// Optional metadata for the task
    pub metadata: ::std::option::Option<::aws_smithy_types::Document>,
    /// The task ID of the primary investigation this task is linked to
    pub primary_task_id: ::std::option::Option<::std::string::String>,
    /// Explanation for why the task status was changed (e.g., linked reason)
    pub status_reason: ::std::option::Option<::std::string::String>,
    /// Indicates if this task has other tasks linked to it
    pub has_linked_tasks: bool,
}
impl Task {
    /// The unique identifier for the agent space containing this task
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// The unique identifier for this task
    pub fn task_id(&self) -> &str {
        use std::ops::Deref;
        self.task_id.deref()
    }
    /// The execution ID associated with this task, if any
    pub fn execution_id(&self) -> ::std::option::Option<&str> {
        self.execution_id.as_deref()
    }
    /// The title of the task
    pub fn title(&self) -> &str {
        use std::ops::Deref;
        self.title.deref()
    }
    /// Optional detailed description of the task
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// Optional reference information linking this task to external systems
    pub fn reference(&self) -> ::std::option::Option<&crate::types::ReferenceOutput> {
        self.reference.as_ref()
    }
    /// The type of this task
    pub fn task_type(&self) -> &crate::types::TaskType {
        &self.task_type
    }
    /// The priority level of this task
    pub fn priority(&self) -> &crate::types::Priority {
        &self.priority
    }
    /// The current status of this task
    pub fn status(&self) -> &crate::types::TaskStatus {
        &self.status
    }
    /// Timestamp when this task was created
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// Timestamp when this task was last updated
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// Version number for optimistic locking
    pub fn version(&self) -> i32 {
        self.version
    }
    /// Optional support metadata for the task
    pub fn support_metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.support_metadata.as_ref()
    }
    /// Optional metadata for the task
    pub fn metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
        self.metadata.as_ref()
    }
    /// The task ID of the primary investigation this task is linked to
    pub fn primary_task_id(&self) -> ::std::option::Option<&str> {
        self.primary_task_id.as_deref()
    }
    /// Explanation for why the task status was changed (e.g., linked reason)
    pub fn status_reason(&self) -> ::std::option::Option<&str> {
        self.status_reason.as_deref()
    }
    /// Indicates if this task has other tasks linked to it
    pub fn has_linked_tasks(&self) -> bool {
        self.has_linked_tasks
    }
}
impl Task {
    /// Creates a new builder-style object to manufacture [`Task`](crate::types::Task).
    pub fn builder() -> crate::types::builders::TaskBuilder {
        crate::types::builders::TaskBuilder::default()
    }
}

/// A builder for [`Task`](crate::types::Task).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TaskBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) task_id: ::std::option::Option<::std::string::String>,
    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) reference: ::std::option::Option<crate::types::ReferenceOutput>,
    pub(crate) task_type: ::std::option::Option<crate::types::TaskType>,
    pub(crate) priority: ::std::option::Option<crate::types::Priority>,
    pub(crate) status: ::std::option::Option<crate::types::TaskStatus>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) version: ::std::option::Option<i32>,
    pub(crate) support_metadata: ::std::option::Option<::aws_smithy_types::Document>,
    pub(crate) metadata: ::std::option::Option<::aws_smithy_types::Document>,
    pub(crate) primary_task_id: ::std::option::Option<::std::string::String>,
    pub(crate) status_reason: ::std::option::Option<::std::string::String>,
    pub(crate) has_linked_tasks: ::std::option::Option<bool>,
}
impl TaskBuilder {
    /// The unique identifier for the agent space containing this task
    /// This field is required.
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier for the agent space containing this task
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// The unique identifier for the agent space containing this task
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// The unique identifier for this task
    /// This field is required.
    pub fn task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.task_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier for this task
    pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_id = input;
        self
    }
    /// The unique identifier for this task
    pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_id
    }
    /// The execution ID associated with this task, if any
    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The execution ID associated with this task, if any
    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_id = input;
        self
    }
    /// The execution ID associated with this task, if any
    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_id
    }
    /// The title of the task
    /// This field is required.
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// The title of the task
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// The title of the task
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// Optional detailed description of the task
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// Optional detailed description of the task
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// Optional detailed description of the task
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Optional reference information linking this task to external systems
    pub fn reference(mut self, input: crate::types::ReferenceOutput) -> Self {
        self.reference = ::std::option::Option::Some(input);
        self
    }
    /// Optional reference information linking this task to external systems
    pub fn set_reference(mut self, input: ::std::option::Option<crate::types::ReferenceOutput>) -> Self {
        self.reference = input;
        self
    }
    /// Optional reference information linking this task to external systems
    pub fn get_reference(&self) -> &::std::option::Option<crate::types::ReferenceOutput> {
        &self.reference
    }
    /// The type of this task
    /// This field is required.
    pub fn task_type(mut self, input: crate::types::TaskType) -> Self {
        self.task_type = ::std::option::Option::Some(input);
        self
    }
    /// The type of this task
    pub fn set_task_type(mut self, input: ::std::option::Option<crate::types::TaskType>) -> Self {
        self.task_type = input;
        self
    }
    /// The type of this task
    pub fn get_task_type(&self) -> &::std::option::Option<crate::types::TaskType> {
        &self.task_type
    }
    /// The priority level of this task
    /// This field is required.
    pub fn priority(mut self, input: crate::types::Priority) -> Self {
        self.priority = ::std::option::Option::Some(input);
        self
    }
    /// The priority level of this task
    pub fn set_priority(mut self, input: ::std::option::Option<crate::types::Priority>) -> Self {
        self.priority = input;
        self
    }
    /// The priority level of this task
    pub fn get_priority(&self) -> &::std::option::Option<crate::types::Priority> {
        &self.priority
    }
    /// The current status of this task
    /// This field is required.
    pub fn status(mut self, input: crate::types::TaskStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The current status of this task
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TaskStatus>) -> Self {
        self.status = input;
        self
    }
    /// The current status of this task
    pub fn get_status(&self) -> &::std::option::Option<crate::types::TaskStatus> {
        &self.status
    }
    /// Timestamp when this task was created
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when this task was created
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// Timestamp when this task was created
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Timestamp when this task was last updated
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when this task was last updated
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// Timestamp when this task was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Version number for optimistic locking
    /// This field is required.
    pub fn version(mut self, input: i32) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// Version number for optimistic locking
    pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
        self.version = input;
        self
    }
    /// Version number for optimistic locking
    pub fn get_version(&self) -> &::std::option::Option<i32> {
        &self.version
    }
    /// Optional support metadata for the task
    pub fn support_metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.support_metadata = ::std::option::Option::Some(input);
        self
    }
    /// Optional support metadata for the task
    pub fn set_support_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.support_metadata = input;
        self
    }
    /// Optional support metadata for the task
    pub fn get_support_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.support_metadata
    }
    /// Optional metadata for the task
    pub fn metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.metadata = ::std::option::Option::Some(input);
        self
    }
    /// Optional metadata for the task
    pub fn set_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.metadata = input;
        self
    }
    /// Optional metadata for the task
    pub fn get_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.metadata
    }
    /// The task ID of the primary investigation this task is linked to
    pub fn primary_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.primary_task_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The task ID of the primary investigation this task is linked to
    pub fn set_primary_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.primary_task_id = input;
        self
    }
    /// The task ID of the primary investigation this task is linked to
    pub fn get_primary_task_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.primary_task_id
    }
    /// Explanation for why the task status was changed (e.g., linked reason)
    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
    }
    /// Explanation for why the task status was changed (e.g., linked reason)
    pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_reason = input;
        self
    }
    /// Explanation for why the task status was changed (e.g., linked reason)
    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_reason
    }
    /// Indicates if this task has other tasks linked to it
    pub fn has_linked_tasks(mut self, input: bool) -> Self {
        self.has_linked_tasks = ::std::option::Option::Some(input);
        self
    }
    /// Indicates if this task has other tasks linked to it
    pub fn set_has_linked_tasks(mut self, input: ::std::option::Option<bool>) -> Self {
        self.has_linked_tasks = input;
        self
    }
    /// Indicates if this task has other tasks linked to it
    pub fn get_has_linked_tasks(&self) -> &::std::option::Option<bool> {
        &self.has_linked_tasks
    }
    /// Consumes the builder and constructs a [`Task`](crate::types::Task).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_space_id`](crate::types::builders::TaskBuilder::agent_space_id)
    /// - [`task_id`](crate::types::builders::TaskBuilder::task_id)
    /// - [`title`](crate::types::builders::TaskBuilder::title)
    /// - [`task_type`](crate::types::builders::TaskBuilder::task_type)
    /// - [`priority`](crate::types::builders::TaskBuilder::priority)
    /// - [`status`](crate::types::builders::TaskBuilder::status)
    /// - [`created_at`](crate::types::builders::TaskBuilder::created_at)
    /// - [`updated_at`](crate::types::builders::TaskBuilder::updated_at)
    /// - [`version`](crate::types::builders::TaskBuilder::version)
    pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Task {
            agent_space_id: self.agent_space_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_space_id",
                    "agent_space_id was not specified but it is required when building Task",
                )
            })?,
            task_id: self.task_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "task_id",
                    "task_id was not specified but it is required when building Task",
                )
            })?,
            execution_id: self.execution_id,
            title: self.title.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "title",
                    "title was not specified but it is required when building Task",
                )
            })?,
            description: self.description,
            reference: self.reference,
            task_type: self.task_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "task_type",
                    "task_type was not specified but it is required when building Task",
                )
            })?,
            priority: self.priority.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "priority",
                    "priority was not specified but it is required when building Task",
                )
            })?,
            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 Task",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building Task",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building Task",
                )
            })?,
            version: self.version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "version",
                    "version was not specified but it is required when building Task",
                )
            })?,
            support_metadata: self.support_metadata,
            metadata: self.metadata,
            primary_task_id: self.primary_task_id,
            status_reason: self.status_reason,
            has_linked_tasks: self.has_linked_tasks.unwrap_or_default(),
        })
    }
}