aws_sdk_ec2/types/
_client_vpn_connection.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a client connection.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ClientVpnConnection {
7    /// <p>The ID of the Client VPN endpoint to which the client is connected.</p>
8    pub client_vpn_endpoint_id: ::std::option::Option<::std::string::String>,
9    /// <p>The current date and time.</p>
10    pub timestamp: ::std::option::Option<::std::string::String>,
11    /// <p>The ID of the client connection.</p>
12    pub connection_id: ::std::option::Option<::std::string::String>,
13    /// <p>The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.</p>
14    pub username: ::std::option::Option<::std::string::String>,
15    /// <p>The date and time the client connection was established.</p>
16    pub connection_established_time: ::std::option::Option<::std::string::String>,
17    /// <p>The number of bytes sent by the client.</p>
18    pub ingress_bytes: ::std::option::Option<::std::string::String>,
19    /// <p>The number of bytes received by the client.</p>
20    pub egress_bytes: ::std::option::Option<::std::string::String>,
21    /// <p>The number of packets sent by the client.</p>
22    pub ingress_packets: ::std::option::Option<::std::string::String>,
23    /// <p>The number of packets received by the client.</p>
24    pub egress_packets: ::std::option::Option<::std::string::String>,
25    /// <p>The IP address of the client.</p>
26    pub client_ip: ::std::option::Option<::std::string::String>,
27    /// <p>The IPv6 address assigned to the client connection when using a dual-stack Client VPN endpoint. This field is only populated when the endpoint is configured for dual-stack addressing, and the client is using IPv6 for connectivity.</p>
28    pub client_ipv6_address: ::std::option::Option<::std::string::String>,
29    /// <p>The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.</p>
30    pub common_name: ::std::option::Option<::std::string::String>,
31    /// <p>The current state of the client connection.</p>
32    pub status: ::std::option::Option<crate::types::ClientVpnConnectionStatus>,
33    /// <p>The date and time the client connection was terminated.</p>
34    pub connection_end_time: ::std::option::Option<::std::string::String>,
35    /// <p>The statuses returned by the client connect handler for posture compliance, if applicable.</p>
36    pub posture_compliance_statuses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
37}
38impl ClientVpnConnection {
39    /// <p>The ID of the Client VPN endpoint to which the client is connected.</p>
40    pub fn client_vpn_endpoint_id(&self) -> ::std::option::Option<&str> {
41        self.client_vpn_endpoint_id.as_deref()
42    }
43    /// <p>The current date and time.</p>
44    pub fn timestamp(&self) -> ::std::option::Option<&str> {
45        self.timestamp.as_deref()
46    }
47    /// <p>The ID of the client connection.</p>
48    pub fn connection_id(&self) -> ::std::option::Option<&str> {
49        self.connection_id.as_deref()
50    }
51    /// <p>The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.</p>
52    pub fn username(&self) -> ::std::option::Option<&str> {
53        self.username.as_deref()
54    }
55    /// <p>The date and time the client connection was established.</p>
56    pub fn connection_established_time(&self) -> ::std::option::Option<&str> {
57        self.connection_established_time.as_deref()
58    }
59    /// <p>The number of bytes sent by the client.</p>
60    pub fn ingress_bytes(&self) -> ::std::option::Option<&str> {
61        self.ingress_bytes.as_deref()
62    }
63    /// <p>The number of bytes received by the client.</p>
64    pub fn egress_bytes(&self) -> ::std::option::Option<&str> {
65        self.egress_bytes.as_deref()
66    }
67    /// <p>The number of packets sent by the client.</p>
68    pub fn ingress_packets(&self) -> ::std::option::Option<&str> {
69        self.ingress_packets.as_deref()
70    }
71    /// <p>The number of packets received by the client.</p>
72    pub fn egress_packets(&self) -> ::std::option::Option<&str> {
73        self.egress_packets.as_deref()
74    }
75    /// <p>The IP address of the client.</p>
76    pub fn client_ip(&self) -> ::std::option::Option<&str> {
77        self.client_ip.as_deref()
78    }
79    /// <p>The IPv6 address assigned to the client connection when using a dual-stack Client VPN endpoint. This field is only populated when the endpoint is configured for dual-stack addressing, and the client is using IPv6 for connectivity.</p>
80    pub fn client_ipv6_address(&self) -> ::std::option::Option<&str> {
81        self.client_ipv6_address.as_deref()
82    }
83    /// <p>The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.</p>
84    pub fn common_name(&self) -> ::std::option::Option<&str> {
85        self.common_name.as_deref()
86    }
87    /// <p>The current state of the client connection.</p>
88    pub fn status(&self) -> ::std::option::Option<&crate::types::ClientVpnConnectionStatus> {
89        self.status.as_ref()
90    }
91    /// <p>The date and time the client connection was terminated.</p>
92    pub fn connection_end_time(&self) -> ::std::option::Option<&str> {
93        self.connection_end_time.as_deref()
94    }
95    /// <p>The statuses returned by the client connect handler for posture compliance, if applicable.</p>
96    ///
97    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.posture_compliance_statuses.is_none()`.
98    pub fn posture_compliance_statuses(&self) -> &[::std::string::String] {
99        self.posture_compliance_statuses.as_deref().unwrap_or_default()
100    }
101}
102impl ClientVpnConnection {
103    /// Creates a new builder-style object to manufacture [`ClientVpnConnection`](crate::types::ClientVpnConnection).
104    pub fn builder() -> crate::types::builders::ClientVpnConnectionBuilder {
105        crate::types::builders::ClientVpnConnectionBuilder::default()
106    }
107}
108
109/// A builder for [`ClientVpnConnection`](crate::types::ClientVpnConnection).
110#[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    /// <p>The ID of the Client VPN endpoint to which the client is connected.</p>
131    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    /// <p>The ID of the Client VPN endpoint to which the client is connected.</p>
136    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    /// <p>The ID of the Client VPN endpoint to which the client is connected.</p>
141    pub fn get_client_vpn_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
142        &self.client_vpn_endpoint_id
143    }
144    /// <p>The current date and time.</p>
145    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    /// <p>The current date and time.</p>
150    pub fn set_timestamp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.timestamp = input;
152        self
153    }
154    /// <p>The current date and time.</p>
155    pub fn get_timestamp(&self) -> &::std::option::Option<::std::string::String> {
156        &self.timestamp
157    }
158    /// <p>The ID of the client connection.</p>
159    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    /// <p>The ID of the client connection.</p>
164    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.connection_id = input;
166        self
167    }
168    /// <p>The ID of the client connection.</p>
169    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
170        &self.connection_id
171    }
172    /// <p>The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.</p>
173    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    /// <p>The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.</p>
178    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.username = input;
180        self
181    }
182    /// <p>The username of the client who established the client connection. This information is only provided if Active Directory client authentication is used.</p>
183    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
184        &self.username
185    }
186    /// <p>The date and time the client connection was established.</p>
187    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    /// <p>The date and time the client connection was established.</p>
192    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    /// <p>The date and time the client connection was established.</p>
197    pub fn get_connection_established_time(&self) -> &::std::option::Option<::std::string::String> {
198        &self.connection_established_time
199    }
200    /// <p>The number of bytes sent by the client.</p>
201    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    /// <p>The number of bytes sent by the client.</p>
206    pub fn set_ingress_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.ingress_bytes = input;
208        self
209    }
210    /// <p>The number of bytes sent by the client.</p>
211    pub fn get_ingress_bytes(&self) -> &::std::option::Option<::std::string::String> {
212        &self.ingress_bytes
213    }
214    /// <p>The number of bytes received by the client.</p>
215    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    /// <p>The number of bytes received by the client.</p>
220    pub fn set_egress_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.egress_bytes = input;
222        self
223    }
224    /// <p>The number of bytes received by the client.</p>
225    pub fn get_egress_bytes(&self) -> &::std::option::Option<::std::string::String> {
226        &self.egress_bytes
227    }
228    /// <p>The number of packets sent by the client.</p>
229    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    /// <p>The number of packets sent by the client.</p>
234    pub fn set_ingress_packets(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.ingress_packets = input;
236        self
237    }
238    /// <p>The number of packets sent by the client.</p>
239    pub fn get_ingress_packets(&self) -> &::std::option::Option<::std::string::String> {
240        &self.ingress_packets
241    }
242    /// <p>The number of packets received by the client.</p>
243    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    /// <p>The number of packets received by the client.</p>
248    pub fn set_egress_packets(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249        self.egress_packets = input;
250        self
251    }
252    /// <p>The number of packets received by the client.</p>
253    pub fn get_egress_packets(&self) -> &::std::option::Option<::std::string::String> {
254        &self.egress_packets
255    }
256    /// <p>The IP address of the client.</p>
257    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    /// <p>The IP address of the client.</p>
262    pub fn set_client_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263        self.client_ip = input;
264        self
265    }
266    /// <p>The IP address of the client.</p>
267    pub fn get_client_ip(&self) -> &::std::option::Option<::std::string::String> {
268        &self.client_ip
269    }
270    /// <p>The IPv6 address assigned to the client connection when using a dual-stack Client VPN endpoint. This field is only populated when the endpoint is configured for dual-stack addressing, and the client is using IPv6 for connectivity.</p>
271    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    /// <p>The IPv6 address assigned to the client connection when using a dual-stack Client VPN endpoint. This field is only populated when the endpoint is configured for dual-stack addressing, and the client is using IPv6 for connectivity.</p>
276    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    /// <p>The IPv6 address assigned to the client connection when using a dual-stack Client VPN endpoint. This field is only populated when the endpoint is configured for dual-stack addressing, and the client is using IPv6 for connectivity.</p>
281    pub fn get_client_ipv6_address(&self) -> &::std::option::Option<::std::string::String> {
282        &self.client_ipv6_address
283    }
284    /// <p>The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.</p>
285    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    /// <p>The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.</p>
290    pub fn set_common_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291        self.common_name = input;
292        self
293    }
294    /// <p>The common name associated with the client. This is either the name of the client certificate, or the Active Directory user name.</p>
295    pub fn get_common_name(&self) -> &::std::option::Option<::std::string::String> {
296        &self.common_name
297    }
298    /// <p>The current state of the client connection.</p>
299    pub fn status(mut self, input: crate::types::ClientVpnConnectionStatus) -> Self {
300        self.status = ::std::option::Option::Some(input);
301        self
302    }
303    /// <p>The current state of the client connection.</p>
304    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClientVpnConnectionStatus>) -> Self {
305        self.status = input;
306        self
307    }
308    /// <p>The current state of the client connection.</p>
309    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClientVpnConnectionStatus> {
310        &self.status
311    }
312    /// <p>The date and time the client connection was terminated.</p>
313    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    /// <p>The date and time the client connection was terminated.</p>
318    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    /// <p>The date and time the client connection was terminated.</p>
323    pub fn get_connection_end_time(&self) -> &::std::option::Option<::std::string::String> {
324        &self.connection_end_time
325    }
326    /// Appends an item to `posture_compliance_statuses`.
327    ///
328    /// To override the contents of this collection use [`set_posture_compliance_statuses`](Self::set_posture_compliance_statuses).
329    ///
330    /// <p>The statuses returned by the client connect handler for posture compliance, if applicable.</p>
331    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    /// <p>The statuses returned by the client connect handler for posture compliance, if applicable.</p>
338    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    /// <p>The statuses returned by the client connect handler for posture compliance, if applicable.</p>
343    pub fn get_posture_compliance_statuses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
344        &self.posture_compliance_statuses
345    }
346    /// Consumes the builder and constructs a [`ClientVpnConnection`](crate::types::ClientVpnConnection).
347    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}