aws_sdk_ecs/operation/submit_task_state_change/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::submit_task_state_change::_submit_task_state_change_output::SubmitTaskStateChangeOutputBuilder;
3
4pub use crate::operation::submit_task_state_change::_submit_task_state_change_input::SubmitTaskStateChangeInputBuilder;
5
6impl crate::operation::submit_task_state_change::builders::SubmitTaskStateChangeInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::submit_task_state_change::SubmitTaskStateChangeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::submit_task_state_change::SubmitTaskStateChangeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.submit_task_state_change();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SubmitTaskStateChange`.
24///
25/// <note>
26/// <p>This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.</p>
27/// </note>
28/// <p>Sent to acknowledge that a task changed states.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct SubmitTaskStateChangeFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::submit_task_state_change::builders::SubmitTaskStateChangeInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::submit_task_state_change::SubmitTaskStateChangeOutput,
38        crate::operation::submit_task_state_change::SubmitTaskStateChangeError,
39    > for SubmitTaskStateChangeFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::submit_task_state_change::SubmitTaskStateChangeOutput,
47            crate::operation::submit_task_state_change::SubmitTaskStateChangeError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl SubmitTaskStateChangeFluentBuilder {
54    /// Creates a new `SubmitTaskStateChangeFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the SubmitTaskStateChange as a reference.
63    pub fn as_input(&self) -> &crate::operation::submit_task_state_change::builders::SubmitTaskStateChangeInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::submit_task_state_change::SubmitTaskStateChangeOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::submit_task_state_change::SubmitTaskStateChangeError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::submit_task_state_change::SubmitTaskStateChange::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::submit_task_state_change::SubmitTaskStateChange::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::submit_task_state_change::SubmitTaskStateChangeOutput,
100        crate::operation::submit_task_state_change::SubmitTaskStateChangeError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.</p>
115    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.cluster(input.into());
117        self
118    }
119    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.</p>
120    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_cluster(input);
122        self
123    }
124    /// <p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task.</p>
125    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_cluster()
127    }
128    /// <p>The task ID or full ARN of the task in the state change request.</p>
129    pub fn task(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.task(input.into());
131        self
132    }
133    /// <p>The task ID or full ARN of the task in the state change request.</p>
134    pub fn set_task(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_task(input);
136        self
137    }
138    /// <p>The task ID or full ARN of the task in the state change request.</p>
139    pub fn get_task(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_task()
141    }
142    /// <p>The status of the state change request.</p>
143    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.status(input.into());
145        self
146    }
147    /// <p>The status of the state change request.</p>
148    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_status(input);
150        self
151    }
152    /// <p>The status of the state change request.</p>
153    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_status()
155    }
156    /// <p>The reason for the state change request.</p>
157    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.reason(input.into());
159        self
160    }
161    /// <p>The reason for the state change request.</p>
162    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_reason(input);
164        self
165    }
166    /// <p>The reason for the state change request.</p>
167    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_reason()
169    }
170    ///
171    /// Appends an item to `containers`.
172    ///
173    /// To override the contents of this collection use [`set_containers`](Self::set_containers).
174    ///
175    /// <p>Any containers that's associated with the state change request.</p>
176    pub fn containers(mut self, input: crate::types::ContainerStateChange) -> Self {
177        self.inner = self.inner.containers(input);
178        self
179    }
180    /// <p>Any containers that's associated with the state change request.</p>
181    pub fn set_containers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContainerStateChange>>) -> Self {
182        self.inner = self.inner.set_containers(input);
183        self
184    }
185    /// <p>Any containers that's associated with the state change request.</p>
186    pub fn get_containers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContainerStateChange>> {
187        self.inner.get_containers()
188    }
189    ///
190    /// Appends an item to `attachments`.
191    ///
192    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
193    ///
194    /// <p>Any attachments associated with the state change request.</p>
195    pub fn attachments(mut self, input: crate::types::AttachmentStateChange) -> Self {
196        self.inner = self.inner.attachments(input);
197        self
198    }
199    /// <p>Any attachments associated with the state change request.</p>
200    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentStateChange>>) -> Self {
201        self.inner = self.inner.set_attachments(input);
202        self
203    }
204    /// <p>Any attachments associated with the state change request.</p>
205    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentStateChange>> {
206        self.inner.get_attachments()
207    }
208    ///
209    /// Appends an item to `managedAgents`.
210    ///
211    /// To override the contents of this collection use [`set_managed_agents`](Self::set_managed_agents).
212    ///
213    /// <p>The details for the managed agent that's associated with the task.</p>
214    pub fn managed_agents(mut self, input: crate::types::ManagedAgentStateChange) -> Self {
215        self.inner = self.inner.managed_agents(input);
216        self
217    }
218    /// <p>The details for the managed agent that's associated with the task.</p>
219    pub fn set_managed_agents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ManagedAgentStateChange>>) -> Self {
220        self.inner = self.inner.set_managed_agents(input);
221        self
222    }
223    /// <p>The details for the managed agent that's associated with the task.</p>
224    pub fn get_managed_agents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ManagedAgentStateChange>> {
225        self.inner.get_managed_agents()
226    }
227    /// <p>The Unix timestamp for the time when the container image pull started.</p>
228    pub fn pull_started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
229        self.inner = self.inner.pull_started_at(input);
230        self
231    }
232    /// <p>The Unix timestamp for the time when the container image pull started.</p>
233    pub fn set_pull_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
234        self.inner = self.inner.set_pull_started_at(input);
235        self
236    }
237    /// <p>The Unix timestamp for the time when the container image pull started.</p>
238    pub fn get_pull_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
239        self.inner.get_pull_started_at()
240    }
241    /// <p>The Unix timestamp for the time when the container image pull completed.</p>
242    pub fn pull_stopped_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
243        self.inner = self.inner.pull_stopped_at(input);
244        self
245    }
246    /// <p>The Unix timestamp for the time when the container image pull completed.</p>
247    pub fn set_pull_stopped_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
248        self.inner = self.inner.set_pull_stopped_at(input);
249        self
250    }
251    /// <p>The Unix timestamp for the time when the container image pull completed.</p>
252    pub fn get_pull_stopped_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
253        self.inner.get_pull_stopped_at()
254    }
255    /// <p>The Unix timestamp for the time when the task execution stopped.</p>
256    pub fn execution_stopped_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
257        self.inner = self.inner.execution_stopped_at(input);
258        self
259    }
260    /// <p>The Unix timestamp for the time when the task execution stopped.</p>
261    pub fn set_execution_stopped_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
262        self.inner = self.inner.set_execution_stopped_at(input);
263        self
264    }
265    /// <p>The Unix timestamp for the time when the task execution stopped.</p>
266    pub fn get_execution_stopped_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
267        self.inner.get_execution_stopped_at()
268    }
269}