aws_sdk_ecs/operation/stop_task/_stop_task_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
// 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 StopTaskInput {
/// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to stop. If you do not specify a cluster, the default cluster is assumed.</p>
pub cluster: ::std::option::Option<::std::string::String>,
/// <p>The task ID of the task to stop.</p>
pub task: ::std::option::Option<::std::string::String>,
/// <p>An optional message specified when a task is stopped. For example, if you're using a custom scheduler, you can use this parameter to specify the reason for stopping the task here, and the message appears in subsequent <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html">DescribeTasks</a>> API operations on this task.</p>
pub reason: ::std::option::Option<::std::string::String>,
}
impl StopTaskInput {
/// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to stop. 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 task ID of the task to stop.</p>
pub fn task(&self) -> ::std::option::Option<&str> {
self.task.as_deref()
}
/// <p>An optional message specified when a task is stopped. For example, if you're using a custom scheduler, you can use this parameter to specify the reason for stopping the task here, and the message appears in subsequent <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html">DescribeTasks</a>> API operations on this task.</p>
pub fn reason(&self) -> ::std::option::Option<&str> {
self.reason.as_deref()
}
}
impl StopTaskInput {
/// Creates a new builder-style object to manufacture [`StopTaskInput`](crate::operation::stop_task::StopTaskInput).
pub fn builder() -> crate::operation::stop_task::builders::StopTaskInputBuilder {
crate::operation::stop_task::builders::StopTaskInputBuilder::default()
}
}
/// A builder for [`StopTaskInput`](crate::operation::stop_task::StopTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StopTaskInputBuilder {
pub(crate) cluster: ::std::option::Option<::std::string::String>,
pub(crate) task: ::std::option::Option<::std::string::String>,
pub(crate) reason: ::std::option::Option<::std::string::String>,
}
impl StopTaskInputBuilder {
/// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to stop. 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 short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to stop. 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 short name or full Amazon Resource Name (ARN) of the cluster that hosts the task to stop. 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 task ID of the task to stop.</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 task ID of the task to stop.</p>
pub fn set_task(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.task = input;
self
}
/// <p>The task ID of the task to stop.</p>
pub fn get_task(&self) -> &::std::option::Option<::std::string::String> {
&self.task
}
/// <p>An optional message specified when a task is stopped. For example, if you're using a custom scheduler, you can use this parameter to specify the reason for stopping the task here, and the message appears in subsequent <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html">DescribeTasks</a>> API operations on this task.</p>
pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reason = ::std::option::Option::Some(input.into());
self
}
/// <p>An optional message specified when a task is stopped. For example, if you're using a custom scheduler, you can use this parameter to specify the reason for stopping the task here, and the message appears in subsequent <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html">DescribeTasks</a>> API operations on this task.</p>
pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reason = input;
self
}
/// <p>An optional message specified when a task is stopped. For example, if you're using a custom scheduler, you can use this parameter to specify the reason for stopping the task here, and the message appears in subsequent <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html">DescribeTasks</a>> API operations on this task.</p>
pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.reason
}
/// Consumes the builder and constructs a [`StopTaskInput`](crate::operation::stop_task::StopTaskInput).
pub fn build(self) -> ::std::result::Result<crate::operation::stop_task::StopTaskInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::stop_task::StopTaskInput {
cluster: self.cluster,
task: self.task,
reason: self.reason,
})
}
}