aws_sdk_deadline/operation/get_task/
_get_task_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetTaskOutput {
6    /// <p>The task ID.</p>
7    pub task_id: ::std::string::String,
8    /// <p>The date and time the resource was created.</p>
9    pub created_at: ::aws_smithy_types::DateTime,
10    /// <p>The user or system that created this resource.</p>
11    pub created_by: ::std::string::String,
12    /// <p>The run status for the task.</p>
13    pub run_status: crate::types::TaskRunStatus,
14    /// <p>The run status with which to start the task.</p>
15    pub target_run_status: ::std::option::Option<crate::types::TaskTargetRunStatus>,
16    /// <p>The number of times that the task failed and was retried.</p>
17    pub failure_retry_count: ::std::option::Option<i32>,
18    /// <p>The parameters for the task.</p>
19    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TaskParameterValue>>,
20    /// <p>The date and time the resource started running.</p>
21    pub started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
22    /// <p>The date and time the resource ended running.</p>
23    pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24    /// <p>The date and time the resource was updated.</p>
25    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
26    /// <p>The user or system that updated this resource.</p>
27    pub updated_by: ::std::option::Option<::std::string::String>,
28    /// <p>The latest session ID for the task.</p>
29    pub latest_session_action_id: ::std::option::Option<::std::string::String>,
30    _request_id: Option<String>,
31}
32impl GetTaskOutput {
33    /// <p>The task ID.</p>
34    pub fn task_id(&self) -> &str {
35        use std::ops::Deref;
36        self.task_id.deref()
37    }
38    /// <p>The date and time the resource was created.</p>
39    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
40        &self.created_at
41    }
42    /// <p>The user or system that created this resource.</p>
43    pub fn created_by(&self) -> &str {
44        use std::ops::Deref;
45        self.created_by.deref()
46    }
47    /// <p>The run status for the task.</p>
48    pub fn run_status(&self) -> &crate::types::TaskRunStatus {
49        &self.run_status
50    }
51    /// <p>The run status with which to start the task.</p>
52    pub fn target_run_status(&self) -> ::std::option::Option<&crate::types::TaskTargetRunStatus> {
53        self.target_run_status.as_ref()
54    }
55    /// <p>The number of times that the task failed and was retried.</p>
56    pub fn failure_retry_count(&self) -> ::std::option::Option<i32> {
57        self.failure_retry_count
58    }
59    /// <p>The parameters for the task.</p>
60    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::TaskParameterValue>> {
61        self.parameters.as_ref()
62    }
63    /// <p>The date and time the resource started running.</p>
64    pub fn started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
65        self.started_at.as_ref()
66    }
67    /// <p>The date and time the resource ended running.</p>
68    pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
69        self.ended_at.as_ref()
70    }
71    /// <p>The date and time the resource was updated.</p>
72    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
73        self.updated_at.as_ref()
74    }
75    /// <p>The user or system that updated this resource.</p>
76    pub fn updated_by(&self) -> ::std::option::Option<&str> {
77        self.updated_by.as_deref()
78    }
79    /// <p>The latest session ID for the task.</p>
80    pub fn latest_session_action_id(&self) -> ::std::option::Option<&str> {
81        self.latest_session_action_id.as_deref()
82    }
83}
84impl ::std::fmt::Debug for GetTaskOutput {
85    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
86        let mut formatter = f.debug_struct("GetTaskOutput");
87        formatter.field("task_id", &self.task_id);
88        formatter.field("created_at", &self.created_at);
89        formatter.field("created_by", &self.created_by);
90        formatter.field("run_status", &self.run_status);
91        formatter.field("target_run_status", &self.target_run_status);
92        formatter.field("failure_retry_count", &self.failure_retry_count);
93        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
94        formatter.field("started_at", &self.started_at);
95        formatter.field("ended_at", &self.ended_at);
96        formatter.field("updated_at", &self.updated_at);
97        formatter.field("updated_by", &self.updated_by);
98        formatter.field("latest_session_action_id", &self.latest_session_action_id);
99        formatter.field("_request_id", &self._request_id);
100        formatter.finish()
101    }
102}
103impl ::aws_types::request_id::RequestId for GetTaskOutput {
104    fn request_id(&self) -> Option<&str> {
105        self._request_id.as_deref()
106    }
107}
108impl GetTaskOutput {
109    /// Creates a new builder-style object to manufacture [`GetTaskOutput`](crate::operation::get_task::GetTaskOutput).
110    pub fn builder() -> crate::operation::get_task::builders::GetTaskOutputBuilder {
111        crate::operation::get_task::builders::GetTaskOutputBuilder::default()
112    }
113}
114
115/// A builder for [`GetTaskOutput`](crate::operation::get_task::GetTaskOutput).
116#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
117#[non_exhaustive]
118pub struct GetTaskOutputBuilder {
119    pub(crate) task_id: ::std::option::Option<::std::string::String>,
120    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
121    pub(crate) created_by: ::std::option::Option<::std::string::String>,
122    pub(crate) run_status: ::std::option::Option<crate::types::TaskRunStatus>,
123    pub(crate) target_run_status: ::std::option::Option<crate::types::TaskTargetRunStatus>,
124    pub(crate) failure_retry_count: ::std::option::Option<i32>,
125    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TaskParameterValue>>,
126    pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
127    pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
128    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
129    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
130    pub(crate) latest_session_action_id: ::std::option::Option<::std::string::String>,
131    _request_id: Option<String>,
132}
133impl GetTaskOutputBuilder {
134    /// <p>The task ID.</p>
135    /// This field is required.
136    pub fn task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.task_id = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>The task ID.</p>
141    pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.task_id = input;
143        self
144    }
145    /// <p>The task ID.</p>
146    pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
147        &self.task_id
148    }
149    /// <p>The date and time the resource was created.</p>
150    /// This field is required.
151    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
152        self.created_at = ::std::option::Option::Some(input);
153        self
154    }
155    /// <p>The date and time the resource was created.</p>
156    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
157        self.created_at = input;
158        self
159    }
160    /// <p>The date and time the resource was created.</p>
161    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
162        &self.created_at
163    }
164    /// <p>The user or system that created this resource.</p>
165    /// This field is required.
166    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.created_by = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>The user or system that created this resource.</p>
171    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.created_by = input;
173        self
174    }
175    /// <p>The user or system that created this resource.</p>
176    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
177        &self.created_by
178    }
179    /// <p>The run status for the task.</p>
180    /// This field is required.
181    pub fn run_status(mut self, input: crate::types::TaskRunStatus) -> Self {
182        self.run_status = ::std::option::Option::Some(input);
183        self
184    }
185    /// <p>The run status for the task.</p>
186    pub fn set_run_status(mut self, input: ::std::option::Option<crate::types::TaskRunStatus>) -> Self {
187        self.run_status = input;
188        self
189    }
190    /// <p>The run status for the task.</p>
191    pub fn get_run_status(&self) -> &::std::option::Option<crate::types::TaskRunStatus> {
192        &self.run_status
193    }
194    /// <p>The run status with which to start the task.</p>
195    pub fn target_run_status(mut self, input: crate::types::TaskTargetRunStatus) -> Self {
196        self.target_run_status = ::std::option::Option::Some(input);
197        self
198    }
199    /// <p>The run status with which to start the task.</p>
200    pub fn set_target_run_status(mut self, input: ::std::option::Option<crate::types::TaskTargetRunStatus>) -> Self {
201        self.target_run_status = input;
202        self
203    }
204    /// <p>The run status with which to start the task.</p>
205    pub fn get_target_run_status(&self) -> &::std::option::Option<crate::types::TaskTargetRunStatus> {
206        &self.target_run_status
207    }
208    /// <p>The number of times that the task failed and was retried.</p>
209    pub fn failure_retry_count(mut self, input: i32) -> Self {
210        self.failure_retry_count = ::std::option::Option::Some(input);
211        self
212    }
213    /// <p>The number of times that the task failed and was retried.</p>
214    pub fn set_failure_retry_count(mut self, input: ::std::option::Option<i32>) -> Self {
215        self.failure_retry_count = input;
216        self
217    }
218    /// <p>The number of times that the task failed and was retried.</p>
219    pub fn get_failure_retry_count(&self) -> &::std::option::Option<i32> {
220        &self.failure_retry_count
221    }
222    /// Adds a key-value pair to `parameters`.
223    ///
224    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
225    ///
226    /// <p>The parameters for the task.</p>
227    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TaskParameterValue) -> Self {
228        let mut hash_map = self.parameters.unwrap_or_default();
229        hash_map.insert(k.into(), v);
230        self.parameters = ::std::option::Option::Some(hash_map);
231        self
232    }
233    /// <p>The parameters for the task.</p>
234    pub fn set_parameters(
235        mut self,
236        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TaskParameterValue>>,
237    ) -> Self {
238        self.parameters = input;
239        self
240    }
241    /// <p>The parameters for the task.</p>
242    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TaskParameterValue>> {
243        &self.parameters
244    }
245    /// <p>The date and time the resource started running.</p>
246    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
247        self.started_at = ::std::option::Option::Some(input);
248        self
249    }
250    /// <p>The date and time the resource started running.</p>
251    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
252        self.started_at = input;
253        self
254    }
255    /// <p>The date and time the resource started running.</p>
256    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
257        &self.started_at
258    }
259    /// <p>The date and time the resource ended running.</p>
260    pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
261        self.ended_at = ::std::option::Option::Some(input);
262        self
263    }
264    /// <p>The date and time the resource ended running.</p>
265    pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
266        self.ended_at = input;
267        self
268    }
269    /// <p>The date and time the resource ended running.</p>
270    pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
271        &self.ended_at
272    }
273    /// <p>The date and time the resource was updated.</p>
274    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
275        self.updated_at = ::std::option::Option::Some(input);
276        self
277    }
278    /// <p>The date and time the resource was updated.</p>
279    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
280        self.updated_at = input;
281        self
282    }
283    /// <p>The date and time the resource was updated.</p>
284    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
285        &self.updated_at
286    }
287    /// <p>The user or system that updated this resource.</p>
288    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289        self.updated_by = ::std::option::Option::Some(input.into());
290        self
291    }
292    /// <p>The user or system that updated this resource.</p>
293    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294        self.updated_by = input;
295        self
296    }
297    /// <p>The user or system that updated this resource.</p>
298    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
299        &self.updated_by
300    }
301    /// <p>The latest session ID for the task.</p>
302    pub fn latest_session_action_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
303        self.latest_session_action_id = ::std::option::Option::Some(input.into());
304        self
305    }
306    /// <p>The latest session ID for the task.</p>
307    pub fn set_latest_session_action_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
308        self.latest_session_action_id = input;
309        self
310    }
311    /// <p>The latest session ID for the task.</p>
312    pub fn get_latest_session_action_id(&self) -> &::std::option::Option<::std::string::String> {
313        &self.latest_session_action_id
314    }
315    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
316        self._request_id = Some(request_id.into());
317        self
318    }
319
320    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
321        self._request_id = request_id;
322        self
323    }
324    /// Consumes the builder and constructs a [`GetTaskOutput`](crate::operation::get_task::GetTaskOutput).
325    /// This method will fail if any of the following fields are not set:
326    /// - [`task_id`](crate::operation::get_task::builders::GetTaskOutputBuilder::task_id)
327    /// - [`created_at`](crate::operation::get_task::builders::GetTaskOutputBuilder::created_at)
328    /// - [`created_by`](crate::operation::get_task::builders::GetTaskOutputBuilder::created_by)
329    /// - [`run_status`](crate::operation::get_task::builders::GetTaskOutputBuilder::run_status)
330    pub fn build(self) -> ::std::result::Result<crate::operation::get_task::GetTaskOutput, ::aws_smithy_types::error::operation::BuildError> {
331        ::std::result::Result::Ok(crate::operation::get_task::GetTaskOutput {
332            task_id: self.task_id.ok_or_else(|| {
333                ::aws_smithy_types::error::operation::BuildError::missing_field(
334                    "task_id",
335                    "task_id was not specified but it is required when building GetTaskOutput",
336                )
337            })?,
338            created_at: self.created_at.ok_or_else(|| {
339                ::aws_smithy_types::error::operation::BuildError::missing_field(
340                    "created_at",
341                    "created_at was not specified but it is required when building GetTaskOutput",
342                )
343            })?,
344            created_by: self.created_by.ok_or_else(|| {
345                ::aws_smithy_types::error::operation::BuildError::missing_field(
346                    "created_by",
347                    "created_by was not specified but it is required when building GetTaskOutput",
348                )
349            })?,
350            run_status: self.run_status.ok_or_else(|| {
351                ::aws_smithy_types::error::operation::BuildError::missing_field(
352                    "run_status",
353                    "run_status was not specified but it is required when building GetTaskOutput",
354                )
355            })?,
356            target_run_status: self.target_run_status,
357            failure_retry_count: self.failure_retry_count,
358            parameters: self.parameters,
359            started_at: self.started_at,
360            ended_at: self.ended_at,
361            updated_at: self.updated_at,
362            updated_by: self.updated_by,
363            latest_session_action_id: self.latest_session_action_id,
364            _request_id: self._request_id,
365        })
366    }
367}
368impl ::std::fmt::Debug for GetTaskOutputBuilder {
369    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
370        let mut formatter = f.debug_struct("GetTaskOutputBuilder");
371        formatter.field("task_id", &self.task_id);
372        formatter.field("created_at", &self.created_at);
373        formatter.field("created_by", &self.created_by);
374        formatter.field("run_status", &self.run_status);
375        formatter.field("target_run_status", &self.target_run_status);
376        formatter.field("failure_retry_count", &self.failure_retry_count);
377        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
378        formatter.field("started_at", &self.started_at);
379        formatter.field("ended_at", &self.ended_at);
380        formatter.field("updated_at", &self.updated_at);
381        formatter.field("updated_by", &self.updated_by);
382        formatter.field("latest_session_action_id", &self.latest_session_action_id);
383        formatter.field("_request_id", &self._request_id);
384        formatter.finish()
385    }
386}