aws_sdk_ecs/operation/start_task/
_start_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 StartTaskOutput {
6    /// <p>A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.</p>
7    pub tasks: ::std::option::Option<::std::vec::Vec<crate::types::Task>>,
8    /// <p>Any failures associated with the call.</p>
9    pub failures: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>,
10    _request_id: Option<String>,
11}
12impl StartTaskOutput {
13    /// <p>A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.</p>
14    ///
15    /// 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()`.
16    pub fn tasks(&self) -> &[crate::types::Task] {
17        self.tasks.as_deref().unwrap_or_default()
18    }
19    /// <p>Any failures associated with the call.</p>
20    ///
21    /// 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()`.
22    pub fn failures(&self) -> &[crate::types::Failure] {
23        self.failures.as_deref().unwrap_or_default()
24    }
25}
26impl ::aws_types::request_id::RequestId for StartTaskOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl StartTaskOutput {
32    /// Creates a new builder-style object to manufacture [`StartTaskOutput`](crate::operation::start_task::StartTaskOutput).
33    pub fn builder() -> crate::operation::start_task::builders::StartTaskOutputBuilder {
34        crate::operation::start_task::builders::StartTaskOutputBuilder::default()
35    }
36}
37
38/// A builder for [`StartTaskOutput`](crate::operation::start_task::StartTaskOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct StartTaskOutputBuilder {
42    pub(crate) tasks: ::std::option::Option<::std::vec::Vec<crate::types::Task>>,
43    pub(crate) failures: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>,
44    _request_id: Option<String>,
45}
46impl StartTaskOutputBuilder {
47    /// Appends an item to `tasks`.
48    ///
49    /// To override the contents of this collection use [`set_tasks`](Self::set_tasks).
50    ///
51    /// <p>A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.</p>
52    pub fn tasks(mut self, input: crate::types::Task) -> Self {
53        let mut v = self.tasks.unwrap_or_default();
54        v.push(input);
55        self.tasks = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.</p>
59    pub fn set_tasks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Task>>) -> Self {
60        self.tasks = input;
61        self
62    }
63    /// <p>A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.</p>
64    pub fn get_tasks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Task>> {
65        &self.tasks
66    }
67    /// Appends an item to `failures`.
68    ///
69    /// To override the contents of this collection use [`set_failures`](Self::set_failures).
70    ///
71    /// <p>Any failures associated with the call.</p>
72    pub fn failures(mut self, input: crate::types::Failure) -> Self {
73        let mut v = self.failures.unwrap_or_default();
74        v.push(input);
75        self.failures = ::std::option::Option::Some(v);
76        self
77    }
78    /// <p>Any failures associated with the call.</p>
79    pub fn set_failures(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>) -> Self {
80        self.failures = input;
81        self
82    }
83    /// <p>Any failures associated with the call.</p>
84    pub fn get_failures(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Failure>> {
85        &self.failures
86    }
87    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
88        self._request_id = Some(request_id.into());
89        self
90    }
91
92    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
93        self._request_id = request_id;
94        self
95    }
96    /// Consumes the builder and constructs a [`StartTaskOutput`](crate::operation::start_task::StartTaskOutput).
97    pub fn build(self) -> crate::operation::start_task::StartTaskOutput {
98        crate::operation::start_task::StartTaskOutput {
99            tasks: self.tasks,
100            failures: self.failures,
101            _request_id: self._request_id,
102        }
103    }
104}