aws_sdk_outposts/operation/start_capacity_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_capacity_task::_start_capacity_task_output::StartCapacityTaskOutputBuilder;
3
4pub use crate::operation::start_capacity_task::_start_capacity_task_input::StartCapacityTaskInputBuilder;
5
6impl crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder {
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::start_capacity_task::StartCapacityTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_capacity_task::StartCapacityTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_capacity_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartCapacityTask`.
24///
25/// <p>Starts the specified capacity task. You can have one active capacity task for each order and each Outpost.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartCapacityTaskFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::start_capacity_task::StartCapacityTaskOutput,
35        crate::operation::start_capacity_task::StartCapacityTaskError,
36    > for StartCapacityTaskFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::start_capacity_task::StartCapacityTaskOutput,
44            crate::operation::start_capacity_task::StartCapacityTaskError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl StartCapacityTaskFluentBuilder {
51    /// Creates a new `StartCapacityTaskFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the StartCapacityTask as a reference.
60    pub fn as_input(&self) -> &crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::start_capacity_task::StartCapacityTaskOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::start_capacity_task::StartCapacityTaskError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::start_capacity_task::StartCapacityTask::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::start_capacity_task::StartCapacityTask::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::start_capacity_task::StartCapacityTaskOutput,
97        crate::operation::start_capacity_task::StartCapacityTaskError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
112    pub fn outpost_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.outpost_identifier(input.into());
114        self
115    }
116    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
117    pub fn set_outpost_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_outpost_identifier(input);
119        self
120    }
121    /// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
122    pub fn get_outpost_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_outpost_identifier()
124    }
125    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
126    pub fn order_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.order_id(input.into());
128        self
129    }
130    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
131    pub fn set_order_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_order_id(input);
133        self
134    }
135    /// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
136    pub fn get_order_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_order_id()
138    }
139    /// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
140    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.asset_id(input.into());
142        self
143    }
144    /// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
145    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_asset_id(input);
147        self
148    }
149    /// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
150    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_asset_id()
152    }
153    ///
154    /// Appends an item to `InstancePools`.
155    ///
156    /// To override the contents of this collection use [`set_instance_pools`](Self::set_instance_pools).
157    ///
158    /// <p>The instance pools specified in the capacity task.</p>
159    pub fn instance_pools(mut self, input: crate::types::InstanceTypeCapacity) -> Self {
160        self.inner = self.inner.instance_pools(input);
161        self
162    }
163    /// <p>The instance pools specified in the capacity task.</p>
164    pub fn set_instance_pools(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>) -> Self {
165        self.inner = self.inner.set_instance_pools(input);
166        self
167    }
168    /// <p>The instance pools specified in the capacity task.</p>
169    pub fn get_instance_pools(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>> {
170        self.inner.get_instance_pools()
171    }
172    /// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
173    pub fn instances_to_exclude(mut self, input: crate::types::InstancesToExclude) -> Self {
174        self.inner = self.inner.instances_to_exclude(input);
175        self
176    }
177    /// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
178    pub fn set_instances_to_exclude(mut self, input: ::std::option::Option<crate::types::InstancesToExclude>) -> Self {
179        self.inner = self.inner.set_instances_to_exclude(input);
180        self
181    }
182    /// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
183    pub fn get_instances_to_exclude(&self) -> &::std::option::Option<crate::types::InstancesToExclude> {
184        self.inner.get_instances_to_exclude()
185    }
186    /// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
187    pub fn dry_run(mut self, input: bool) -> Self {
188        self.inner = self.inner.dry_run(input);
189        self
190    }
191    /// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
192    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
193        self.inner = self.inner.set_dry_run(input);
194        self
195    }
196    /// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
197    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
198        self.inner.get_dry_run()
199    }
200    /// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
201    /// <ul>
202    /// <li>
203    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
204    /// <li>
205    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
206    /// </ul>
207    pub fn task_action_on_blocking_instances(mut self, input: crate::types::TaskActionOnBlockingInstances) -> Self {
208        self.inner = self.inner.task_action_on_blocking_instances(input);
209        self
210    }
211    /// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
212    /// <ul>
213    /// <li>
214    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
215    /// <li>
216    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
217    /// </ul>
218    pub fn set_task_action_on_blocking_instances(mut self, input: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>) -> Self {
219        self.inner = self.inner.set_task_action_on_blocking_instances(input);
220        self
221    }
222    /// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
223    /// <ul>
224    /// <li>
225    /// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
226    /// <li>
227    /// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
228    /// </ul>
229    pub fn get_task_action_on_blocking_instances(&self) -> &::std::option::Option<crate::types::TaskActionOnBlockingInstances> {
230        self.inner.get_task_action_on_blocking_instances()
231    }
232}