aws_sdk_ec2/operation/allocate_hosts/_allocate_hosts_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 AllocateHostsInput {
6 /// <p>Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.</p>
7 /// <p>If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
8 pub instance_family: ::std::option::Option<::std::string::String>,
9 /// <p>The tags to apply to the Dedicated Host during creation.</p>
10 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
11 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html"> Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
12 /// <p>Default: <code>off</code></p>
13 pub host_recovery: ::std::option::Option<crate::types::HostRecovery>,
14 /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify <b>OutpostArn</b>, you can optionally specify <b>AssetIds</b>.</p>
15 /// <p>If you are allocating the Dedicated Host in a Region, omit this parameter.</p>
16 pub outpost_arn: ::std::option::Option<::std::string::String>,
17 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
18 pub host_maintenance: ::std::option::Option<crate::types::HostMaintenance>,
19 /// <p>The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify <b>OutpostArn</b>. If you are allocating the Dedicated Hosts in a Region, omit this parameter.</p>
20 /// <ul>
21 /// <li>
22 /// <p>If you specify this parameter, you can omit <b>Quantity</b>. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.</p></li>
23 /// <li>
24 /// <p>If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value for <b>Quantity</b> must be equal to the number of asset IDs specified.</p></li>
25 /// </ul>
26 pub asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
27 /// <p>The ID of the Availability Zone.</p>
28 pub availability_zone_id: ::std::option::Option<::std::string::String>,
29 /// <p>Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding"> Understanding auto-placement and affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
30 /// <p>Default: <code>off</code></p>
31 pub auto_placement: ::std::option::Option<crate::types::AutoPlacement>,
32 /// <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">Ensuring Idempotency</a>.</p>
33 pub client_token: ::std::option::Option<::std::string::String>,
34 /// <p>Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.</p>
35 /// <p>If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
36 pub instance_type: ::std::option::Option<::std::string::String>,
37 /// <p>The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify <b>AssetIds</b>, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value that you specify for <b>Quantity</b> must be equal to the number of asset IDs specified.</p>
38 pub quantity: ::std::option::Option<i32>,
39 /// <p>The Availability Zone in which to allocate the Dedicated Host.</p>
40 pub availability_zone: ::std::option::Option<::std::string::String>,
41}
42impl AllocateHostsInput {
43 /// <p>Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.</p>
44 /// <p>If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
45 pub fn instance_family(&self) -> ::std::option::Option<&str> {
46 self.instance_family.as_deref()
47 }
48 /// <p>The tags to apply to the Dedicated Host during creation.</p>
49 ///
50 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
51 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
52 self.tag_specifications.as_deref().unwrap_or_default()
53 }
54 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html"> Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
55 /// <p>Default: <code>off</code></p>
56 pub fn host_recovery(&self) -> ::std::option::Option<&crate::types::HostRecovery> {
57 self.host_recovery.as_ref()
58 }
59 /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify <b>OutpostArn</b>, you can optionally specify <b>AssetIds</b>.</p>
60 /// <p>If you are allocating the Dedicated Host in a Region, omit this parameter.</p>
61 pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
62 self.outpost_arn.as_deref()
63 }
64 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
65 pub fn host_maintenance(&self) -> ::std::option::Option<&crate::types::HostMaintenance> {
66 self.host_maintenance.as_ref()
67 }
68 /// <p>The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify <b>OutpostArn</b>. If you are allocating the Dedicated Hosts in a Region, omit this parameter.</p>
69 /// <ul>
70 /// <li>
71 /// <p>If you specify this parameter, you can omit <b>Quantity</b>. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.</p></li>
72 /// <li>
73 /// <p>If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value for <b>Quantity</b> must be equal to the number of asset IDs specified.</p></li>
74 /// </ul>
75 ///
76 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.asset_ids.is_none()`.
77 pub fn asset_ids(&self) -> &[::std::string::String] {
78 self.asset_ids.as_deref().unwrap_or_default()
79 }
80 /// <p>The ID of the Availability Zone.</p>
81 pub fn availability_zone_id(&self) -> ::std::option::Option<&str> {
82 self.availability_zone_id.as_deref()
83 }
84 /// <p>Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding"> Understanding auto-placement and affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
85 /// <p>Default: <code>off</code></p>
86 pub fn auto_placement(&self) -> ::std::option::Option<&crate::types::AutoPlacement> {
87 self.auto_placement.as_ref()
88 }
89 /// <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">Ensuring Idempotency</a>.</p>
90 pub fn client_token(&self) -> ::std::option::Option<&str> {
91 self.client_token.as_deref()
92 }
93 /// <p>Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.</p>
94 /// <p>If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
95 pub fn instance_type(&self) -> ::std::option::Option<&str> {
96 self.instance_type.as_deref()
97 }
98 /// <p>The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify <b>AssetIds</b>, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value that you specify for <b>Quantity</b> must be equal to the number of asset IDs specified.</p>
99 pub fn quantity(&self) -> ::std::option::Option<i32> {
100 self.quantity
101 }
102 /// <p>The Availability Zone in which to allocate the Dedicated Host.</p>
103 pub fn availability_zone(&self) -> ::std::option::Option<&str> {
104 self.availability_zone.as_deref()
105 }
106}
107impl AllocateHostsInput {
108 /// Creates a new builder-style object to manufacture [`AllocateHostsInput`](crate::operation::allocate_hosts::AllocateHostsInput).
109 pub fn builder() -> crate::operation::allocate_hosts::builders::AllocateHostsInputBuilder {
110 crate::operation::allocate_hosts::builders::AllocateHostsInputBuilder::default()
111 }
112}
113
114/// A builder for [`AllocateHostsInput`](crate::operation::allocate_hosts::AllocateHostsInput).
115#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
116#[non_exhaustive]
117pub struct AllocateHostsInputBuilder {
118 pub(crate) instance_family: ::std::option::Option<::std::string::String>,
119 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
120 pub(crate) host_recovery: ::std::option::Option<crate::types::HostRecovery>,
121 pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
122 pub(crate) host_maintenance: ::std::option::Option<crate::types::HostMaintenance>,
123 pub(crate) asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
124 pub(crate) availability_zone_id: ::std::option::Option<::std::string::String>,
125 pub(crate) auto_placement: ::std::option::Option<crate::types::AutoPlacement>,
126 pub(crate) client_token: ::std::option::Option<::std::string::String>,
127 pub(crate) instance_type: ::std::option::Option<::std::string::String>,
128 pub(crate) quantity: ::std::option::Option<i32>,
129 pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
130}
131impl AllocateHostsInputBuilder {
132 /// <p>Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.</p>
133 /// <p>If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
134 pub fn instance_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.instance_family = ::std::option::Option::Some(input.into());
136 self
137 }
138 /// <p>Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.</p>
139 /// <p>If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
140 pub fn set_instance_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.instance_family = input;
142 self
143 }
144 /// <p>Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.</p>
145 /// <p>If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
146 pub fn get_instance_family(&self) -> &::std::option::Option<::std::string::String> {
147 &self.instance_family
148 }
149 /// Appends an item to `tag_specifications`.
150 ///
151 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
152 ///
153 /// <p>The tags to apply to the Dedicated Host during creation.</p>
154 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
155 let mut v = self.tag_specifications.unwrap_or_default();
156 v.push(input);
157 self.tag_specifications = ::std::option::Option::Some(v);
158 self
159 }
160 /// <p>The tags to apply to the Dedicated Host during creation.</p>
161 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
162 self.tag_specifications = input;
163 self
164 }
165 /// <p>The tags to apply to the Dedicated Host during creation.</p>
166 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
167 &self.tag_specifications
168 }
169 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html"> Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
170 /// <p>Default: <code>off</code></p>
171 pub fn host_recovery(mut self, input: crate::types::HostRecovery) -> Self {
172 self.host_recovery = ::std::option::Option::Some(input);
173 self
174 }
175 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html"> Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
176 /// <p>Default: <code>off</code></p>
177 pub fn set_host_recovery(mut self, input: ::std::option::Option<crate::types::HostRecovery>) -> Self {
178 self.host_recovery = input;
179 self
180 }
181 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html"> Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
182 /// <p>Default: <code>off</code></p>
183 pub fn get_host_recovery(&self) -> &::std::option::Option<crate::types::HostRecovery> {
184 &self.host_recovery
185 }
186 /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify <b>OutpostArn</b>, you can optionally specify <b>AssetIds</b>.</p>
187 /// <p>If you are allocating the Dedicated Host in a Region, omit this parameter.</p>
188 pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.outpost_arn = ::std::option::Option::Some(input.into());
190 self
191 }
192 /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify <b>OutpostArn</b>, you can optionally specify <b>AssetIds</b>.</p>
193 /// <p>If you are allocating the Dedicated Host in a Region, omit this parameter.</p>
194 pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.outpost_arn = input;
196 self
197 }
198 /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify <b>OutpostArn</b>, you can optionally specify <b>AssetIds</b>.</p>
199 /// <p>If you are allocating the Dedicated Host in a Region, omit this parameter.</p>
200 pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
201 &self.outpost_arn
202 }
203 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
204 pub fn host_maintenance(mut self, input: crate::types::HostMaintenance) -> Self {
205 self.host_maintenance = ::std::option::Option::Some(input);
206 self
207 }
208 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
209 pub fn set_host_maintenance(mut self, input: ::std::option::Option<crate::types::HostMaintenance>) -> Self {
210 self.host_maintenance = input;
211 self
212 }
213 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
214 pub fn get_host_maintenance(&self) -> &::std::option::Option<crate::types::HostMaintenance> {
215 &self.host_maintenance
216 }
217 /// Appends an item to `asset_ids`.
218 ///
219 /// To override the contents of this collection use [`set_asset_ids`](Self::set_asset_ids).
220 ///
221 /// <p>The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify <b>OutpostArn</b>. If you are allocating the Dedicated Hosts in a Region, omit this parameter.</p>
222 /// <ul>
223 /// <li>
224 /// <p>If you specify this parameter, you can omit <b>Quantity</b>. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.</p></li>
225 /// <li>
226 /// <p>If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value for <b>Quantity</b> must be equal to the number of asset IDs specified.</p></li>
227 /// </ul>
228 pub fn asset_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229 let mut v = self.asset_ids.unwrap_or_default();
230 v.push(input.into());
231 self.asset_ids = ::std::option::Option::Some(v);
232 self
233 }
234 /// <p>The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify <b>OutpostArn</b>. If you are allocating the Dedicated Hosts in a Region, omit this parameter.</p>
235 /// <ul>
236 /// <li>
237 /// <p>If you specify this parameter, you can omit <b>Quantity</b>. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.</p></li>
238 /// <li>
239 /// <p>If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value for <b>Quantity</b> must be equal to the number of asset IDs specified.</p></li>
240 /// </ul>
241 pub fn set_asset_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
242 self.asset_ids = input;
243 self
244 }
245 /// <p>The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify <b>OutpostArn</b>. If you are allocating the Dedicated Hosts in a Region, omit this parameter.</p>
246 /// <ul>
247 /// <li>
248 /// <p>If you specify this parameter, you can omit <b>Quantity</b>. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.</p></li>
249 /// <li>
250 /// <p>If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value for <b>Quantity</b> must be equal to the number of asset IDs specified.</p></li>
251 /// </ul>
252 pub fn get_asset_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
253 &self.asset_ids
254 }
255 /// <p>The ID of the Availability Zone.</p>
256 pub fn availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257 self.availability_zone_id = ::std::option::Option::Some(input.into());
258 self
259 }
260 /// <p>The ID of the Availability Zone.</p>
261 pub fn set_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262 self.availability_zone_id = input;
263 self
264 }
265 /// <p>The ID of the Availability Zone.</p>
266 pub fn get_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
267 &self.availability_zone_id
268 }
269 /// <p>Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding"> Understanding auto-placement and affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
270 /// <p>Default: <code>off</code></p>
271 pub fn auto_placement(mut self, input: crate::types::AutoPlacement) -> Self {
272 self.auto_placement = ::std::option::Option::Some(input);
273 self
274 }
275 /// <p>Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding"> Understanding auto-placement and affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
276 /// <p>Default: <code>off</code></p>
277 pub fn set_auto_placement(mut self, input: ::std::option::Option<crate::types::AutoPlacement>) -> Self {
278 self.auto_placement = input;
279 self
280 }
281 /// <p>Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding"> Understanding auto-placement and affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
282 /// <p>Default: <code>off</code></p>
283 pub fn get_auto_placement(&self) -> &::std::option::Option<crate::types::AutoPlacement> {
284 &self.auto_placement
285 }
286 /// <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">Ensuring Idempotency</a>.</p>
287 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288 self.client_token = ::std::option::Option::Some(input.into());
289 self
290 }
291 /// <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">Ensuring Idempotency</a>.</p>
292 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
293 self.client_token = input;
294 self
295 }
296 /// <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">Ensuring Idempotency</a>.</p>
297 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
298 &self.client_token
299 }
300 /// <p>Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.</p>
301 /// <p>If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
302 pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
303 self.instance_type = ::std::option::Option::Some(input.into());
304 self
305 }
306 /// <p>Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.</p>
307 /// <p>If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
308 pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
309 self.instance_type = input;
310 self
311 }
312 /// <p>Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.</p>
313 /// <p>If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
314 pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
315 &self.instance_type
316 }
317 /// <p>The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify <b>AssetIds</b>, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value that you specify for <b>Quantity</b> must be equal to the number of asset IDs specified.</p>
318 pub fn quantity(mut self, input: i32) -> Self {
319 self.quantity = ::std::option::Option::Some(input);
320 self
321 }
322 /// <p>The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify <b>AssetIds</b>, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value that you specify for <b>Quantity</b> must be equal to the number of asset IDs specified.</p>
323 pub fn set_quantity(mut self, input: ::std::option::Option<i32>) -> Self {
324 self.quantity = input;
325 self
326 }
327 /// <p>The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify <b>AssetIds</b>, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both <b>AssetIds</b> and <b>Quantity</b>, then the value that you specify for <b>Quantity</b> must be equal to the number of asset IDs specified.</p>
328 pub fn get_quantity(&self) -> &::std::option::Option<i32> {
329 &self.quantity
330 }
331 /// <p>The Availability Zone in which to allocate the Dedicated Host.</p>
332 pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333 self.availability_zone = ::std::option::Option::Some(input.into());
334 self
335 }
336 /// <p>The Availability Zone in which to allocate the Dedicated Host.</p>
337 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
338 self.availability_zone = input;
339 self
340 }
341 /// <p>The Availability Zone in which to allocate the Dedicated Host.</p>
342 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
343 &self.availability_zone
344 }
345 /// Consumes the builder and constructs a [`AllocateHostsInput`](crate::operation::allocate_hosts::AllocateHostsInput).
346 pub fn build(
347 self,
348 ) -> ::std::result::Result<crate::operation::allocate_hosts::AllocateHostsInput, ::aws_smithy_types::error::operation::BuildError> {
349 ::std::result::Result::Ok(crate::operation::allocate_hosts::AllocateHostsInput {
350 instance_family: self.instance_family,
351 tag_specifications: self.tag_specifications,
352 host_recovery: self.host_recovery,
353 outpost_arn: self.outpost_arn,
354 host_maintenance: self.host_maintenance,
355 asset_ids: self.asset_ids,
356 availability_zone_id: self.availability_zone_id,
357 auto_placement: self.auto_placement,
358 client_token: self.client_token,
359 instance_type: self.instance_type,
360 quantity: self.quantity,
361 availability_zone: self.availability_zone,
362 })
363 }
364}