aws_sdk_ecs/operation/submit_container_state_change/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::submit_container_state_change::_submit_container_state_change_output::SubmitContainerStateChangeOutputBuilder;
3
4pub use crate::operation::submit_container_state_change::_submit_container_state_change_input::SubmitContainerStateChangeInputBuilder;
5
6impl crate::operation::submit_container_state_change::builders::SubmitContainerStateChangeInputBuilder {
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_container_state_change::SubmitContainerStateChangeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::submit_container_state_change::SubmitContainerStateChangeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.submit_container_state_change();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SubmitContainerStateChange`.
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 container changed states.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct SubmitContainerStateChangeFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::submit_container_state_change::builders::SubmitContainerStateChangeInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::submit_container_state_change::SubmitContainerStateChangeOutput,
38        crate::operation::submit_container_state_change::SubmitContainerStateChangeError,
39    > for SubmitContainerStateChangeFluentBuilder
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_container_state_change::SubmitContainerStateChangeOutput,
47            crate::operation::submit_container_state_change::SubmitContainerStateChangeError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl SubmitContainerStateChangeFluentBuilder {
54    /// Creates a new `SubmitContainerStateChangeFluentBuilder`.
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 SubmitContainerStateChange as a reference.
63    pub fn as_input(&self) -> &crate::operation::submit_container_state_change::builders::SubmitContainerStateChangeInputBuilder {
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_container_state_change::SubmitContainerStateChangeOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::submit_container_state_change::SubmitContainerStateChangeError,
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_container_state_change::SubmitContainerStateChange::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::submit_container_state_change::SubmitContainerStateChange::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_container_state_change::SubmitContainerStateChangeOutput,
100        crate::operation::submit_container_state_change::SubmitContainerStateChangeError,
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 ARN of the cluster that hosts the container.</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 ARN of the cluster that hosts the container.</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 ARN of the cluster that hosts the container.</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 Amazon Resource Name (ARN) of the task that hosts the container.</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 Amazon Resource Name (ARN) of the task that hosts the container.</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 Amazon Resource Name (ARN) of the task that hosts the container.</p>
139    pub fn get_task(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_task()
141    }
142    /// <p>The name of the container.</p>
143    pub fn container_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.container_name(input.into());
145        self
146    }
147    /// <p>The name of the container.</p>
148    pub fn set_container_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_container_name(input);
150        self
151    }
152    /// <p>The name of the container.</p>
153    pub fn get_container_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_container_name()
155    }
156    /// <p>The ID of the Docker container.</p>
157    pub fn runtime_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.runtime_id(input.into());
159        self
160    }
161    /// <p>The ID of the Docker container.</p>
162    pub fn set_runtime_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_runtime_id(input);
164        self
165    }
166    /// <p>The ID of the Docker container.</p>
167    pub fn get_runtime_id(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_runtime_id()
169    }
170    /// <p>The status of the state change request.</p>
171    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.status(input.into());
173        self
174    }
175    /// <p>The status of the state change request.</p>
176    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_status(input);
178        self
179    }
180    /// <p>The status of the state change request.</p>
181    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_status()
183    }
184    /// <p>The exit code that's returned for the state change request.</p>
185    pub fn exit_code(mut self, input: i32) -> Self {
186        self.inner = self.inner.exit_code(input);
187        self
188    }
189    /// <p>The exit code that's returned for the state change request.</p>
190    pub fn set_exit_code(mut self, input: ::std::option::Option<i32>) -> Self {
191        self.inner = self.inner.set_exit_code(input);
192        self
193    }
194    /// <p>The exit code that's returned for the state change request.</p>
195    pub fn get_exit_code(&self) -> &::std::option::Option<i32> {
196        self.inner.get_exit_code()
197    }
198    /// <p>The reason for the state change request.</p>
199    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.inner = self.inner.reason(input.into());
201        self
202    }
203    /// <p>The reason for the state change request.</p>
204    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_reason(input);
206        self
207    }
208    /// <p>The reason for the state change request.</p>
209    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
210        self.inner.get_reason()
211    }
212    ///
213    /// Appends an item to `networkBindings`.
214    ///
215    /// To override the contents of this collection use [`set_network_bindings`](Self::set_network_bindings).
216    ///
217    /// <p>The network bindings of the container.</p>
218    pub fn network_bindings(mut self, input: crate::types::NetworkBinding) -> Self {
219        self.inner = self.inner.network_bindings(input);
220        self
221    }
222    /// <p>The network bindings of the container.</p>
223    pub fn set_network_bindings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NetworkBinding>>) -> Self {
224        self.inner = self.inner.set_network_bindings(input);
225        self
226    }
227    /// <p>The network bindings of the container.</p>
228    pub fn get_network_bindings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NetworkBinding>> {
229        self.inner.get_network_bindings()
230    }
231}