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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Progress information for a recommendation generation process.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Progress {
/// <p>The number of generation steps that have been completed.</p>
pub steps_completed: i32,
/// <p>The total number of steps in the generation process.</p>
pub total_steps: i32,
/// <p>The completion percentage of the generation process (0-100).</p>
pub completion_percentage: f64,
}
impl Progress {
/// <p>The number of generation steps that have been completed.</p>
pub fn steps_completed(&self) -> i32 {
self.steps_completed
}
/// <p>The total number of steps in the generation process.</p>
pub fn total_steps(&self) -> i32 {
self.total_steps
}
/// <p>The completion percentage of the generation process (0-100).</p>
pub fn completion_percentage(&self) -> f64 {
self.completion_percentage
}
}
impl Progress {
/// Creates a new builder-style object to manufacture [`Progress`](crate::types::Progress).
pub fn builder() -> crate::types::builders::ProgressBuilder {
crate::types::builders::ProgressBuilder::default()
}
}
/// A builder for [`Progress`](crate::types::Progress).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ProgressBuilder {
pub(crate) steps_completed: ::std::option::Option<i32>,
pub(crate) total_steps: ::std::option::Option<i32>,
pub(crate) completion_percentage: ::std::option::Option<f64>,
}
impl ProgressBuilder {
/// <p>The number of generation steps that have been completed.</p>
/// This field is required.
pub fn steps_completed(mut self, input: i32) -> Self {
self.steps_completed = ::std::option::Option::Some(input);
self
}
/// <p>The number of generation steps that have been completed.</p>
pub fn set_steps_completed(mut self, input: ::std::option::Option<i32>) -> Self {
self.steps_completed = input;
self
}
/// <p>The number of generation steps that have been completed.</p>
pub fn get_steps_completed(&self) -> &::std::option::Option<i32> {
&self.steps_completed
}
/// <p>The total number of steps in the generation process.</p>
/// This field is required.
pub fn total_steps(mut self, input: i32) -> Self {
self.total_steps = ::std::option::Option::Some(input);
self
}
/// <p>The total number of steps in the generation process.</p>
pub fn set_total_steps(mut self, input: ::std::option::Option<i32>) -> Self {
self.total_steps = input;
self
}
/// <p>The total number of steps in the generation process.</p>
pub fn get_total_steps(&self) -> &::std::option::Option<i32> {
&self.total_steps
}
/// <p>The completion percentage of the generation process (0-100).</p>
/// This field is required.
pub fn completion_percentage(mut self, input: f64) -> Self {
self.completion_percentage = ::std::option::Option::Some(input);
self
}
/// <p>The completion percentage of the generation process (0-100).</p>
pub fn set_completion_percentage(mut self, input: ::std::option::Option<f64>) -> Self {
self.completion_percentage = input;
self
}
/// <p>The completion percentage of the generation process (0-100).</p>
pub fn get_completion_percentage(&self) -> &::std::option::Option<f64> {
&self.completion_percentage
}
/// Consumes the builder and constructs a [`Progress`](crate::types::Progress).
/// This method will fail if any of the following fields are not set:
/// - [`steps_completed`](crate::types::builders::ProgressBuilder::steps_completed)
/// - [`total_steps`](crate::types::builders::ProgressBuilder::total_steps)
/// - [`completion_percentage`](crate::types::builders::ProgressBuilder::completion_percentage)
pub fn build(self) -> ::std::result::Result<crate::types::Progress, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Progress {
steps_completed: self.steps_completed.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"steps_completed",
"steps_completed was not specified but it is required when building Progress",
)
})?,
total_steps: self.total_steps.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"total_steps",
"total_steps was not specified but it is required when building Progress",
)
})?,
completion_percentage: self.completion_percentage.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"completion_percentage",
"completion_percentage was not specified but it is required when building Progress",
)
})?,
})
}
}