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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Information about an async job tracked by the service. GetJob returns the full `Job`, which may grow detail-only fields that are not part of the `JobSummary` list view.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetJobOutput {
/// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
pub job_id: ::std::string::String,
/// <p>The current lifecycle status of the job.</p>
pub status: crate::types::JobStatus,
/// <p>The type of mutating operation that created the job.</p>
pub operation_type: ::std::string::String,
/// <p>The time when the resource was created, in Unix epoch time.</p>
pub created_at: ::aws_smithy_types::DateTime,
/// <p>The time when the resource was last updated, in Unix epoch time.</p>
pub updated_at: ::aws_smithy_types::DateTime,
/// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
pub brand_profile_id: ::std::option::Option<::std::string::String>,
/// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
pub error_code: ::std::option::Option<::std::string::String>,
/// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
pub error_message: ::std::option::Option<::std::string::String>,
/// <p>The resources that were created or updated by the job.</p>
pub resources: ::std::option::Option<::std::vec::Vec<crate::types::JobResource>>,
_request_id: Option<String>,
}
impl GetJobOutput {
/// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
pub fn job_id(&self) -> &str {
use std::ops::Deref;
self.job_id.deref()
}
/// <p>The current lifecycle status of the job.</p>
pub fn status(&self) -> &crate::types::JobStatus {
&self.status
}
/// <p>The type of mutating operation that created the job.</p>
pub fn operation_type(&self) -> &str {
use std::ops::Deref;
self.operation_type.deref()
}
/// <p>The time when the resource was created, in Unix epoch time.</p>
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
/// <p>The time when the resource was last updated, in Unix epoch time.</p>
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
/// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
pub fn brand_profile_id(&self) -> ::std::option::Option<&str> {
self.brand_profile_id.as_deref()
}
/// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
pub fn error_code(&self) -> ::std::option::Option<&str> {
self.error_code.as_deref()
}
/// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
pub fn error_message(&self) -> ::std::option::Option<&str> {
self.error_message.as_deref()
}
/// <p>The resources that were created or updated by the job.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`.
pub fn resources(&self) -> &[crate::types::JobResource] {
self.resources.as_deref().unwrap_or_default()
}
}
impl ::aws_types::request_id::RequestId for GetJobOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetJobOutput {
/// Creates a new builder-style object to manufacture [`GetJobOutput`](crate::operation::get_job::GetJobOutput).
pub fn builder() -> crate::operation::get_job::builders::GetJobOutputBuilder {
crate::operation::get_job::builders::GetJobOutputBuilder::default()
}
}
/// A builder for [`GetJobOutput`](crate::operation::get_job::GetJobOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetJobOutputBuilder {
pub(crate) job_id: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::JobStatus>,
pub(crate) operation_type: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) brand_profile_id: ::std::option::Option<::std::string::String>,
pub(crate) error_code: ::std::option::Option<::std::string::String>,
pub(crate) error_message: ::std::option::Option<::std::string::String>,
pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::JobResource>>,
_request_id: Option<String>,
}
impl GetJobOutputBuilder {
/// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
/// This field is required.
pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.job_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.job_id = input;
self
}
/// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
&self.job_id
}
/// <p>The current lifecycle status of the job.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::JobStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The current lifecycle status of the job.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
self.status = input;
self
}
/// <p>The current lifecycle status of the job.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
&self.status
}
/// <p>The type of mutating operation that created the job.</p>
/// This field is required.
pub fn operation_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.operation_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of mutating operation that created the job.</p>
pub fn set_operation_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.operation_type = input;
self
}
/// <p>The type of mutating operation that created the job.</p>
pub fn get_operation_type(&self) -> &::std::option::Option<::std::string::String> {
&self.operation_type
}
/// <p>The time when the resource was created, in Unix epoch time.</p>
/// 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
}
/// <p>The time when the resource was created, in Unix epoch time.</p>
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// <p>The time when the resource was created, in Unix epoch time.</p>
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// <p>The time when the resource was last updated, in Unix epoch time.</p>
/// 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
}
/// <p>The time when the resource was last updated, in Unix epoch time.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>The time when the resource was last updated, in Unix epoch time.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
pub fn brand_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.brand_profile_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
pub fn set_brand_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.brand_profile_id = input;
self
}
/// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
pub fn get_brand_profile_id(&self) -> &::std::option::Option<::std::string::String> {
&self.brand_profile_id
}
/// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
pub fn error_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.error_code = ::std::option::Option::Some(input.into());
self
}
/// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
pub fn set_error_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error_code = input;
self
}
/// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
pub fn get_error_code(&self) -> &::std::option::Option<::std::string::String> {
&self.error_code
}
/// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.error_message = ::std::option::Option::Some(input.into());
self
}
/// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error_message = input;
self
}
/// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
&self.error_message
}
/// Appends an item to `resources`.
///
/// To override the contents of this collection use [`set_resources`](Self::set_resources).
///
/// <p>The resources that were created or updated by the job.</p>
pub fn resources(mut self, input: crate::types::JobResource) -> Self {
let mut v = self.resources.unwrap_or_default();
v.push(input);
self.resources = ::std::option::Option::Some(v);
self
}
/// <p>The resources that were created or updated by the job.</p>
pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobResource>>) -> Self {
self.resources = input;
self
}
/// <p>The resources that were created or updated by the job.</p>
pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobResource>> {
&self.resources
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetJobOutput`](crate::operation::get_job::GetJobOutput).
/// This method will fail if any of the following fields are not set:
/// - [`job_id`](crate::operation::get_job::builders::GetJobOutputBuilder::job_id)
/// - [`status`](crate::operation::get_job::builders::GetJobOutputBuilder::status)
/// - [`operation_type`](crate::operation::get_job::builders::GetJobOutputBuilder::operation_type)
/// - [`created_at`](crate::operation::get_job::builders::GetJobOutputBuilder::created_at)
/// - [`updated_at`](crate::operation::get_job::builders::GetJobOutputBuilder::updated_at)
pub fn build(self) -> ::std::result::Result<crate::operation::get_job::GetJobOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_job::GetJobOutput {
job_id: self.job_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"job_id",
"job_id was not specified but it is required when building GetJobOutput",
)
})?,
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 GetJobOutput",
)
})?,
operation_type: self.operation_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"operation_type",
"operation_type was not specified but it is required when building GetJobOutput",
)
})?,
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 GetJobOutput",
)
})?,
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 GetJobOutput",
)
})?,
brand_profile_id: self.brand_profile_id,
error_code: self.error_code,
error_message: self.error_message,
resources: self.resources,
_request_id: self._request_id,
})
}
}