aws-sdk-ecs 1.128.0

AWS SDK for Amazon EC2 Container Service
Documentation
// 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,
        })
    }
}