aws_sdk_ecs/operation/stop_task/_stop_task_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 StopTaskInput {
6 /// <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>
7 pub cluster: ::std::option::Option<::std::string::String>,
8 /// <p>Thefull Amazon Resource Name (ARN) of the task.</p>
9 pub task: ::std::option::Option<::std::string::String>,
10 /// <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>
11 pub reason: ::std::option::Option<::std::string::String>,
12}
13impl StopTaskInput {
14 /// <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>
15 pub fn cluster(&self) -> ::std::option::Option<&str> {
16 self.cluster.as_deref()
17 }
18 /// <p>Thefull Amazon Resource Name (ARN) of the task.</p>
19 pub fn task(&self) -> ::std::option::Option<&str> {
20 self.task.as_deref()
21 }
22 /// <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>
23 pub fn reason(&self) -> ::std::option::Option<&str> {
24 self.reason.as_deref()
25 }
26}
27impl StopTaskInput {
28 /// Creates a new builder-style object to manufacture [`StopTaskInput`](crate::operation::stop_task::StopTaskInput).
29 pub fn builder() -> crate::operation::stop_task::builders::StopTaskInputBuilder {
30 crate::operation::stop_task::builders::StopTaskInputBuilder::default()
31 }
32}
33
34/// A builder for [`StopTaskInput`](crate::operation::stop_task::StopTaskInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct StopTaskInputBuilder {
38 pub(crate) cluster: ::std::option::Option<::std::string::String>,
39 pub(crate) task: ::std::option::Option<::std::string::String>,
40 pub(crate) reason: ::std::option::Option<::std::string::String>,
41}
42impl StopTaskInputBuilder {
43 /// <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>
44 pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45 self.cluster = ::std::option::Option::Some(input.into());
46 self
47 }
48 /// <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>
49 pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50 self.cluster = input;
51 self
52 }
53 /// <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>
54 pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
55 &self.cluster
56 }
57 /// <p>Thefull Amazon Resource Name (ARN) of the task.</p>
58 /// This field is required.
59 pub fn task(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.task = ::std::option::Option::Some(input.into());
61 self
62 }
63 /// <p>Thefull Amazon Resource Name (ARN) of the task.</p>
64 pub fn set_task(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.task = input;
66 self
67 }
68 /// <p>Thefull Amazon Resource Name (ARN) of the task.</p>
69 pub fn get_task(&self) -> &::std::option::Option<::std::string::String> {
70 &self.task
71 }
72 /// <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>
73 pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.reason = ::std::option::Option::Some(input.into());
75 self
76 }
77 /// <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>
78 pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.reason = input;
80 self
81 }
82 /// <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>
83 pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
84 &self.reason
85 }
86 /// Consumes the builder and constructs a [`StopTaskInput`](crate::operation::stop_task::StopTaskInput).
87 pub fn build(self) -> ::std::result::Result<crate::operation::stop_task::StopTaskInput, ::aws_smithy_types::error::operation::BuildError> {
88 ::std::result::Result::Ok(crate::operation::stop_task::StopTaskInput {
89 cluster: self.cluster,
90 task: self.task,
91 reason: self.reason,
92 })
93 }
94}