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