aws_sdk_ecs/operation/execute_command/
_execute_command_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 ExecuteCommandOutput {
6    /// <p>The Amazon Resource Name (ARN) of the cluster.</p>
7    pub cluster_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) of the container.</p>
9    pub container_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the container.</p>
11    pub container_name: ::std::option::Option<::std::string::String>,
12    /// <p>Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify <code>true</code> for this value.</p>
13    pub interactive: bool,
14    /// <p>The details of the SSM session that was created for this instance of execute-command.</p>
15    pub session: ::std::option::Option<crate::types::Session>,
16    /// <p>The Amazon Resource Name (ARN) of the task.</p>
17    pub task_arn: ::std::option::Option<::std::string::String>,
18    _request_id: Option<String>,
19}
20impl ExecuteCommandOutput {
21    /// <p>The Amazon Resource Name (ARN) of the cluster.</p>
22    pub fn cluster_arn(&self) -> ::std::option::Option<&str> {
23        self.cluster_arn.as_deref()
24    }
25    /// <p>The Amazon Resource Name (ARN) of the container.</p>
26    pub fn container_arn(&self) -> ::std::option::Option<&str> {
27        self.container_arn.as_deref()
28    }
29    /// <p>The name of the container.</p>
30    pub fn container_name(&self) -> ::std::option::Option<&str> {
31        self.container_name.as_deref()
32    }
33    /// <p>Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify <code>true</code> for this value.</p>
34    pub fn interactive(&self) -> bool {
35        self.interactive
36    }
37    /// <p>The details of the SSM session that was created for this instance of execute-command.</p>
38    pub fn session(&self) -> ::std::option::Option<&crate::types::Session> {
39        self.session.as_ref()
40    }
41    /// <p>The Amazon Resource Name (ARN) of the task.</p>
42    pub fn task_arn(&self) -> ::std::option::Option<&str> {
43        self.task_arn.as_deref()
44    }
45}
46impl ::aws_types::request_id::RequestId for ExecuteCommandOutput {
47    fn request_id(&self) -> Option<&str> {
48        self._request_id.as_deref()
49    }
50}
51impl ExecuteCommandOutput {
52    /// Creates a new builder-style object to manufacture [`ExecuteCommandOutput`](crate::operation::execute_command::ExecuteCommandOutput).
53    pub fn builder() -> crate::operation::execute_command::builders::ExecuteCommandOutputBuilder {
54        crate::operation::execute_command::builders::ExecuteCommandOutputBuilder::default()
55    }
56}
57
58/// A builder for [`ExecuteCommandOutput`](crate::operation::execute_command::ExecuteCommandOutput).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct ExecuteCommandOutputBuilder {
62    pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
63    pub(crate) container_arn: ::std::option::Option<::std::string::String>,
64    pub(crate) container_name: ::std::option::Option<::std::string::String>,
65    pub(crate) interactive: ::std::option::Option<bool>,
66    pub(crate) session: ::std::option::Option<crate::types::Session>,
67    pub(crate) task_arn: ::std::option::Option<::std::string::String>,
68    _request_id: Option<String>,
69}
70impl ExecuteCommandOutputBuilder {
71    /// <p>The Amazon Resource Name (ARN) of the cluster.</p>
72    pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.cluster_arn = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The Amazon Resource Name (ARN) of the cluster.</p>
77    pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.cluster_arn = input;
79        self
80    }
81    /// <p>The Amazon Resource Name (ARN) of the cluster.</p>
82    pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
83        &self.cluster_arn
84    }
85    /// <p>The Amazon Resource Name (ARN) of the container.</p>
86    pub fn container_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.container_arn = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The Amazon Resource Name (ARN) of the container.</p>
91    pub fn set_container_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.container_arn = input;
93        self
94    }
95    /// <p>The Amazon Resource Name (ARN) of the container.</p>
96    pub fn get_container_arn(&self) -> &::std::option::Option<::std::string::String> {
97        &self.container_arn
98    }
99    /// <p>The name of the container.</p>
100    pub fn container_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.container_name = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The name of the container.</p>
105    pub fn set_container_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.container_name = input;
107        self
108    }
109    /// <p>The name of the container.</p>
110    pub fn get_container_name(&self) -> &::std::option::Option<::std::string::String> {
111        &self.container_name
112    }
113    /// <p>Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify <code>true</code> for this value.</p>
114    pub fn interactive(mut self, input: bool) -> Self {
115        self.interactive = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify <code>true</code> for this value.</p>
119    pub fn set_interactive(mut self, input: ::std::option::Option<bool>) -> Self {
120        self.interactive = input;
121        self
122    }
123    /// <p>Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify <code>true</code> for this value.</p>
124    pub fn get_interactive(&self) -> &::std::option::Option<bool> {
125        &self.interactive
126    }
127    /// <p>The details of the SSM session that was created for this instance of execute-command.</p>
128    pub fn session(mut self, input: crate::types::Session) -> Self {
129        self.session = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The details of the SSM session that was created for this instance of execute-command.</p>
133    pub fn set_session(mut self, input: ::std::option::Option<crate::types::Session>) -> Self {
134        self.session = input;
135        self
136    }
137    /// <p>The details of the SSM session that was created for this instance of execute-command.</p>
138    pub fn get_session(&self) -> &::std::option::Option<crate::types::Session> {
139        &self.session
140    }
141    /// <p>The Amazon Resource Name (ARN) of the task.</p>
142    pub fn task_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.task_arn = ::std::option::Option::Some(input.into());
144        self
145    }
146    /// <p>The Amazon Resource Name (ARN) of the task.</p>
147    pub fn set_task_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.task_arn = input;
149        self
150    }
151    /// <p>The Amazon Resource Name (ARN) of the task.</p>
152    pub fn get_task_arn(&self) -> &::std::option::Option<::std::string::String> {
153        &self.task_arn
154    }
155    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
156        self._request_id = Some(request_id.into());
157        self
158    }
159
160    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
161        self._request_id = request_id;
162        self
163    }
164    /// Consumes the builder and constructs a [`ExecuteCommandOutput`](crate::operation::execute_command::ExecuteCommandOutput).
165    pub fn build(self) -> crate::operation::execute_command::ExecuteCommandOutput {
166        crate::operation::execute_command::ExecuteCommandOutput {
167            cluster_arn: self.cluster_arn,
168            container_arn: self.container_arn,
169            container_name: self.container_name,
170            interactive: self.interactive.unwrap_or_default(),
171            session: self.session,
172            task_arn: self.task_arn,
173            _request_id: self._request_id,
174        }
175    }
176}