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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes an execution job for an Amplify app.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Job {
/// <p>Describes the summary for an execution job for an Amplify app.</p>
pub summary: ::std::option::Option<crate::types::JobSummary>,
/// <p>The execution steps for an execution job, for an Amplify app.</p>
pub steps: ::std::vec::Vec<crate::types::Step>,
}
impl Job {
/// <p>Describes the summary for an execution job for an Amplify app.</p>
pub fn summary(&self) -> ::std::option::Option<&crate::types::JobSummary> {
self.summary.as_ref()
}
/// <p>The execution steps for an execution job, for an Amplify app.</p>
pub fn steps(&self) -> &[crate::types::Step] {
use std::ops::Deref;
self.steps.deref()
}
}
impl Job {
/// Creates a new builder-style object to manufacture [`Job`](crate::types::Job).
pub fn builder() -> crate::types::builders::JobBuilder {
crate::types::builders::JobBuilder::default()
}
}
/// A builder for [`Job`](crate::types::Job).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct JobBuilder {
pub(crate) summary: ::std::option::Option<crate::types::JobSummary>,
pub(crate) steps: ::std::option::Option<::std::vec::Vec<crate::types::Step>>,
}
impl JobBuilder {
/// <p>Describes the summary for an execution job for an Amplify app.</p>
/// This field is required.
pub fn summary(mut self, input: crate::types::JobSummary) -> Self {
self.summary = ::std::option::Option::Some(input);
self
}
/// <p>Describes the summary for an execution job for an Amplify app.</p>
pub fn set_summary(mut self, input: ::std::option::Option<crate::types::JobSummary>) -> Self {
self.summary = input;
self
}
/// <p>Describes the summary for an execution job for an Amplify app.</p>
pub fn get_summary(&self) -> &::std::option::Option<crate::types::JobSummary> {
&self.summary
}
/// Appends an item to `steps`.
///
/// To override the contents of this collection use [`set_steps`](Self::set_steps).
///
/// <p>The execution steps for an execution job, for an Amplify app.</p>
pub fn steps(mut self, input: crate::types::Step) -> Self {
let mut v = self.steps.unwrap_or_default();
v.push(input);
self.steps = ::std::option::Option::Some(v);
self
}
/// <p>The execution steps for an execution job, for an Amplify app.</p>
pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Step>>) -> Self {
self.steps = input;
self
}
/// <p>The execution steps for an execution job, for an Amplify app.</p>
pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Step>> {
&self.steps
}
/// Consumes the builder and constructs a [`Job`](crate::types::Job).
/// This method will fail if any of the following fields are not set:
/// - [`steps`](crate::types::builders::JobBuilder::steps)
pub fn build(self) -> ::std::result::Result<crate::types::Job, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Job {
summary: self.summary,
steps: self.steps.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"steps",
"steps was not specified but it is required when building Job",
)
})?,
})
}
}