aws_sdk_ecs/operation/execute_command/
_execute_command_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 ExecuteCommandInput {
6    /// <p>The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.</p>
7    pub cluster: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.</p>
9    pub container: ::std::option::Option<::std::string::String>,
10    /// <p>The command to run on the container.</p>
11    pub command: ::std::option::Option<::std::string::String>,
12    /// <p>Use this flag to run your command in interactive mode.</p>
13    pub interactive: ::std::option::Option<bool>,
14    /// <p>The Amazon Resource Name (ARN) or ID of the task the container is part of.</p>
15    pub task: ::std::option::Option<::std::string::String>,
16}
17impl ExecuteCommandInput {
18    /// <p>The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.</p>
19    pub fn cluster(&self) -> ::std::option::Option<&str> {
20        self.cluster.as_deref()
21    }
22    /// <p>The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.</p>
23    pub fn container(&self) -> ::std::option::Option<&str> {
24        self.container.as_deref()
25    }
26    /// <p>The command to run on the container.</p>
27    pub fn command(&self) -> ::std::option::Option<&str> {
28        self.command.as_deref()
29    }
30    /// <p>Use this flag to run your command in interactive mode.</p>
31    pub fn interactive(&self) -> ::std::option::Option<bool> {
32        self.interactive
33    }
34    /// <p>The Amazon Resource Name (ARN) or ID of the task the container is part of.</p>
35    pub fn task(&self) -> ::std::option::Option<&str> {
36        self.task.as_deref()
37    }
38}
39impl ExecuteCommandInput {
40    /// Creates a new builder-style object to manufacture [`ExecuteCommandInput`](crate::operation::execute_command::ExecuteCommandInput).
41    pub fn builder() -> crate::operation::execute_command::builders::ExecuteCommandInputBuilder {
42        crate::operation::execute_command::builders::ExecuteCommandInputBuilder::default()
43    }
44}
45
46/// A builder for [`ExecuteCommandInput`](crate::operation::execute_command::ExecuteCommandInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct ExecuteCommandInputBuilder {
50    pub(crate) cluster: ::std::option::Option<::std::string::String>,
51    pub(crate) container: ::std::option::Option<::std::string::String>,
52    pub(crate) command: ::std::option::Option<::std::string::String>,
53    pub(crate) interactive: ::std::option::Option<bool>,
54    pub(crate) task: ::std::option::Option<::std::string::String>,
55}
56impl ExecuteCommandInputBuilder {
57    /// <p>The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.</p>
58    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.cluster = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.</p>
63    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.cluster = input;
65        self
66    }
67    /// <p>The Amazon Resource Name (ARN) or short name of the cluster the task is running in. If you do not specify a cluster, the default cluster is assumed.</p>
68    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
69        &self.cluster
70    }
71    /// <p>The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.</p>
72    pub fn container(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.container = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.</p>
77    pub fn set_container(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.container = input;
79        self
80    }
81    /// <p>The name of the container to execute the command on. A container name only needs to be specified for tasks containing multiple containers.</p>
82    pub fn get_container(&self) -> &::std::option::Option<::std::string::String> {
83        &self.container
84    }
85    /// <p>The command to run on the container.</p>
86    /// This field is required.
87    pub fn command(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.command = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The command to run on the container.</p>
92    pub fn set_command(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.command = input;
94        self
95    }
96    /// <p>The command to run on the container.</p>
97    pub fn get_command(&self) -> &::std::option::Option<::std::string::String> {
98        &self.command
99    }
100    /// <p>Use this flag to run your command in interactive mode.</p>
101    /// This field is required.
102    pub fn interactive(mut self, input: bool) -> Self {
103        self.interactive = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>Use this flag to run your command in interactive mode.</p>
107    pub fn set_interactive(mut self, input: ::std::option::Option<bool>) -> Self {
108        self.interactive = input;
109        self
110    }
111    /// <p>Use this flag to run your command in interactive mode.</p>
112    pub fn get_interactive(&self) -> &::std::option::Option<bool> {
113        &self.interactive
114    }
115    /// <p>The Amazon Resource Name (ARN) or ID of the task the container is part of.</p>
116    /// This field is required.
117    pub fn task(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.task = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The Amazon Resource Name (ARN) or ID of the task the container is part of.</p>
122    pub fn set_task(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.task = input;
124        self
125    }
126    /// <p>The Amazon Resource Name (ARN) or ID of the task the container is part of.</p>
127    pub fn get_task(&self) -> &::std::option::Option<::std::string::String> {
128        &self.task
129    }
130    /// Consumes the builder and constructs a [`ExecuteCommandInput`](crate::operation::execute_command::ExecuteCommandInput).
131    pub fn build(
132        self,
133    ) -> ::std::result::Result<crate::operation::execute_command::ExecuteCommandInput, ::aws_smithy_types::error::operation::BuildError> {
134        ::std::result::Result::Ok(crate::operation::execute_command::ExecuteCommandInput {
135            cluster: self.cluster,
136            container: self.container,
137            command: self.command,
138            interactive: self.interactive,
139            task: self.task,
140        })
141    }
142}