1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 |
|
3 3 | /// <p>(Private hosted zones only) A complex type that contains information about an Amazon VPC.</p>
|
4 4 | /// <p>If you associate a private hosted zone with an Amazon VPC when you make a <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateHostedZone.html">CreateHostedZone</a> request, the following parameters are also required.</p>
|
5 5 | #[non_exhaustive]
|
6 6 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7 7 | pub struct Vpc {
|
8 8 | /// <p>(Private hosted zones only) The region that an Amazon VPC was created in.</p>
|
9 9 | pub vpc_region: ::std::option::Option<crate::types::VpcRegion>,
|
10 10 | /// <p>(Private hosted zones only) The ID of an Amazon VPC.</p>
|
11 11 | pub vpc_id: ::std::option::Option<::std::string::String>,
|
12 12 | }
|
13 13 | impl Vpc {
|
14 14 | /// <p>(Private hosted zones only) The region that an Amazon VPC was created in.</p>
|
15 15 | pub fn vpc_region(&self) -> ::std::option::Option<&crate::types::VpcRegion> {
|
16 16 | self.vpc_region.as_ref()
|
17 17 | }
|
18 18 | /// <p>(Private hosted zones only) The ID of an Amazon VPC.</p>
|
19 19 | pub fn vpc_id(&self) -> ::std::option::Option<&str> {
|
20 20 | self.vpc_id.as_deref()
|
21 21 | }
|
22 22 | }
|
23 23 | static VPC_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
24 24 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.route53#VPC", "com.amazonaws.route53", "VPC");
|
25 25 | static VPC_MEMBER_VPC_REGION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
26 26 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.route53#VPC$VPCRegion", "com.amazonaws.route53", "VPC"),
|
27 27 | ::aws_smithy_schema::ShapeType::String,
|
28 - | "vpc_region",
|
28 + | "VPCRegion",
|
29 29 | 0,
|
30 30 | );
|
31 31 | static VPC_MEMBER_VPC_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
32 32 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.route53#VPC$VPCId", "com.amazonaws.route53", "VPC"),
|
33 33 | ::aws_smithy_schema::ShapeType::String,
|
34 - | "vpc_id",
|
34 + | "VPCId",
|
35 35 | 1,
|
36 36 | );
|
37 37 | static VPC_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
38 38 | VPC_SCHEMA_ID,
|
39 39 | ::aws_smithy_schema::ShapeType::Structure,
|
40 40 | &[&VPC_MEMBER_VPC_REGION, &VPC_MEMBER_VPC_ID],
|
41 41 | );
|
42 42 | impl Vpc {
|
43 43 | /// The schema for this shape.
|
44 44 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &VPC_SCHEMA;
|
45 45 | }
|
46 46 | impl ::aws_smithy_schema::serde::SerializableStruct for Vpc {
|
47 47 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
48 48 | fn serialize_members(
|
49 49 | &self,
|
50 50 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
51 51 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
52 52 | if let Some(ref val) = self.vpc_region {
|
53 53 | ser.write_string(&VPC_MEMBER_VPC_REGION, val.as_str())?;
|
54 54 | }
|
55 55 | if let Some(ref val) = self.vpc_id {
|
56 56 | ser.write_string(&VPC_MEMBER_VPC_ID, val)?;
|
57 57 | }
|
58 58 | Ok(())
|
59 59 | }
|
60 60 | }
|
61 61 | impl Vpc {
|
62 62 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
63 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
64 - | deserializer: &mut D,
|
63 + | pub fn deserialize(
|
64 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
65 65 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
66 66 | #[allow(unused_variables, unused_mut)]
|
67 67 | let mut builder = Self::builder();
|
68 68 | #[allow(
|
69 69 | unused_variables,
|
70 70 | unreachable_code,
|
71 71 | clippy::single_match,
|
72 72 | clippy::match_single_binding,
|
73 73 | clippy::diverging_sub_expression
|
74 74 | )]
|
75 - | deserializer.read_struct(&VPC_SCHEMA, (), |_, member, deser| {
|
75 + | deserializer.read_struct(&VPC_SCHEMA, &mut |member, deser| {
|
76 76 | match member.member_index() {
|
77 77 | Some(0) => {
|
78 78 | builder.vpc_region = Some(crate::types::VpcRegion::from(deser.read_string(member)?.as_str()));
|
79 79 | }
|
80 80 | Some(1) => {
|
81 81 | builder.vpc_id = Some(deser.read_string(member)?);
|
82 82 | }
|
83 83 | _ => {}
|
84 84 | }
|
85 85 | Ok(())
|
86 86 | })?;
|
87 87 | Ok(builder.build())
|
88 88 | }
|
89 89 | }
|
90 + | impl Vpc {
|
91 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
92 + | pub fn deserialize_with_response(
|
93 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
94 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
95 + | _status: u16,
|
96 + | _body: &[u8],
|
97 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
98 + | Self::deserialize(deserializer)
|
99 + | }
|
100 + | }
|
90 101 | impl Vpc {
|
91 102 | /// Creates a new builder-style object to manufacture [`Vpc`](crate::types::Vpc).
|
92 103 | pub fn builder() -> crate::types::builders::VpcBuilder {
|
93 104 | crate::types::builders::VpcBuilder::default()
|
94 105 | }
|
95 106 | }
|
96 107 |
|
97 108 | /// A builder for [`Vpc`](crate::types::Vpc).
|
98 109 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
99 110 | #[non_exhaustive]
|
100 111 | pub struct VpcBuilder {
|
101 112 | pub(crate) vpc_region: ::std::option::Option<crate::types::VpcRegion>,
|
102 113 | pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
|
103 114 | }
|
104 115 | impl VpcBuilder {
|
105 116 | /// <p>(Private hosted zones only) The region that an Amazon VPC was created in.</p>
|
106 117 | pub fn vpc_region(mut self, input: crate::types::VpcRegion) -> Self {
|
107 118 | self.vpc_region = ::std::option::Option::Some(input);
|
108 119 | self
|
109 120 | }
|
110 121 | /// <p>(Private hosted zones only) The region that an Amazon VPC was created in.</p>
|
111 122 | pub fn set_vpc_region(mut self, input: ::std::option::Option<crate::types::VpcRegion>) -> Self {
|
112 123 | self.vpc_region = input;
|
113 124 | self
|
114 125 | }
|
115 126 | /// <p>(Private hosted zones only) The region that an Amazon VPC was created in.</p>
|
116 127 | pub fn get_vpc_region(&self) -> &::std::option::Option<crate::types::VpcRegion> {
|
117 128 | &self.vpc_region
|
118 129 | }
|
119 130 | /// <p>(Private hosted zones only) The ID of an Amazon VPC.</p>
|