43 43 | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_groups.is_none()`.
|
44 44 | pub fn security_groups(&self) -> &[::std::string::String] {
|
45 45 | self.security_groups.as_deref().unwrap_or_default()
|
46 46 | }
|
47 47 | }
|
48 48 | static TARGETNETWORK_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
49 49 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#TargetNetwork", "com.amazonaws.ec2", "TargetNetwork");
|
50 50 | static TARGETNETWORK_MEMBER_ASSOCIATION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
51 51 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#TargetNetwork$AssociationId", "com.amazonaws.ec2", "TargetNetwork"),
|
52 52 | ::aws_smithy_schema::ShapeType::String,
|
53 - | "association_id",
|
53 + | "AssociationId",
|
54 54 | 0,
|
55 55 | )
|
56 56 | .with_xml_name("associationId");
|
57 57 | static TARGETNETWORK_MEMBER_VPC_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
58 58 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#TargetNetwork$VpcId", "com.amazonaws.ec2", "TargetNetwork"),
|
59 59 | ::aws_smithy_schema::ShapeType::String,
|
60 - | "vpc_id",
|
60 + | "VpcId",
|
61 61 | 1,
|
62 62 | )
|
63 63 | .with_xml_name("vpcId");
|
64 64 | static TARGETNETWORK_MEMBER_TARGET_NETWORK_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
65 65 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#TargetNetwork$TargetNetworkId", "com.amazonaws.ec2", "TargetNetwork"),
|
66 66 | ::aws_smithy_schema::ShapeType::String,
|
67 - | "target_network_id",
|
67 + | "TargetNetworkId",
|
68 68 | 2,
|
69 69 | )
|
70 70 | .with_xml_name("targetNetworkId");
|
71 71 | static TARGETNETWORK_MEMBER_CLIENT_VPN_ENDPOINT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
72 72 | ::aws_smithy_schema::ShapeId::from_static(
|
73 73 | "com.amazonaws.ec2#TargetNetwork$ClientVpnEndpointId",
|
74 74 | "com.amazonaws.ec2",
|
75 75 | "TargetNetwork",
|
76 76 | ),
|
77 77 | ::aws_smithy_schema::ShapeType::String,
|
78 - | "client_vpn_endpoint_id",
|
78 + | "ClientVpnEndpointId",
|
79 79 | 3,
|
80 80 | )
|
81 81 | .with_xml_name("clientVpnEndpointId");
|
82 82 | static TARGETNETWORK_MEMBER_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
83 83 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#TargetNetwork$Status", "com.amazonaws.ec2", "TargetNetwork"),
|
84 84 | ::aws_smithy_schema::ShapeType::Structure,
|
85 - | "status",
|
85 + | "Status",
|
86 86 | 4,
|
87 87 | )
|
88 88 | .with_xml_name("status");
|
89 89 | static TARGETNETWORK_MEMBER_SECURITY_GROUPS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
90 90 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#TargetNetwork$SecurityGroups", "com.amazonaws.ec2", "TargetNetwork"),
|
91 91 | ::aws_smithy_schema::ShapeType::List,
|
92 - | "security_groups",
|
92 + | "SecurityGroups",
|
93 93 | 5,
|
94 94 | )
|
95 95 | .with_xml_name("securityGroups");
|
96 96 | static TARGETNETWORK_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
97 97 | TARGETNETWORK_SCHEMA_ID,
|
98 98 | ::aws_smithy_schema::ShapeType::Structure,
|
99 99 | &[
|
100 100 | &TARGETNETWORK_MEMBER_ASSOCIATION_ID,
|
101 101 | &TARGETNETWORK_MEMBER_VPC_ID,
|
102 102 | &TARGETNETWORK_MEMBER_TARGET_NETWORK_ID,
|
103 103 | &TARGETNETWORK_MEMBER_CLIENT_VPN_ENDPOINT_ID,
|
104 104 | &TARGETNETWORK_MEMBER_STATUS,
|
105 105 | &TARGETNETWORK_MEMBER_SECURITY_GROUPS,
|
106 106 | ],
|
107 107 | );
|
108 108 | impl TargetNetwork {
|
109 109 | /// The schema for this shape.
|
110 110 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TARGETNETWORK_SCHEMA;
|
111 111 | }
|
112 112 | impl ::aws_smithy_schema::serde::SerializableStruct for TargetNetwork {
|
113 113 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
114 114 | fn serialize_members(
|
115 115 | &self,
|
116 116 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
117 117 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
118 118 | if let Some(ref val) = self.association_id {
|
119 119 | ser.write_string(&TARGETNETWORK_MEMBER_ASSOCIATION_ID, val)?;
|
120 120 | }
|
121 121 | if let Some(ref val) = self.vpc_id {
|
122 122 | ser.write_string(&TARGETNETWORK_MEMBER_VPC_ID, val)?;
|
123 123 | }
|
124 124 | if let Some(ref val) = self.target_network_id {
|
125 125 | ser.write_string(&TARGETNETWORK_MEMBER_TARGET_NETWORK_ID, val)?;
|
126 126 | }
|
127 127 | if let Some(ref val) = self.client_vpn_endpoint_id {
|
128 128 | ser.write_string(&TARGETNETWORK_MEMBER_CLIENT_VPN_ENDPOINT_ID, val)?;
|
129 129 | }
|
130 130 | if let Some(ref val) = self.status {
|
131 131 | ser.write_struct(&TARGETNETWORK_MEMBER_STATUS, val)?;
|
132 132 | }
|
133 133 | if let Some(ref val) = self.security_groups {
|
134 134 | ser.write_list(
|
135 135 | &TARGETNETWORK_MEMBER_SECURITY_GROUPS,
|
136 136 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
137 137 | for item in val {
|
138 138 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
139 139 | }
|
140 140 | Ok(())
|
141 141 | },
|
142 142 | )?;
|
143 143 | }
|
144 144 | Ok(())
|
145 145 | }
|
146 146 | }
|
147 147 | impl TargetNetwork {
|
148 148 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
149 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
150 - | deserializer: &mut D,
|
149 + | pub fn deserialize(
|
150 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
151 151 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
152 152 | #[allow(unused_variables, unused_mut)]
|
153 153 | let mut builder = Self::builder();
|
154 154 | #[allow(
|
155 155 | unused_variables,
|
156 156 | unreachable_code,
|
157 157 | clippy::single_match,
|
158 158 | clippy::match_single_binding,
|
159 159 | clippy::diverging_sub_expression
|
160 160 | )]
|
161 - | deserializer.read_struct(&TARGETNETWORK_SCHEMA, (), |_, member, deser| {
|
161 + | deserializer.read_struct(&TARGETNETWORK_SCHEMA, &mut |member, deser| {
|
162 162 | match member.member_index() {
|
163 163 | Some(0) => {
|
164 164 | builder.association_id = Some(deser.read_string(member)?);
|
165 165 | }
|
166 166 | Some(1) => {
|
167 167 | builder.vpc_id = Some(deser.read_string(member)?);
|
168 168 | }
|
169 169 | Some(2) => {
|
170 170 | builder.target_network_id = Some(deser.read_string(member)?);
|
171 171 | }
|
172 172 | Some(3) => {
|
173 173 | builder.client_vpn_endpoint_id = Some(deser.read_string(member)?);
|
174 174 | }
|
175 175 | Some(4) => {
|
176 176 | builder.status = Some(crate::types::AssociationStatus::deserialize(deser)?);
|
177 177 | }
|
178 178 | Some(5) => {
|
179 - | builder.security_groups = Some({
|
180 - | let container = if let Some(cap) = deser.container_size() {
|
181 - | Vec::with_capacity(cap)
|
182 - | } else {
|
183 - | Vec::new()
|
184 - | };
|
185 - | deser.read_list(member, container, |mut list, deser| {
|
186 - | list.push(deser.read_string(member)?);
|
187 - | Ok(list)
|
188 - | })?
|
189 - | });
|
179 + | builder.security_groups = Some(deser.read_string_list(member)?);
|
190 180 | }
|
191 181 | _ => {}
|
192 182 | }
|
193 183 | Ok(())
|
194 184 | })?;
|
195 185 | Ok(builder.build())
|
196 186 | }
|
197 187 | }
|
188 + | impl TargetNetwork {
|
189 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
190 + | pub fn deserialize_with_response(
|
191 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
192 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
193 + | _status: u16,
|
194 + | _body: &[u8],
|
195 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
196 + | Self::deserialize(deserializer)
|
197 + | }
|
198 + | }
|
198 199 | impl TargetNetwork {
|
199 200 | /// Creates a new builder-style object to manufacture [`TargetNetwork`](crate::types::TargetNetwork).
|
200 201 | pub fn builder() -> crate::types::builders::TargetNetworkBuilder {
|
201 202 | crate::types::builders::TargetNetworkBuilder::default()
|
202 203 | }
|
203 204 | }
|
204 205 |
|
205 206 | /// A builder for [`TargetNetwork`](crate::types::TargetNetwork).
|
206 207 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
207 208 | #[non_exhaustive]
|