aws_sdk_ec2/types/
_client_vpn_connection.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ClientVpnConnection {
7 pub client_vpn_endpoint_id: ::std::option::Option<::std::string::String>,
9 pub timestamp: ::std::option::Option<::std::string::String>,
11 pub connection_id: ::std::option::Option<::std::string::String>,
13 pub username: ::std::option::Option<::std::string::String>,
15 pub connection_established_time: ::std::option::Option<::std::string::String>,
17 pub ingress_bytes: ::std::option::Option<::std::string::String>,
19 pub egress_bytes: ::std::option::Option<::std::string::String>,
21 pub ingress_packets: ::std::option::Option<::std::string::String>,
23 pub egress_packets: ::std::option::Option<::std::string::String>,
25 pub client_ip: ::std::option::Option<::std::string::String>,
27 pub client_ipv6_address: ::std::option::Option<::std::string::String>,
29 pub common_name: ::std::option::Option<::std::string::String>,
31 pub status: ::std::option::Option<crate::types::ClientVpnConnectionStatus>,
33 pub connection_end_time: ::std::option::Option<::std::string::String>,
35 pub posture_compliance_statuses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
37}
38impl ClientVpnConnection {
39 pub fn client_vpn_endpoint_id(&self) -> ::std::option::Option<&str> {
41 self.client_vpn_endpoint_id.as_deref()
42 }
43 pub fn timestamp(&self) -> ::std::option::Option<&str> {
45 self.timestamp.as_deref()
46 }
47 pub fn connection_id(&self) -> ::std::option::Option<&str> {
49 self.connection_id.as_deref()
50 }
51 pub fn username(&self) -> ::std::option::Option<&str> {
53 self.username.as_deref()
54 }
55 pub fn connection_established_time(&self) -> ::std::option::Option<&str> {
57 self.connection_established_time.as_deref()
58 }
59 pub fn ingress_bytes(&self) -> ::std::option::Option<&str> {
61 self.ingress_bytes.as_deref()
62 }
63 pub fn egress_bytes(&self) -> ::std::option::Option<&str> {
65 self.egress_bytes.as_deref()
66 }
67 pub fn ingress_packets(&self) -> ::std::option::Option<&str> {
69 self.ingress_packets.as_deref()
70 }
71 pub fn egress_packets(&self) -> ::std::option::Option<&str> {
73 self.egress_packets.as_deref()
74 }
75 pub fn client_ip(&self) -> ::std::option::Option<&str> {
77 self.client_ip.as_deref()
78 }
79 pub fn client_ipv6_address(&self) -> ::std::option::Option<&str> {
81 self.client_ipv6_address.as_deref()
82 }
83 pub fn common_name(&self) -> ::std::option::Option<&str> {
85 self.common_name.as_deref()
86 }
87 pub fn status(&self) -> ::std::option::Option<&crate::types::ClientVpnConnectionStatus> {
89 self.status.as_ref()
90 }
91 pub fn connection_end_time(&self) -> ::std::option::Option<&str> {
93 self.connection_end_time.as_deref()
94 }
95 pub fn posture_compliance_statuses(&self) -> &[::std::string::String] {
99 self.posture_compliance_statuses.as_deref().unwrap_or_default()
100 }
101}
102impl ClientVpnConnection {
103 pub fn builder() -> crate::types::builders::ClientVpnConnectionBuilder {
105 crate::types::builders::ClientVpnConnectionBuilder::default()
106 }
107}
108
109#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
111#[non_exhaustive]
112pub struct ClientVpnConnectionBuilder {
113 pub(crate) client_vpn_endpoint_id: ::std::option::Option<::std::string::String>,
114 pub(crate) timestamp: ::std::option::Option<::std::string::String>,
115 pub(crate) connection_id: ::std::option::Option<::std::string::String>,
116 pub(crate) username: ::std::option::Option<::std::string::String>,
117 pub(crate) connection_established_time: ::std::option::Option<::std::string::String>,
118 pub(crate) ingress_bytes: ::std::option::Option<::std::string::String>,
119 pub(crate) egress_bytes: ::std::option::Option<::std::string::String>,
120 pub(crate) ingress_packets: ::std::option::Option<::std::string::String>,
121 pub(crate) egress_packets: ::std::option::Option<::std::string::String>,
122 pub(crate) client_ip: ::std::option::Option<::std::string::String>,
123 pub(crate) client_ipv6_address: ::std::option::Option<::std::string::String>,
124 pub(crate) common_name: ::std::option::Option<::std::string::String>,
125 pub(crate) status: ::std::option::Option<crate::types::ClientVpnConnectionStatus>,
126 pub(crate) connection_end_time: ::std::option::Option<::std::string::String>,
127 pub(crate) posture_compliance_statuses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
128}
129impl ClientVpnConnectionBuilder {
130 pub fn client_vpn_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.client_vpn_endpoint_id = ::std::option::Option::Some(input.into());
133 self
134 }
135 pub fn set_client_vpn_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.client_vpn_endpoint_id = input;
138 self
139 }
140 pub fn get_client_vpn_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
142 &self.client_vpn_endpoint_id
143 }
144 pub fn timestamp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.timestamp = ::std::option::Option::Some(input.into());
147 self
148 }
149 pub fn set_timestamp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.timestamp = input;
152 self
153 }
154 pub fn get_timestamp(&self) -> &::std::option::Option<::std::string::String> {
156 &self.timestamp
157 }
158 pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.connection_id = ::std::option::Option::Some(input.into());
161 self
162 }
163 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.connection_id = input;
166 self
167 }
168 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
170 &self.connection_id
171 }
172 pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174 self.username = ::std::option::Option::Some(input.into());
175 self
176 }
177 pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.username = input;
180 self
181 }
182 pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
184 &self.username
185 }
186 pub fn connection_established_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.connection_established_time = ::std::option::Option::Some(input.into());
189 self
190 }
191 pub fn set_connection_established_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.connection_established_time = input;
194 self
195 }
196 pub fn get_connection_established_time(&self) -> &::std::option::Option<::std::string::String> {
198 &self.connection_established_time
199 }
200 pub fn ingress_bytes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.ingress_bytes = ::std::option::Option::Some(input.into());
203 self
204 }
205 pub fn set_ingress_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.ingress_bytes = input;
208 self
209 }
210 pub fn get_ingress_bytes(&self) -> &::std::option::Option<::std::string::String> {
212 &self.ingress_bytes
213 }
214 pub fn egress_bytes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216 self.egress_bytes = ::std::option::Option::Some(input.into());
217 self
218 }
219 pub fn set_egress_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221 self.egress_bytes = input;
222 self
223 }
224 pub fn get_egress_bytes(&self) -> &::std::option::Option<::std::string::String> {
226 &self.egress_bytes
227 }
228 pub fn ingress_packets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230 self.ingress_packets = ::std::option::Option::Some(input.into());
231 self
232 }
233 pub fn set_ingress_packets(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235 self.ingress_packets = input;
236 self
237 }
238 pub fn get_ingress_packets(&self) -> &::std::option::Option<::std::string::String> {
240 &self.ingress_packets
241 }
242 pub fn egress_packets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.egress_packets = ::std::option::Option::Some(input.into());
245 self
246 }
247 pub fn set_egress_packets(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249 self.egress_packets = input;
250 self
251 }
252 pub fn get_egress_packets(&self) -> &::std::option::Option<::std::string::String> {
254 &self.egress_packets
255 }
256 pub fn client_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258 self.client_ip = ::std::option::Option::Some(input.into());
259 self
260 }
261 pub fn set_client_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263 self.client_ip = input;
264 self
265 }
266 pub fn get_client_ip(&self) -> &::std::option::Option<::std::string::String> {
268 &self.client_ip
269 }
270 pub fn client_ipv6_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
272 self.client_ipv6_address = ::std::option::Option::Some(input.into());
273 self
274 }
275 pub fn set_client_ipv6_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
277 self.client_ipv6_address = input;
278 self
279 }
280 pub fn get_client_ipv6_address(&self) -> &::std::option::Option<::std::string::String> {
282 &self.client_ipv6_address
283 }
284 pub fn common_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286 self.common_name = ::std::option::Option::Some(input.into());
287 self
288 }
289 pub fn set_common_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291 self.common_name = input;
292 self
293 }
294 pub fn get_common_name(&self) -> &::std::option::Option<::std::string::String> {
296 &self.common_name
297 }
298 pub fn status(mut self, input: crate::types::ClientVpnConnectionStatus) -> Self {
300 self.status = ::std::option::Option::Some(input);
301 self
302 }
303 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClientVpnConnectionStatus>) -> Self {
305 self.status = input;
306 self
307 }
308 pub fn get_status(&self) -> &::std::option::Option<crate::types::ClientVpnConnectionStatus> {
310 &self.status
311 }
312 pub fn connection_end_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314 self.connection_end_time = ::std::option::Option::Some(input.into());
315 self
316 }
317 pub fn set_connection_end_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
319 self.connection_end_time = input;
320 self
321 }
322 pub fn get_connection_end_time(&self) -> &::std::option::Option<::std::string::String> {
324 &self.connection_end_time
325 }
326 pub fn posture_compliance_statuses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
332 let mut v = self.posture_compliance_statuses.unwrap_or_default();
333 v.push(input.into());
334 self.posture_compliance_statuses = ::std::option::Option::Some(v);
335 self
336 }
337 pub fn set_posture_compliance_statuses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
339 self.posture_compliance_statuses = input;
340 self
341 }
342 pub fn get_posture_compliance_statuses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
344 &self.posture_compliance_statuses
345 }
346 pub fn build(self) -> crate::types::ClientVpnConnection {
348 crate::types::ClientVpnConnection {
349 client_vpn_endpoint_id: self.client_vpn_endpoint_id,
350 timestamp: self.timestamp,
351 connection_id: self.connection_id,
352 username: self.username,
353 connection_established_time: self.connection_established_time,
354 ingress_bytes: self.ingress_bytes,
355 egress_bytes: self.egress_bytes,
356 ingress_packets: self.ingress_packets,
357 egress_packets: self.egress_packets,
358 client_ip: self.client_ip,
359 client_ipv6_address: self.client_ipv6_address,
360 common_name: self.common_name,
361 status: self.status,
362 connection_end_time: self.connection_end_time,
363 posture_compliance_statuses: self.posture_compliance_statuses,
364 }
365 }
366}