129 129 | /// <p>The ID of the Outpost hardware asset on which the Dedicated Host is allocated.</p>
|
130 130 | pub fn asset_id(&self) -> ::std::option::Option<&str> {
|
131 131 | self.asset_id.as_deref()
|
132 132 | }
|
133 133 | }
|
134 134 | static HOST_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
135 135 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host", "com.amazonaws.ec2", "Host");
|
136 136 | static HOST_MEMBER_AUTO_PLACEMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
137 137 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AutoPlacement", "com.amazonaws.ec2", "Host"),
|
138 138 | ::aws_smithy_schema::ShapeType::String,
|
139 - | "auto_placement",
|
139 + | "AutoPlacement",
|
140 140 | 0,
|
141 141 | )
|
142 142 | .with_xml_name("autoPlacement");
|
143 143 | static HOST_MEMBER_AVAILABILITY_ZONE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
144 144 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AvailabilityZone", "com.amazonaws.ec2", "Host"),
|
145 145 | ::aws_smithy_schema::ShapeType::String,
|
146 - | "availability_zone",
|
146 + | "AvailabilityZone",
|
147 147 | 1,
|
148 148 | )
|
149 149 | .with_xml_name("availabilityZone");
|
150 150 | static HOST_MEMBER_AVAILABLE_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
151 151 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AvailableCapacity", "com.amazonaws.ec2", "Host"),
|
152 152 | ::aws_smithy_schema::ShapeType::Structure,
|
153 - | "available_capacity",
|
153 + | "AvailableCapacity",
|
154 154 | 2,
|
155 155 | )
|
156 156 | .with_xml_name("availableCapacity");
|
157 157 | static HOST_MEMBER_CLIENT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
158 158 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$ClientToken", "com.amazonaws.ec2", "Host"),
|
159 159 | ::aws_smithy_schema::ShapeType::String,
|
160 - | "client_token",
|
160 + | "ClientToken",
|
161 161 | 3,
|
162 162 | )
|
163 163 | .with_xml_name("clientToken");
|
164 164 | static HOST_MEMBER_HOST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
165 165 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$HostId", "com.amazonaws.ec2", "Host"),
|
166 166 | ::aws_smithy_schema::ShapeType::String,
|
167 - | "host_id",
|
167 + | "HostId",
|
168 168 | 4,
|
169 169 | )
|
170 170 | .with_xml_name("hostId");
|
171 171 | static HOST_MEMBER_HOST_PROPERTIES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
172 172 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$HostProperties", "com.amazonaws.ec2", "Host"),
|
173 173 | ::aws_smithy_schema::ShapeType::Structure,
|
174 - | "host_properties",
|
174 + | "HostProperties",
|
175 175 | 5,
|
176 176 | )
|
177 177 | .with_xml_name("hostProperties");
|
178 178 | static HOST_MEMBER_HOST_RESERVATION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
179 179 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$HostReservationId", "com.amazonaws.ec2", "Host"),
|
180 180 | ::aws_smithy_schema::ShapeType::String,
|
181 - | "host_reservation_id",
|
181 + | "HostReservationId",
|
182 182 | 6,
|
183 183 | )
|
184 184 | .with_xml_name("hostReservationId");
|
185 185 | static HOST_MEMBER_INSTANCES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
186 186 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$Instances", "com.amazonaws.ec2", "Host"),
|
187 187 | ::aws_smithy_schema::ShapeType::List,
|
188 - | "instances",
|
188 + | "Instances",
|
189 189 | 7,
|
190 190 | )
|
191 191 | .with_xml_name("instances");
|
192 192 | static HOST_MEMBER_STATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
193 193 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$State", "com.amazonaws.ec2", "Host"),
|
194 194 | ::aws_smithy_schema::ShapeType::String,
|
195 - | "state",
|
195 + | "State",
|
196 196 | 8,
|
197 197 | )
|
198 198 | .with_xml_name("state");
|
199 199 | static HOST_MEMBER_ALLOCATION_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
200 200 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AllocationTime", "com.amazonaws.ec2", "Host"),
|
201 201 | ::aws_smithy_schema::ShapeType::Timestamp,
|
202 - | "allocation_time",
|
202 + | "AllocationTime",
|
203 203 | 9,
|
204 204 | )
|
205 205 | .with_xml_name("allocationTime");
|
206 206 | static HOST_MEMBER_RELEASE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
207 207 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$ReleaseTime", "com.amazonaws.ec2", "Host"),
|
208 208 | ::aws_smithy_schema::ShapeType::Timestamp,
|
209 - | "release_time",
|
209 + | "ReleaseTime",
|
210 210 | 10,
|
211 211 | )
|
212 212 | .with_xml_name("releaseTime");
|
213 213 | static HOST_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
214 214 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$Tags", "com.amazonaws.ec2", "Host"),
|
215 215 | ::aws_smithy_schema::ShapeType::List,
|
216 - | "tags",
|
216 + | "Tags",
|
217 217 | 11,
|
218 218 | )
|
219 219 | .with_xml_name("tagSet");
|
220 220 | static HOST_MEMBER_HOST_RECOVERY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
221 221 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$HostRecovery", "com.amazonaws.ec2", "Host"),
|
222 222 | ::aws_smithy_schema::ShapeType::String,
|
223 - | "host_recovery",
|
223 + | "HostRecovery",
|
224 224 | 12,
|
225 225 | )
|
226 226 | .with_xml_name("hostRecovery");
|
227 227 | static HOST_MEMBER_ALLOWS_MULTIPLE_INSTANCE_TYPES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
228 228 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AllowsMultipleInstanceTypes", "com.amazonaws.ec2", "Host"),
|
229 229 | ::aws_smithy_schema::ShapeType::String,
|
230 - | "allows_multiple_instance_types",
|
230 + | "AllowsMultipleInstanceTypes",
|
231 231 | 13,
|
232 232 | )
|
233 233 | .with_xml_name("allowsMultipleInstanceTypes");
|
234 234 | static HOST_MEMBER_OWNER_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
235 235 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$OwnerId", "com.amazonaws.ec2", "Host"),
|
236 236 | ::aws_smithy_schema::ShapeType::String,
|
237 - | "owner_id",
|
237 + | "OwnerId",
|
238 238 | 14,
|
239 239 | )
|
240 240 | .with_xml_name("ownerId");
|
241 241 | static HOST_MEMBER_AVAILABILITY_ZONE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
242 242 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AvailabilityZoneId", "com.amazonaws.ec2", "Host"),
|
243 243 | ::aws_smithy_schema::ShapeType::String,
|
244 - | "availability_zone_id",
|
244 + | "AvailabilityZoneId",
|
245 245 | 15,
|
246 246 | )
|
247 247 | .with_xml_name("availabilityZoneId");
|
248 248 | static HOST_MEMBER_MEMBER_OF_SERVICE_LINKED_RESOURCE_GROUP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
249 249 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$MemberOfServiceLinkedResourceGroup", "com.amazonaws.ec2", "Host"),
|
250 250 | ::aws_smithy_schema::ShapeType::Boolean,
|
251 - | "member_of_service_linked_resource_group",
|
251 + | "MemberOfServiceLinkedResourceGroup",
|
252 252 | 16,
|
253 253 | )
|
254 254 | .with_xml_name("memberOfServiceLinkedResourceGroup");
|
255 255 | static HOST_MEMBER_OUTPOST_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
256 256 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$OutpostArn", "com.amazonaws.ec2", "Host"),
|
257 257 | ::aws_smithy_schema::ShapeType::String,
|
258 - | "outpost_arn",
|
258 + | "OutpostArn",
|
259 259 | 17,
|
260 260 | )
|
261 261 | .with_xml_name("outpostArn");
|
262 262 | static HOST_MEMBER_HOST_MAINTENANCE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
263 263 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$HostMaintenance", "com.amazonaws.ec2", "Host"),
|
264 264 | ::aws_smithy_schema::ShapeType::String,
|
265 - | "host_maintenance",
|
265 + | "HostMaintenance",
|
266 266 | 18,
|
267 267 | )
|
268 268 | .with_xml_name("hostMaintenance");
|
269 269 | static HOST_MEMBER_ASSET_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
270 270 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Host$AssetId", "com.amazonaws.ec2", "Host"),
|
271 271 | ::aws_smithy_schema::ShapeType::String,
|
272 - | "asset_id",
|
272 + | "AssetId",
|
273 273 | 19,
|
274 274 | )
|
275 275 | .with_xml_name("assetId");
|
276 276 | static HOST_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
277 277 | HOST_SCHEMA_ID,
|
278 278 | ::aws_smithy_schema::ShapeType::Structure,
|
279 279 | &[
|
280 280 | &HOST_MEMBER_AUTO_PLACEMENT,
|
281 281 | &HOST_MEMBER_AVAILABILITY_ZONE,
|
282 282 | &HOST_MEMBER_AVAILABLE_CAPACITY,
|
377 377 | ser.write_string(&HOST_MEMBER_HOST_MAINTENANCE, val.as_str())?;
|
378 378 | }
|
379 379 | if let Some(ref val) = self.asset_id {
|
380 380 | ser.write_string(&HOST_MEMBER_ASSET_ID, val)?;
|
381 381 | }
|
382 382 | Ok(())
|
383 383 | }
|
384 384 | }
|
385 385 | impl Host {
|
386 386 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
387 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
388 - | deserializer: &mut D,
|
387 + | pub fn deserialize(
|
388 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
389 389 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
390 390 | #[allow(unused_variables, unused_mut)]
|
391 391 | let mut builder = Self::builder();
|
392 392 | #[allow(
|
393 393 | unused_variables,
|
394 394 | unreachable_code,
|
395 395 | clippy::single_match,
|
396 396 | clippy::match_single_binding,
|
397 397 | clippy::diverging_sub_expression
|
398 398 | )]
|
399 - | deserializer.read_struct(&HOST_SCHEMA, (), |_, member, deser| {
|
399 + | deserializer.read_struct(&HOST_SCHEMA, &mut |member, deser| {
|
400 400 | match member.member_index() {
|
401 401 | Some(0) => {
|
402 402 | builder.auto_placement = Some(crate::types::AutoPlacement::from(deser.read_string(member)?.as_str()));
|
403 403 | }
|
404 404 | Some(1) => {
|
405 405 | builder.availability_zone = Some(deser.read_string(member)?);
|
406 406 | }
|
407 407 | Some(2) => {
|
408 408 | builder.available_capacity = Some(crate::types::AvailableCapacity::deserialize(deser)?);
|
409 409 | }
|
410 410 | Some(3) => {
|
411 411 | builder.client_token = Some(deser.read_string(member)?);
|
412 412 | }
|
413 413 | Some(4) => {
|
414 414 | builder.host_id = Some(deser.read_string(member)?);
|
415 415 | }
|
416 416 | Some(5) => {
|
417 417 | builder.host_properties = Some(crate::types::HostProperties::deserialize(deser)?);
|
418 418 | }
|
419 419 | Some(6) => {
|
420 420 | builder.host_reservation_id = Some(deser.read_string(member)?);
|
421 421 | }
|
422 422 | Some(7) => {
|
423 423 | builder.instances = Some({
|
424 - | let container = if let Some(cap) = deser.container_size() {
|
425 - | Vec::with_capacity(cap)
|
426 - | } else {
|
427 - | Vec::new()
|
428 - | };
|
429 - | deser.read_list(member, container, |mut list, deser| {
|
430 - | list.push(crate::types::HostInstance::deserialize(deser)?);
|
431 - | Ok(list)
|
432 - | })?
|
424 + | let mut container = Vec::new();
|
425 + | deser.read_list(member, &mut |deser| {
|
426 + | container.push(crate::types::HostInstance::deserialize(deser)?);
|
427 + | Ok(())
|
428 + | })?;
|
429 + | container
|
433 430 | });
|
434 431 | }
|
435 432 | Some(8) => {
|
436 433 | builder.state = Some(crate::types::AllocationState::from(deser.read_string(member)?.as_str()));
|
437 434 | }
|
438 435 | Some(9) => {
|
439 436 | builder.allocation_time = Some(deser.read_timestamp(member)?);
|
440 437 | }
|
441 438 | Some(10) => {
|
442 439 | builder.release_time = Some(deser.read_timestamp(member)?);
|
443 440 | }
|
444 441 | Some(11) => {
|
445 442 | builder.tags = Some({
|
446 - | let container = if let Some(cap) = deser.container_size() {
|
447 - | Vec::with_capacity(cap)
|
448 - | } else {
|
449 - | Vec::new()
|
450 - | };
|
451 - | deser.read_list(member, container, |mut list, deser| {
|
452 - | list.push(crate::types::Tag::deserialize(deser)?);
|
453 - | Ok(list)
|
454 - | })?
|
443 + | let mut container = Vec::new();
|
444 + | deser.read_list(member, &mut |deser| {
|
445 + | container.push(crate::types::Tag::deserialize(deser)?);
|
446 + | Ok(())
|
447 + | })?;
|
448 + | container
|
455 449 | });
|
456 450 | }
|
457 451 | Some(12) => {
|
458 452 | builder.host_recovery = Some(crate::types::HostRecovery::from(deser.read_string(member)?.as_str()));
|
459 453 | }
|
460 454 | Some(13) => {
|
461 455 | builder.allows_multiple_instance_types =
|
462 456 | Some(crate::types::AllowsMultipleInstanceTypes::from(deser.read_string(member)?.as_str()));
|
463 457 | }
|
464 458 | Some(14) => {
|
465 459 | builder.owner_id = Some(deser.read_string(member)?);
|
466 460 | }
|
467 461 | Some(15) => {
|
468 462 | builder.availability_zone_id = Some(deser.read_string(member)?);
|
469 463 | }
|
470 464 | Some(16) => {
|
471 465 | builder.member_of_service_linked_resource_group = Some(deser.read_boolean(member)?);
|
472 466 | }
|
473 467 | Some(17) => {
|
474 468 | builder.outpost_arn = Some(deser.read_string(member)?);
|
475 469 | }
|
476 470 | Some(18) => {
|
477 471 | builder.host_maintenance = Some(crate::types::HostMaintenance::from(deser.read_string(member)?.as_str()));
|
478 472 | }
|
479 473 | Some(19) => {
|
480 474 | builder.asset_id = Some(deser.read_string(member)?);
|
481 475 | }
|
482 476 | _ => {}
|
483 477 | }
|
484 478 | Ok(())
|
485 479 | })?;
|
486 480 | Ok(builder.build())
|
487 481 | }
|
488 482 | }
|
483 + | impl Host {
|
484 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
485 + | pub fn deserialize_with_response(
|
486 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
487 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
488 + | _status: u16,
|
489 + | _body: &[u8],
|
490 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
491 + | Self::deserialize(deserializer)
|
492 + | }
|
493 + | }
|
489 494 | impl Host {
|
490 495 | /// Creates a new builder-style object to manufacture [`Host`](crate::types::Host).
|
491 496 | pub fn builder() -> crate::types::builders::HostBuilder {
|
492 497 | crate::types::builders::HostBuilder::default()
|
493 498 | }
|
494 499 | }
|
495 500 |
|
496 501 | /// A builder for [`Host`](crate::types::Host).
|
497 502 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
498 503 | #[non_exhaustive]
|
499 504 | pub struct HostBuilder {
|
500 505 | pub(crate) auto_placement: ::std::option::Option<crate::types::AutoPlacement>,
|
501 506 | pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
|
502 507 | pub(crate) available_capacity: ::std::option::Option<crate::types::AvailableCapacity>,
|
503 508 | pub(crate) client_token: ::std::option::Option<::std::string::String>,
|
504 509 | pub(crate) host_id: ::std::option::Option<::std::string::String>,
|
505 510 | pub(crate) host_properties: ::std::option::Option<crate::types::HostProperties>,
|
506 511 | pub(crate) host_reservation_id: ::std::option::Option<::std::string::String>,
|
507 512 | pub(crate) instances: ::std::option::Option<::std::vec::Vec<crate::types::HostInstance>>,
|
508 513 | pub(crate) state: ::std::option::Option<crate::types::AllocationState>,
|
509 514 | pub(crate) allocation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
510 515 | pub(crate) release_time: ::std::option::Option<::aws_smithy_types::DateTime>,
|
511 516 | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
|
512 517 | pub(crate) host_recovery: ::std::option::Option<crate::types::HostRecovery>,
|
513 518 | pub(crate) allows_multiple_instance_types: ::std::option::Option<crate::types::AllowsMultipleInstanceTypes>,
|
514 519 | pub(crate) owner_id: ::std::option::Option<::std::string::String>,
|
515 520 | pub(crate) availability_zone_id: ::std::option::Option<::std::string::String>,
|
516 521 | pub(crate) member_of_service_linked_resource_group: ::std::option::Option<bool>,
|
517 522 | pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
|
518 523 | pub(crate) host_maintenance: ::std::option::Option<crate::types::HostMaintenance>,
|