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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Task object encapsulating task information.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
/// <p>Status of the task - Not Started, In-Progress, Complete.</p>
pub status: crate::types::Status,
/// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
pub status_detail: ::std::option::Option<::std::string::String>,
/// <p>Indication of the percentage completion of the task.</p>
pub progress_percent: ::std::option::Option<i32>,
}
impl Task {
/// <p>Status of the task - Not Started, In-Progress, Complete.</p>
pub fn status(&self) -> &crate::types::Status {
&self.status
}
/// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
pub fn status_detail(&self) -> ::std::option::Option<&str> {
self.status_detail.as_deref()
}
/// <p>Indication of the percentage completion of the task.</p>
pub fn progress_percent(&self) -> ::std::option::Option<i32> {
self.progress_percent
}
}
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) status: ::std::option::Option<crate::types::Status>,
pub(crate) status_detail: ::std::option::Option<::std::string::String>,
pub(crate) progress_percent: ::std::option::Option<i32>,
}
impl TaskBuilder {
/// <p>Status of the task - Not Started, In-Progress, Complete.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::Status) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>Status of the task - Not Started, In-Progress, Complete.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
self.status = input;
self
}
/// <p>Status of the task - Not Started, In-Progress, Complete.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
&self.status
}
/// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
pub fn status_detail(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status_detail = ::std::option::Option::Some(input.into());
self
}
/// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
pub fn set_status_detail(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status_detail = input;
self
}
/// <p>Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.</p>
pub fn get_status_detail(&self) -> &::std::option::Option<::std::string::String> {
&self.status_detail
}
/// <p>Indication of the percentage completion of the task.</p>
pub fn progress_percent(mut self, input: i32) -> Self {
self.progress_percent = ::std::option::Option::Some(input);
self
}
/// <p>Indication of the percentage completion of the task.</p>
pub fn set_progress_percent(mut self, input: ::std::option::Option<i32>) -> Self {
self.progress_percent = input;
self
}
/// <p>Indication of the percentage completion of the task.</p>
pub fn get_progress_percent(&self) -> &::std::option::Option<i32> {
&self.progress_percent
}
/// Consumes the builder and constructs a [`Task`](crate::types::Task).
/// This method will fail if any of the following fields are not set:
/// - [`status`](crate::types::builders::TaskBuilder::status)
pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::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",
)
})?,
status_detail: self.status_detail,
progress_percent: self.progress_percent,
})
}
}