161 161 | /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
|
162 162 | pub fn map_public_ip_on_launch(&self) -> ::std::option::Option<bool> {
|
163 163 | self.map_public_ip_on_launch
|
164 164 | }
|
165 165 | }
|
166 166 | static SUBNET_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
167 167 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet", "com.amazonaws.ec2", "Subnet");
|
168 168 | static SUBNET_MEMBER_AVAILABILITY_ZONE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
169 169 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$AvailabilityZoneId", "com.amazonaws.ec2", "Subnet"),
|
170 170 | ::aws_smithy_schema::ShapeType::String,
|
171 - | "availability_zone_id",
|
171 + | "AvailabilityZoneId",
|
172 172 | 0,
|
173 173 | )
|
174 174 | .with_xml_name("availabilityZoneId");
|
175 175 | static SUBNET_MEMBER_ENABLE_LNI_AT_DEVICE_INDEX: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
176 176 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$EnableLniAtDeviceIndex", "com.amazonaws.ec2", "Subnet"),
|
177 177 | ::aws_smithy_schema::ShapeType::Integer,
|
178 - | "enable_lni_at_device_index",
|
178 + | "EnableLniAtDeviceIndex",
|
179 179 | 1,
|
180 180 | )
|
181 181 | .with_xml_name("enableLniAtDeviceIndex");
|
182 182 | static SUBNET_MEMBER_MAP_CUSTOMER_OWNED_IP_ON_LAUNCH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
183 183 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$MapCustomerOwnedIpOnLaunch", "com.amazonaws.ec2", "Subnet"),
|
184 184 | ::aws_smithy_schema::ShapeType::Boolean,
|
185 - | "map_customer_owned_ip_on_launch",
|
185 + | "MapCustomerOwnedIpOnLaunch",
|
186 186 | 2,
|
187 187 | )
|
188 188 | .with_xml_name("mapCustomerOwnedIpOnLaunch");
|
189 189 | static SUBNET_MEMBER_CUSTOMER_OWNED_IPV4_POOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
190 190 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$CustomerOwnedIpv4Pool", "com.amazonaws.ec2", "Subnet"),
|
191 191 | ::aws_smithy_schema::ShapeType::String,
|
192 - | "customer_owned_ipv4_pool",
|
192 + | "CustomerOwnedIpv4Pool",
|
193 193 | 3,
|
194 194 | )
|
195 195 | .with_xml_name("customerOwnedIpv4Pool");
|
196 196 | static SUBNET_MEMBER_OWNER_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
197 197 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$OwnerId", "com.amazonaws.ec2", "Subnet"),
|
198 198 | ::aws_smithy_schema::ShapeType::String,
|
199 - | "owner_id",
|
199 + | "OwnerId",
|
200 200 | 4,
|
201 201 | )
|
202 202 | .with_xml_name("ownerId");
|
203 203 | static SUBNET_MEMBER_ASSIGN_IPV6_ADDRESS_ON_CREATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
204 204 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$AssignIpv6AddressOnCreation", "com.amazonaws.ec2", "Subnet"),
|
205 205 | ::aws_smithy_schema::ShapeType::Boolean,
|
206 - | "assign_ipv6_address_on_creation",
|
206 + | "AssignIpv6AddressOnCreation",
|
207 207 | 5,
|
208 208 | )
|
209 209 | .with_xml_name("assignIpv6AddressOnCreation");
|
210 210 | static SUBNET_MEMBER_IPV6_CIDR_BLOCK_ASSOCIATION_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
211 211 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$Ipv6CidrBlockAssociationSet", "com.amazonaws.ec2", "Subnet"),
|
212 212 | ::aws_smithy_schema::ShapeType::List,
|
213 - | "ipv6_cidr_block_association_set",
|
213 + | "Ipv6CidrBlockAssociationSet",
|
214 214 | 6,
|
215 215 | )
|
216 216 | .with_xml_name("ipv6CidrBlockAssociationSet");
|
217 217 | static SUBNET_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
218 218 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$Tags", "com.amazonaws.ec2", "Subnet"),
|
219 219 | ::aws_smithy_schema::ShapeType::List,
|
220 - | "tags",
|
220 + | "Tags",
|
221 221 | 7,
|
222 222 | )
|
223 223 | .with_xml_name("tagSet");
|
224 224 | static SUBNET_MEMBER_SUBNET_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
225 225 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$SubnetArn", "com.amazonaws.ec2", "Subnet"),
|
226 226 | ::aws_smithy_schema::ShapeType::String,
|
227 - | "subnet_arn",
|
227 + | "SubnetArn",
|
228 228 | 8,
|
229 229 | )
|
230 230 | .with_xml_name("subnetArn");
|
231 231 | static SUBNET_MEMBER_OUTPOST_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
232 232 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$OutpostArn", "com.amazonaws.ec2", "Subnet"),
|
233 233 | ::aws_smithy_schema::ShapeType::String,
|
234 - | "outpost_arn",
|
234 + | "OutpostArn",
|
235 235 | 9,
|
236 236 | )
|
237 237 | .with_xml_name("outpostArn");
|
238 238 | static SUBNET_MEMBER_ENABLE_DNS64: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
239 239 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$EnableDns64", "com.amazonaws.ec2", "Subnet"),
|
240 240 | ::aws_smithy_schema::ShapeType::Boolean,
|
241 - | "enable_dns64",
|
241 + | "EnableDns64",
|
242 242 | 10,
|
243 243 | )
|
244 244 | .with_xml_name("enableDns64");
|
245 245 | static SUBNET_MEMBER_IPV6_NATIVE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
246 246 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$Ipv6Native", "com.amazonaws.ec2", "Subnet"),
|
247 247 | ::aws_smithy_schema::ShapeType::Boolean,
|
248 - | "ipv6_native",
|
248 + | "Ipv6Native",
|
249 249 | 11,
|
250 250 | )
|
251 251 | .with_xml_name("ipv6Native");
|
252 252 | static SUBNET_MEMBER_PRIVATE_DNS_NAME_OPTIONS_ON_LAUNCH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
253 253 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$PrivateDnsNameOptionsOnLaunch", "com.amazonaws.ec2", "Subnet"),
|
254 254 | ::aws_smithy_schema::ShapeType::Structure,
|
255 - | "private_dns_name_options_on_launch",
|
255 + | "PrivateDnsNameOptionsOnLaunch",
|
256 256 | 12,
|
257 257 | )
|
258 258 | .with_xml_name("privateDnsNameOptionsOnLaunch");
|
259 259 | static SUBNET_MEMBER_BLOCK_PUBLIC_ACCESS_STATES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
260 260 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$BlockPublicAccessStates", "com.amazonaws.ec2", "Subnet"),
|
261 261 | ::aws_smithy_schema::ShapeType::Structure,
|
262 - | "block_public_access_states",
|
262 + | "BlockPublicAccessStates",
|
263 263 | 13,
|
264 264 | )
|
265 265 | .with_xml_name("blockPublicAccessStates");
|
266 266 | static SUBNET_MEMBER_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
267 267 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$Type", "com.amazonaws.ec2", "Subnet"),
|
268 268 | ::aws_smithy_schema::ShapeType::String,
|
269 - | "r##type",
|
269 + | "Type",
|
270 270 | 14,
|
271 271 | )
|
272 272 | .with_xml_name("type");
|
273 273 | static SUBNET_MEMBER_SUBNET_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
274 274 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$SubnetId", "com.amazonaws.ec2", "Subnet"),
|
275 275 | ::aws_smithy_schema::ShapeType::String,
|
276 - | "subnet_id",
|
276 + | "SubnetId",
|
277 277 | 15,
|
278 278 | )
|
279 279 | .with_xml_name("subnetId");
|
280 280 | static SUBNET_MEMBER_STATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
281 281 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$State", "com.amazonaws.ec2", "Subnet"),
|
282 282 | ::aws_smithy_schema::ShapeType::String,
|
283 - | "state",
|
283 + | "State",
|
284 284 | 16,
|
285 285 | )
|
286 286 | .with_xml_name("state");
|
287 287 | static SUBNET_MEMBER_VPC_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
288 288 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$VpcId", "com.amazonaws.ec2", "Subnet"),
|
289 289 | ::aws_smithy_schema::ShapeType::String,
|
290 - | "vpc_id",
|
290 + | "VpcId",
|
291 291 | 17,
|
292 292 | )
|
293 293 | .with_xml_name("vpcId");
|
294 294 | static SUBNET_MEMBER_CIDR_BLOCK: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
295 295 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$CidrBlock", "com.amazonaws.ec2", "Subnet"),
|
296 296 | ::aws_smithy_schema::ShapeType::String,
|
297 - | "cidr_block",
|
297 + | "CidrBlock",
|
298 298 | 18,
|
299 299 | )
|
300 300 | .with_xml_name("cidrBlock");
|
301 301 | static SUBNET_MEMBER_AVAILABLE_IP_ADDRESS_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
302 302 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$AvailableIpAddressCount", "com.amazonaws.ec2", "Subnet"),
|
303 303 | ::aws_smithy_schema::ShapeType::Integer,
|
304 - | "available_ip_address_count",
|
304 + | "AvailableIpAddressCount",
|
305 305 | 19,
|
306 306 | )
|
307 307 | .with_xml_name("availableIpAddressCount");
|
308 308 | static SUBNET_MEMBER_AVAILABILITY_ZONE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
309 309 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$AvailabilityZone", "com.amazonaws.ec2", "Subnet"),
|
310 310 | ::aws_smithy_schema::ShapeType::String,
|
311 - | "availability_zone",
|
311 + | "AvailabilityZone",
|
312 312 | 20,
|
313 313 | )
|
314 314 | .with_xml_name("availabilityZone");
|
315 315 | static SUBNET_MEMBER_DEFAULT_FOR_AZ: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
316 316 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$DefaultForAz", "com.amazonaws.ec2", "Subnet"),
|
317 317 | ::aws_smithy_schema::ShapeType::Boolean,
|
318 - | "default_for_az",
|
318 + | "DefaultForAz",
|
319 319 | 21,
|
320 320 | )
|
321 321 | .with_xml_name("defaultForAz");
|
322 322 | static SUBNET_MEMBER_MAP_PUBLIC_IP_ON_LAUNCH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
323 323 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#Subnet$MapPublicIpOnLaunch", "com.amazonaws.ec2", "Subnet"),
|
324 324 | ::aws_smithy_schema::ShapeType::Boolean,
|
325 - | "map_public_ip_on_launch",
|
325 + | "MapPublicIpOnLaunch",
|
326 326 | 22,
|
327 327 | )
|
328 328 | .with_xml_name("mapPublicIpOnLaunch");
|
329 329 | static SUBNET_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
330 330 | SUBNET_SCHEMA_ID,
|
331 331 | ::aws_smithy_schema::ShapeType::Structure,
|
332 332 | &[
|
333 333 | &SUBNET_MEMBER_AVAILABILITY_ZONE_ID,
|
334 334 | &SUBNET_MEMBER_ENABLE_LNI_AT_DEVICE_INDEX,
|
335 335 | &SUBNET_MEMBER_MAP_CUSTOMER_OWNED_IP_ON_LAUNCH,
|
445 445 | ser.write_boolean(&SUBNET_MEMBER_DEFAULT_FOR_AZ, *val)?;
|
446 446 | }
|
447 447 | if let Some(ref val) = self.map_public_ip_on_launch {
|
448 448 | ser.write_boolean(&SUBNET_MEMBER_MAP_PUBLIC_IP_ON_LAUNCH, *val)?;
|
449 449 | }
|
450 450 | Ok(())
|
451 451 | }
|
452 452 | }
|
453 453 | impl Subnet {
|
454 454 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
455 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
456 - | deserializer: &mut D,
|
455 + | pub fn deserialize(
|
456 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
457 457 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
458 458 | #[allow(unused_variables, unused_mut)]
|
459 459 | let mut builder = Self::builder();
|
460 460 | #[allow(
|
461 461 | unused_variables,
|
462 462 | unreachable_code,
|
463 463 | clippy::single_match,
|
464 464 | clippy::match_single_binding,
|
465 465 | clippy::diverging_sub_expression
|
466 466 | )]
|
467 - | deserializer.read_struct(&SUBNET_SCHEMA, (), |_, member, deser| {
|
467 + | deserializer.read_struct(&SUBNET_SCHEMA, &mut |member, deser| {
|
468 468 | match member.member_index() {
|
469 469 | Some(0) => {
|
470 470 | builder.availability_zone_id = Some(deser.read_string(member)?);
|
471 471 | }
|
472 472 | Some(1) => {
|
473 473 | builder.enable_lni_at_device_index = Some(deser.read_integer(member)?);
|
474 474 | }
|
475 475 | Some(2) => {
|
476 476 | builder.map_customer_owned_ip_on_launch = Some(deser.read_boolean(member)?);
|
477 477 | }
|
478 478 | Some(3) => {
|
479 479 | builder.customer_owned_ipv4_pool = Some(deser.read_string(member)?);
|
480 480 | }
|
481 481 | Some(4) => {
|
482 482 | builder.owner_id = Some(deser.read_string(member)?);
|
483 483 | }
|
484 484 | Some(5) => {
|
485 485 | builder.assign_ipv6_address_on_creation = Some(deser.read_boolean(member)?);
|
486 486 | }
|
487 487 | Some(6) => {
|
488 488 | builder.ipv6_cidr_block_association_set = Some({
|
489 - | let container = if let Some(cap) = deser.container_size() {
|
490 - | Vec::with_capacity(cap)
|
491 - | } else {
|
492 - | Vec::new()
|
493 - | };
|
494 - | deser.read_list(member, container, |mut list, deser| {
|
495 - | list.push(crate::types::SubnetIpv6CidrBlockAssociation::deserialize(deser)?);
|
496 - | Ok(list)
|
497 - | })?
|
489 + | let mut container = Vec::new();
|
490 + | deser.read_list(member, &mut |deser| {
|
491 + | container.push(crate::types::SubnetIpv6CidrBlockAssociation::deserialize(deser)?);
|
492 + | Ok(())
|
493 + | })?;
|
494 + | container
|
498 495 | });
|
499 496 | }
|
500 497 | Some(7) => {
|
501 498 | builder.tags = Some({
|
502 - | let container = if let Some(cap) = deser.container_size() {
|
503 - | Vec::with_capacity(cap)
|
504 - | } else {
|
505 - | Vec::new()
|
506 - | };
|
507 - | deser.read_list(member, container, |mut list, deser| {
|
508 - | list.push(crate::types::Tag::deserialize(deser)?);
|
509 - | Ok(list)
|
510 - | })?
|
499 + | let mut container = Vec::new();
|
500 + | deser.read_list(member, &mut |deser| {
|
501 + | container.push(crate::types::Tag::deserialize(deser)?);
|
502 + | Ok(())
|
503 + | })?;
|
504 + | container
|
511 505 | });
|
512 506 | }
|
513 507 | Some(8) => {
|
514 508 | builder.subnet_arn = Some(deser.read_string(member)?);
|
515 509 | }
|
516 510 | Some(9) => {
|
517 511 | builder.outpost_arn = Some(deser.read_string(member)?);
|
518 512 | }
|
519 513 | Some(10) => {
|
520 514 | builder.enable_dns64 = Some(deser.read_boolean(member)?);
|
521 515 | }
|
522 516 | Some(11) => {
|
523 517 | builder.ipv6_native = Some(deser.read_boolean(member)?);
|
524 518 | }
|
525 519 | Some(12) => {
|
526 520 | builder.private_dns_name_options_on_launch = Some(crate::types::PrivateDnsNameOptionsOnLaunch::deserialize(deser)?);
|
527 521 | }
|
528 522 | Some(13) => {
|
529 523 | builder.block_public_access_states = Some(crate::types::BlockPublicAccessStates::deserialize(deser)?);
|
530 524 | }
|
531 525 | Some(14) => {
|
532 526 | builder.r#type = Some(deser.read_string(member)?);
|
533 527 | }
|
534 528 | Some(15) => {
|
535 529 | builder.subnet_id = Some(deser.read_string(member)?);
|
536 530 | }
|
537 531 | Some(16) => {
|
538 532 | builder.state = Some(crate::types::SubnetState::from(deser.read_string(member)?.as_str()));
|
539 533 | }
|
540 534 | Some(17) => {
|
541 535 | builder.vpc_id = Some(deser.read_string(member)?);
|
542 536 | }
|
543 537 | Some(18) => {
|
544 538 | builder.cidr_block = Some(deser.read_string(member)?);
|
545 539 | }
|
546 540 | Some(19) => {
|
547 541 | builder.available_ip_address_count = Some(deser.read_integer(member)?);
|
548 542 | }
|
549 543 | Some(20) => {
|
550 544 | builder.availability_zone = Some(deser.read_string(member)?);
|
551 545 | }
|
552 546 | Some(21) => {
|
553 547 | builder.default_for_az = Some(deser.read_boolean(member)?);
|
554 548 | }
|
555 549 | Some(22) => {
|
556 550 | builder.map_public_ip_on_launch = Some(deser.read_boolean(member)?);
|
557 551 | }
|
558 552 | _ => {}
|
559 553 | }
|
560 554 | Ok(())
|
561 555 | })?;
|
562 556 | Ok(builder.build())
|
563 557 | }
|
564 558 | }
|
559 + | impl Subnet {
|
560 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
561 + | pub fn deserialize_with_response(
|
562 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
563 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
564 + | _status: u16,
|
565 + | _body: &[u8],
|
566 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
567 + | Self::deserialize(deserializer)
|
568 + | }
|
569 + | }
|
565 570 | impl Subnet {
|
566 571 | /// Creates a new builder-style object to manufacture [`Subnet`](crate::types::Subnet).
|
567 572 | pub fn builder() -> crate::types::builders::SubnetBuilder {
|
568 573 | crate::types::builders::SubnetBuilder::default()
|
569 574 | }
|
570 575 | }
|
571 576 |
|
572 577 | /// A builder for [`Subnet`](crate::types::Subnet).
|
573 578 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
574 579 | #[non_exhaustive]
|