aws_sdk_ec2/operation/create_capacity_reservation/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_capacity_reservation::_create_capacity_reservation_output::CreateCapacityReservationOutputBuilder;
3
4pub use crate::operation::create_capacity_reservation::_create_capacity_reservation_input::CreateCapacityReservationInputBuilder;
5
6impl crate::operation::create_capacity_reservation::builders::CreateCapacityReservationInputBuilder {
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::create_capacity_reservation::CreateCapacityReservationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_capacity_reservation::CreateCapacityReservationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_capacity_reservation();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCapacityReservation`.
24///
25/// <p>Creates a new Capacity Reservation with the specified attributes. Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration.</p>
26/// <p>You can create a Capacity Reservation at any time, and you can choose when it starts. You can create a Capacity Reservation for immediate use or you can request a Capacity Reservation for a future date.</p>
27/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html"> Reserve compute capacity with On-Demand Capacity Reservations</a> in the <i>Amazon EC2 User Guide</i>.</p>
28/// <p>Your request to create a Capacity Reservation could fail if:</p>
29/// <ul>
30/// <li>
31/// <p>Amazon EC2 does not have sufficient capacity. In this case, try again at a later time, try in a different Availability Zone, or request a smaller Capacity Reservation. If your workload is flexible across instance types and sizes, try with different instance attributes.</p></li>
32/// <li>
33/// <p>The requested quantity exceeds your On-Demand Instance quota. In this case, increase your On-Demand Instance quota for the requested instance type and try again. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html"> Amazon EC2 Service Quotas</a> in the <i>Amazon EC2 User Guide</i>.</p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreateCapacityReservationFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::create_capacity_reservation::builders::CreateCapacityReservationInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::create_capacity_reservation::CreateCapacityReservationOutput,
44        crate::operation::create_capacity_reservation::CreateCapacityReservationError,
45    > for CreateCapacityReservationFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::create_capacity_reservation::CreateCapacityReservationOutput,
53            crate::operation::create_capacity_reservation::CreateCapacityReservationError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl CreateCapacityReservationFluentBuilder {
60    /// Creates a new `CreateCapacityReservationFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the CreateCapacityReservation as a reference.
69    pub fn as_input(&self) -> &crate::operation::create_capacity_reservation::builders::CreateCapacityReservationInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::create_capacity_reservation::CreateCapacityReservationOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::create_capacity_reservation::CreateCapacityReservationError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::create_capacity_reservation::CreateCapacityReservation::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::create_capacity_reservation::CreateCapacityReservation::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::create_capacity_reservation::CreateCapacityReservationOutput,
106        crate::operation::create_capacity_reservation::CreateCapacityReservationError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensure Idempotency</a>.</p>
121    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.client_token(input.into());
123        self
124    }
125    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensure Idempotency</a>.</p>
126    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_client_token(input);
128        self
129    }
130    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensure Idempotency</a>.</p>
131    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_client_token()
133    }
134    /// <p>The instance type for which to reserve capacity.</p><note>
135    /// <p>You can request future-dated Capacity Reservations for instance types in the C, M, R, I, T, and G instance families only.</p>
136    /// </note>
137    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
138    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.instance_type(input.into());
140        self
141    }
142    /// <p>The instance type for which to reserve capacity.</p><note>
143    /// <p>You can request future-dated Capacity Reservations for instance types in the C, M, R, I, T, and G instance families only.</p>
144    /// </note>
145    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
146    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_instance_type(input);
148        self
149    }
150    /// <p>The instance type for which to reserve capacity.</p><note>
151    /// <p>You can request future-dated Capacity Reservations for instance types in the C, M, R, I, T, and G instance families only.</p>
152    /// </note>
153    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance types</a> in the <i>Amazon EC2 User Guide</i>.</p>
154    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_instance_type()
156    }
157    /// <p>The type of operating system for which to reserve capacity.</p>
158    pub fn instance_platform(mut self, input: crate::types::CapacityReservationInstancePlatform) -> Self {
159        self.inner = self.inner.instance_platform(input);
160        self
161    }
162    /// <p>The type of operating system for which to reserve capacity.</p>
163    pub fn set_instance_platform(mut self, input: ::std::option::Option<crate::types::CapacityReservationInstancePlatform>) -> Self {
164        self.inner = self.inner.set_instance_platform(input);
165        self
166    }
167    /// <p>The type of operating system for which to reserve capacity.</p>
168    pub fn get_instance_platform(&self) -> &::std::option::Option<crate::types::CapacityReservationInstancePlatform> {
169        self.inner.get_instance_platform()
170    }
171    /// <p>The Availability Zone in which to create the Capacity Reservation.</p>
172    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.availability_zone(input.into());
174        self
175    }
176    /// <p>The Availability Zone in which to create the Capacity Reservation.</p>
177    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_availability_zone(input);
179        self
180    }
181    /// <p>The Availability Zone in which to create the Capacity Reservation.</p>
182    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
183        self.inner.get_availability_zone()
184    }
185    /// <p>The ID of the Availability Zone in which to create the Capacity Reservation.</p>
186    pub fn availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.availability_zone_id(input.into());
188        self
189    }
190    /// <p>The ID of the Availability Zone in which to create the Capacity Reservation.</p>
191    pub fn set_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.inner = self.inner.set_availability_zone_id(input);
193        self
194    }
195    /// <p>The ID of the Availability Zone in which to create the Capacity Reservation.</p>
196    pub fn get_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_availability_zone_id()
198    }
199    /// <p>Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:</p>
200    /// <ul>
201    /// <li>
202    /// <p><code>default</code> - The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts.</p></li>
203    /// <li>
204    /// <p><code>dedicated</code> - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.</p></li>
205    /// </ul>
206    pub fn tenancy(mut self, input: crate::types::CapacityReservationTenancy) -> Self {
207        self.inner = self.inner.tenancy(input);
208        self
209    }
210    /// <p>Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:</p>
211    /// <ul>
212    /// <li>
213    /// <p><code>default</code> - The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts.</p></li>
214    /// <li>
215    /// <p><code>dedicated</code> - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.</p></li>
216    /// </ul>
217    pub fn set_tenancy(mut self, input: ::std::option::Option<crate::types::CapacityReservationTenancy>) -> Self {
218        self.inner = self.inner.set_tenancy(input);
219        self
220    }
221    /// <p>Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:</p>
222    /// <ul>
223    /// <li>
224    /// <p><code>default</code> - The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts.</p></li>
225    /// <li>
226    /// <p><code>dedicated</code> - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.</p></li>
227    /// </ul>
228    pub fn get_tenancy(&self) -> &::std::option::Option<crate::types::CapacityReservationTenancy> {
229        self.inner.get_tenancy()
230    }
231    /// <p>The number of instances for which to reserve capacity.</p><note>
232    /// <p>You can request future-dated Capacity Reservations for an instance count with a minimum of 64 vCPUs. For example, if you request a future-dated Capacity Reservation for <code>m5.xlarge</code> instances, you must request at least 25 instances (<i>16 * m5.xlarge = 64 vCPUs</i>).</p>
233    /// </note>
234    /// <p>Valid range: 1 - 1000</p>
235    pub fn instance_count(mut self, input: i32) -> Self {
236        self.inner = self.inner.instance_count(input);
237        self
238    }
239    /// <p>The number of instances for which to reserve capacity.</p><note>
240    /// <p>You can request future-dated Capacity Reservations for an instance count with a minimum of 64 vCPUs. For example, if you request a future-dated Capacity Reservation for <code>m5.xlarge</code> instances, you must request at least 25 instances (<i>16 * m5.xlarge = 64 vCPUs</i>).</p>
241    /// </note>
242    /// <p>Valid range: 1 - 1000</p>
243    pub fn set_instance_count(mut self, input: ::std::option::Option<i32>) -> Self {
244        self.inner = self.inner.set_instance_count(input);
245        self
246    }
247    /// <p>The number of instances for which to reserve capacity.</p><note>
248    /// <p>You can request future-dated Capacity Reservations for an instance count with a minimum of 64 vCPUs. For example, if you request a future-dated Capacity Reservation for <code>m5.xlarge</code> instances, you must request at least 25 instances (<i>16 * m5.xlarge = 64 vCPUs</i>).</p>
249    /// </note>
250    /// <p>Valid range: 1 - 1000</p>
251    pub fn get_instance_count(&self) -> &::std::option::Option<i32> {
252        self.inner.get_instance_count()
253    }
254    /// <p>Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.</p>
255    pub fn ebs_optimized(mut self, input: bool) -> Self {
256        self.inner = self.inner.ebs_optimized(input);
257        self
258    }
259    /// <p>Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.</p>
260    pub fn set_ebs_optimized(mut self, input: ::std::option::Option<bool>) -> Self {
261        self.inner = self.inner.set_ebs_optimized(input);
262        self
263    }
264    /// <p>Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.</p>
265    pub fn get_ebs_optimized(&self) -> &::std::option::Option<bool> {
266        self.inner.get_ebs_optimized()
267    }
268    /// <p><i>Deprecated.</i></p>
269    pub fn ephemeral_storage(mut self, input: bool) -> Self {
270        self.inner = self.inner.ephemeral_storage(input);
271        self
272    }
273    /// <p><i>Deprecated.</i></p>
274    pub fn set_ephemeral_storage(mut self, input: ::std::option::Option<bool>) -> Self {
275        self.inner = self.inner.set_ephemeral_storage(input);
276        self
277    }
278    /// <p><i>Deprecated.</i></p>
279    pub fn get_ephemeral_storage(&self) -> &::std::option::Option<bool> {
280        self.inner.get_ephemeral_storage()
281    }
282    /// <p>The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to <code>expired</code> when it reaches its end date and time.</p>
283    /// <p>You must provide an <code>EndDate</code> value if <code>EndDateType</code> is <code>limited</code>. Omit <code>EndDate</code> if <code>EndDateType</code> is <code>unlimited</code>.</p>
284    /// <p>If the <code>EndDateType</code> is <code>limited</code>, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.</p>
285    /// <p>If you are requesting a future-dated Capacity Reservation, you can't specify an end date and time that is within the commitment duration.</p>
286    pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
287        self.inner = self.inner.end_date(input);
288        self
289    }
290    /// <p>The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to <code>expired</code> when it reaches its end date and time.</p>
291    /// <p>You must provide an <code>EndDate</code> value if <code>EndDateType</code> is <code>limited</code>. Omit <code>EndDate</code> if <code>EndDateType</code> is <code>unlimited</code>.</p>
292    /// <p>If the <code>EndDateType</code> is <code>limited</code>, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.</p>
293    /// <p>If you are requesting a future-dated Capacity Reservation, you can't specify an end date and time that is within the commitment duration.</p>
294    pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
295        self.inner = self.inner.set_end_date(input);
296        self
297    }
298    /// <p>The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to <code>expired</code> when it reaches its end date and time.</p>
299    /// <p>You must provide an <code>EndDate</code> value if <code>EndDateType</code> is <code>limited</code>. Omit <code>EndDate</code> if <code>EndDateType</code> is <code>unlimited</code>.</p>
300    /// <p>If the <code>EndDateType</code> is <code>limited</code>, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.</p>
301    /// <p>If you are requesting a future-dated Capacity Reservation, you can't specify an end date and time that is within the commitment duration.</p>
302    pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
303        self.inner.get_end_date()
304    }
305    /// <p>Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:</p>
306    /// <ul>
307    /// <li>
308    /// <p><code>unlimited</code> - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an <code>EndDate</code> if the <code>EndDateType</code> is <code>unlimited</code>.</p></li>
309    /// <li>
310    /// <p><code>limited</code> - The Capacity Reservation expires automatically at a specified date and time. You must provide an <code>EndDate</code> value if the <code>EndDateType</code> value is <code>limited</code>.</p></li>
311    /// </ul>
312    pub fn end_date_type(mut self, input: crate::types::EndDateType) -> Self {
313        self.inner = self.inner.end_date_type(input);
314        self
315    }
316    /// <p>Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:</p>
317    /// <ul>
318    /// <li>
319    /// <p><code>unlimited</code> - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an <code>EndDate</code> if the <code>EndDateType</code> is <code>unlimited</code>.</p></li>
320    /// <li>
321    /// <p><code>limited</code> - The Capacity Reservation expires automatically at a specified date and time. You must provide an <code>EndDate</code> value if the <code>EndDateType</code> value is <code>limited</code>.</p></li>
322    /// </ul>
323    pub fn set_end_date_type(mut self, input: ::std::option::Option<crate::types::EndDateType>) -> Self {
324        self.inner = self.inner.set_end_date_type(input);
325        self
326    }
327    /// <p>Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:</p>
328    /// <ul>
329    /// <li>
330    /// <p><code>unlimited</code> - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an <code>EndDate</code> if the <code>EndDateType</code> is <code>unlimited</code>.</p></li>
331    /// <li>
332    /// <p><code>limited</code> - The Capacity Reservation expires automatically at a specified date and time. You must provide an <code>EndDate</code> value if the <code>EndDateType</code> value is <code>limited</code>.</p></li>
333    /// </ul>
334    pub fn get_end_date_type(&self) -> &::std::option::Option<crate::types::EndDateType> {
335        self.inner.get_end_date_type()
336    }
337    /// <p>Indicates the type of instance launches that the Capacity Reservation accepts. The options include:</p>
338    /// <ul>
339    /// <li>
340    /// <p><code>open</code> - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.</p></li>
341    /// <li>
342    /// <p><code>targeted</code> - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.</p></li>
343    /// </ul><note>
344    /// <p>If you are requesting a future-dated Capacity Reservation, you must specify <code>targeted</code>.</p>
345    /// </note>
346    /// <p>Default: <code>open</code></p>
347    pub fn instance_match_criteria(mut self, input: crate::types::InstanceMatchCriteria) -> Self {
348        self.inner = self.inner.instance_match_criteria(input);
349        self
350    }
351    /// <p>Indicates the type of instance launches that the Capacity Reservation accepts. The options include:</p>
352    /// <ul>
353    /// <li>
354    /// <p><code>open</code> - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.</p></li>
355    /// <li>
356    /// <p><code>targeted</code> - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.</p></li>
357    /// </ul><note>
358    /// <p>If you are requesting a future-dated Capacity Reservation, you must specify <code>targeted</code>.</p>
359    /// </note>
360    /// <p>Default: <code>open</code></p>
361    pub fn set_instance_match_criteria(mut self, input: ::std::option::Option<crate::types::InstanceMatchCriteria>) -> Self {
362        self.inner = self.inner.set_instance_match_criteria(input);
363        self
364    }
365    /// <p>Indicates the type of instance launches that the Capacity Reservation accepts. The options include:</p>
366    /// <ul>
367    /// <li>
368    /// <p><code>open</code> - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.</p></li>
369    /// <li>
370    /// <p><code>targeted</code> - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.</p></li>
371    /// </ul><note>
372    /// <p>If you are requesting a future-dated Capacity Reservation, you must specify <code>targeted</code>.</p>
373    /// </note>
374    /// <p>Default: <code>open</code></p>
375    pub fn get_instance_match_criteria(&self) -> &::std::option::Option<crate::types::InstanceMatchCriteria> {
376        self.inner.get_instance_match_criteria()
377    }
378    ///
379    /// Appends an item to `TagSpecifications`.
380    ///
381    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
382    ///
383    /// <p>The tags to apply to the Capacity Reservation during launch.</p>
384    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
385        self.inner = self.inner.tag_specifications(input);
386        self
387    }
388    /// <p>The tags to apply to the Capacity Reservation during launch.</p>
389    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
390        self.inner = self.inner.set_tag_specifications(input);
391        self
392    }
393    /// <p>The tags to apply to the Capacity Reservation during launch.</p>
394    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
395        self.inner.get_tag_specifications()
396    }
397    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
398    pub fn dry_run(mut self, input: bool) -> Self {
399        self.inner = self.inner.dry_run(input);
400        self
401    }
402    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
403    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
404        self.inner = self.inner.set_dry_run(input);
405        self
406    }
407    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
408    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
409        self.inner.get_dry_run()
410    }
411    /// <note>
412    /// <p>Not supported for future-dated Capacity Reservations.</p>
413    /// </note>
414    /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.</p>
415    pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
416        self.inner = self.inner.outpost_arn(input.into());
417        self
418    }
419    /// <note>
420    /// <p>Not supported for future-dated Capacity Reservations.</p>
421    /// </note>
422    /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.</p>
423    pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
424        self.inner = self.inner.set_outpost_arn(input);
425        self
426    }
427    /// <note>
428    /// <p>Not supported for future-dated Capacity Reservations.</p>
429    /// </note>
430    /// <p>The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.</p>
431    pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
432        self.inner.get_outpost_arn()
433    }
434    /// <note>
435    /// <p>Not supported for future-dated Capacity Reservations.</p>
436    /// </note>
437    /// <p>The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html"> Capacity Reservations for cluster placement groups</a> in the <i>Amazon EC2 User Guide</i>.</p>
438    pub fn placement_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
439        self.inner = self.inner.placement_group_arn(input.into());
440        self
441    }
442    /// <note>
443    /// <p>Not supported for future-dated Capacity Reservations.</p>
444    /// </note>
445    /// <p>The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html"> Capacity Reservations for cluster placement groups</a> in the <i>Amazon EC2 User Guide</i>.</p>
446    pub fn set_placement_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
447        self.inner = self.inner.set_placement_group_arn(input);
448        self
449    }
450    /// <note>
451    /// <p>Not supported for future-dated Capacity Reservations.</p>
452    /// </note>
453    /// <p>The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html"> Capacity Reservations for cluster placement groups</a> in the <i>Amazon EC2 User Guide</i>.</p>
454    pub fn get_placement_group_arn(&self) -> &::std::option::Option<::std::string::String> {
455        self.inner.get_placement_group_arn()
456    }
457    /// <note>
458    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
459    /// </note>
460    /// <p>The date and time at which the future-dated Capacity Reservation should become available for use, in the ISO8601 format in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
461    /// <p>You can request a future-dated Capacity Reservation between 5 and 120 days in advance.</p>
462    pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
463        self.inner = self.inner.start_date(input);
464        self
465    }
466    /// <note>
467    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
468    /// </note>
469    /// <p>The date and time at which the future-dated Capacity Reservation should become available for use, in the ISO8601 format in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
470    /// <p>You can request a future-dated Capacity Reservation between 5 and 120 days in advance.</p>
471    pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
472        self.inner = self.inner.set_start_date(input);
473        self
474    }
475    /// <note>
476    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
477    /// </note>
478    /// <p>The date and time at which the future-dated Capacity Reservation should become available for use, in the ISO8601 format in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
479    /// <p>You can request a future-dated Capacity Reservation between 5 and 120 days in advance.</p>
480    pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
481        self.inner.get_start_date()
482    }
483    /// <note>
484    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
485    /// </note>
486    /// <p>Specify a commitment duration, in seconds, for the future-dated Capacity Reservation.</p>
487    /// <p>The commitment duration is a minimum duration for which you commit to having the future-dated Capacity Reservation in the <code>active</code> state in your account after it has been delivered.</p>
488    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-concepts.html#cr-commitment-duration"> Commitment duration</a>.</p>
489    pub fn commitment_duration(mut self, input: i64) -> Self {
490        self.inner = self.inner.commitment_duration(input);
491        self
492    }
493    /// <note>
494    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
495    /// </note>
496    /// <p>Specify a commitment duration, in seconds, for the future-dated Capacity Reservation.</p>
497    /// <p>The commitment duration is a minimum duration for which you commit to having the future-dated Capacity Reservation in the <code>active</code> state in your account after it has been delivered.</p>
498    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-concepts.html#cr-commitment-duration"> Commitment duration</a>.</p>
499    pub fn set_commitment_duration(mut self, input: ::std::option::Option<i64>) -> Self {
500        self.inner = self.inner.set_commitment_duration(input);
501        self
502    }
503    /// <note>
504    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
505    /// </note>
506    /// <p>Specify a commitment duration, in seconds, for the future-dated Capacity Reservation.</p>
507    /// <p>The commitment duration is a minimum duration for which you commit to having the future-dated Capacity Reservation in the <code>active</code> state in your account after it has been delivered.</p>
508    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-concepts.html#cr-commitment-duration"> Commitment duration</a>.</p>
509    pub fn get_commitment_duration(&self) -> &::std::option::Option<i64> {
510        self.inner.get_commitment_duration()
511    }
512    /// <note>
513    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
514    /// </note>
515    /// <p>Indicates that the requested capacity will be delivered in addition to any running instances or reserved capacity that you have in your account at the requested date and time.</p>
516    /// <p>The only supported value is <code>incremental</code>.</p>
517    pub fn delivery_preference(mut self, input: crate::types::CapacityReservationDeliveryPreference) -> Self {
518        self.inner = self.inner.delivery_preference(input);
519        self
520    }
521    /// <note>
522    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
523    /// </note>
524    /// <p>Indicates that the requested capacity will be delivered in addition to any running instances or reserved capacity that you have in your account at the requested date and time.</p>
525    /// <p>The only supported value is <code>incremental</code>.</p>
526    pub fn set_delivery_preference(mut self, input: ::std::option::Option<crate::types::CapacityReservationDeliveryPreference>) -> Self {
527        self.inner = self.inner.set_delivery_preference(input);
528        self
529    }
530    /// <note>
531    /// <p>Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.</p>
532    /// </note>
533    /// <p>Indicates that the requested capacity will be delivered in addition to any running instances or reserved capacity that you have in your account at the requested date and time.</p>
534    /// <p>The only supported value is <code>incremental</code>.</p>
535    pub fn get_delivery_preference(&self) -> &::std::option::Option<crate::types::CapacityReservationDeliveryPreference> {
536        self.inner.get_delivery_preference()
537    }
538}