aws_sdk_ecs/operation/describe_tasks/_describe_tasks_input.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 DescribeTasksInput {
6 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed.</p>
7 pub cluster: ::std::option::Option<::std::string::String>,
8 /// <p>A list of up to 100 task IDs or full ARN entries.</p>
9 pub tasks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10 /// <p>Specifies whether you want to see the resource tags for the task. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>
11 pub include: ::std::option::Option<::std::vec::Vec<crate::types::TaskField>>,
12}
13impl DescribeTasksInput {
14 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed.</p>
15 pub fn cluster(&self) -> ::std::option::Option<&str> {
16 self.cluster.as_deref()
17 }
18 /// <p>A list of up to 100 task IDs or full ARN entries.</p>
19 ///
20 /// 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()`.
21 pub fn tasks(&self) -> &[::std::string::String] {
22 self.tasks.as_deref().unwrap_or_default()
23 }
24 /// <p>Specifies whether you want to see the resource tags for the task. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>
25 ///
26 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.include.is_none()`.
27 pub fn include(&self) -> &[crate::types::TaskField] {
28 self.include.as_deref().unwrap_or_default()
29 }
30}
31impl DescribeTasksInput {
32 /// Creates a new builder-style object to manufacture [`DescribeTasksInput`](crate::operation::describe_tasks::DescribeTasksInput).
33 pub fn builder() -> crate::operation::describe_tasks::builders::DescribeTasksInputBuilder {
34 crate::operation::describe_tasks::builders::DescribeTasksInputBuilder::default()
35 }
36}
37
38/// A builder for [`DescribeTasksInput`](crate::operation::describe_tasks::DescribeTasksInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct DescribeTasksInputBuilder {
42 pub(crate) cluster: ::std::option::Option<::std::string::String>,
43 pub(crate) tasks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
44 pub(crate) include: ::std::option::Option<::std::vec::Vec<crate::types::TaskField>>,
45}
46impl DescribeTasksInputBuilder {
47 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed.</p>
48 pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.cluster = ::std::option::Option::Some(input.into());
50 self
51 }
52 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed.</p>
53 pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.cluster = input;
55 self
56 }
57 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe. If you do not specify a cluster, the default cluster is assumed.</p>
58 pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
59 &self.cluster
60 }
61 /// Appends an item to `tasks`.
62 ///
63 /// To override the contents of this collection use [`set_tasks`](Self::set_tasks).
64 ///
65 /// <p>A list of up to 100 task IDs or full ARN entries.</p>
66 pub fn tasks(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut v = self.tasks.unwrap_or_default();
68 v.push(input.into());
69 self.tasks = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>A list of up to 100 task IDs or full ARN entries.</p>
73 pub fn set_tasks(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74 self.tasks = input;
75 self
76 }
77 /// <p>A list of up to 100 task IDs or full ARN entries.</p>
78 pub fn get_tasks(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79 &self.tasks
80 }
81 /// Appends an item to `include`.
82 ///
83 /// To override the contents of this collection use [`set_include`](Self::set_include).
84 ///
85 /// <p>Specifies whether you want to see the resource tags for the task. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>
86 pub fn include(mut self, input: crate::types::TaskField) -> Self {
87 let mut v = self.include.unwrap_or_default();
88 v.push(input);
89 self.include = ::std::option::Option::Some(v);
90 self
91 }
92 /// <p>Specifies whether you want to see the resource tags for the task. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>
93 pub fn set_include(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TaskField>>) -> Self {
94 self.include = input;
95 self
96 }
97 /// <p>Specifies whether you want to see the resource tags for the task. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</p>
98 pub fn get_include(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TaskField>> {
99 &self.include
100 }
101 /// Consumes the builder and constructs a [`DescribeTasksInput`](crate::operation::describe_tasks::DescribeTasksInput).
102 pub fn build(
103 self,
104 ) -> ::std::result::Result<crate::operation::describe_tasks::DescribeTasksInput, ::aws_smithy_types::error::operation::BuildError> {
105 ::std::result::Result::Ok(crate::operation::describe_tasks::DescribeTasksInput {
106 cluster: self.cluster,
107 tasks: self.tasks,
108 include: self.include,
109 })
110 }
111}