aws_sdk_ecs/operation/run_task/
_run_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, ::std::fmt::Debug)]
5pub struct RunTaskOutput {
6    /// <p>A full description of the tasks that were run. The tasks that were successfully placed on your cluster are described here.</p>
7    pub tasks: ::std::option::Option<::std::vec::Vec<crate::types::Task>>,
8    /// <p>Any failures associated with the call.</p>
9    /// <p>For information about how to address failures, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html#service-event-messages-list">Service event messages</a> and <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure reasons</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
10    pub failures: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>,
11    _request_id: Option<String>,
12}
13impl RunTaskOutput {
14    /// <p>A full description of the tasks that were run. The tasks that were successfully placed on your cluster are described here.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tasks.is_none()`.
17    pub fn tasks(&self) -> &[crate::types::Task] {
18        self.tasks.as_deref().unwrap_or_default()
19    }
20    /// <p>Any failures associated with the call.</p>
21    /// <p>For information about how to address failures, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html#service-event-messages-list">Service event messages</a> and <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure reasons</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failures.is_none()`.
24    pub fn failures(&self) -> &[crate::types::Failure] {
25        self.failures.as_deref().unwrap_or_default()
26    }
27}
28impl ::aws_types::request_id::RequestId for RunTaskOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl RunTaskOutput {
34    /// Creates a new builder-style object to manufacture [`RunTaskOutput`](crate::operation::run_task::RunTaskOutput).
35    pub fn builder() -> crate::operation::run_task::builders::RunTaskOutputBuilder {
36        crate::operation::run_task::builders::RunTaskOutputBuilder::default()
37    }
38}
39
40/// A builder for [`RunTaskOutput`](crate::operation::run_task::RunTaskOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct RunTaskOutputBuilder {
44    pub(crate) tasks: ::std::option::Option<::std::vec::Vec<crate::types::Task>>,
45    pub(crate) failures: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>,
46    _request_id: Option<String>,
47}
48impl RunTaskOutputBuilder {
49    /// Appends an item to `tasks`.
50    ///
51    /// To override the contents of this collection use [`set_tasks`](Self::set_tasks).
52    ///
53    /// <p>A full description of the tasks that were run. The tasks that were successfully placed on your cluster are described here.</p>
54    pub fn tasks(mut self, input: crate::types::Task) -> Self {
55        let mut v = self.tasks.unwrap_or_default();
56        v.push(input);
57        self.tasks = ::std::option::Option::Some(v);
58        self
59    }
60    /// <p>A full description of the tasks that were run. The tasks that were successfully placed on your cluster are described here.</p>
61    pub fn set_tasks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Task>>) -> Self {
62        self.tasks = input;
63        self
64    }
65    /// <p>A full description of the tasks that were run. The tasks that were successfully placed on your cluster are described here.</p>
66    pub fn get_tasks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Task>> {
67        &self.tasks
68    }
69    /// Appends an item to `failures`.
70    ///
71    /// To override the contents of this collection use [`set_failures`](Self::set_failures).
72    ///
73    /// <p>Any failures associated with the call.</p>
74    /// <p>For information about how to address failures, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html#service-event-messages-list">Service event messages</a> and <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure reasons</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
75    pub fn failures(mut self, input: crate::types::Failure) -> Self {
76        let mut v = self.failures.unwrap_or_default();
77        v.push(input);
78        self.failures = ::std::option::Option::Some(v);
79        self
80    }
81    /// <p>Any failures associated with the call.</p>
82    /// <p>For information about how to address failures, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html#service-event-messages-list">Service event messages</a> and <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure reasons</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
83    pub fn set_failures(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>) -> Self {
84        self.failures = input;
85        self
86    }
87    /// <p>Any failures associated with the call.</p>
88    /// <p>For information about how to address failures, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html#service-event-messages-list">Service event messages</a> and <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure reasons</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
89    pub fn get_failures(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Failure>> {
90        &self.failures
91    }
92    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93        self._request_id = Some(request_id.into());
94        self
95    }
96
97    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98        self._request_id = request_id;
99        self
100    }
101    /// Consumes the builder and constructs a [`RunTaskOutput`](crate::operation::run_task::RunTaskOutput).
102    pub fn build(self) -> crate::operation::run_task::RunTaskOutput {
103        crate::operation::run_task::RunTaskOutput {
104            tasks: self.tasks,
105            failures: self.failures,
106            _request_id: self._request_id,
107        }
108    }
109}