Skip to main content

aws_sdk_securityhub/types/
_aws_ec2_vpn_connection_options_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>VPN connection options.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsEc2VpnConnectionOptionsDetails {
7    /// <p>Whether the VPN connection uses static routes only.</p>
8    pub static_routes_only: ::std::option::Option<bool>,
9    /// <p>The VPN tunnel options.</p>
10    pub tunnel_options: ::std::option::Option<::std::vec::Vec<crate::types::AwsEc2VpnConnectionOptionsTunnelOptionsDetails>>,
11}
12impl AwsEc2VpnConnectionOptionsDetails {
13    /// <p>Whether the VPN connection uses static routes only.</p>
14    pub fn static_routes_only(&self) -> ::std::option::Option<bool> {
15        self.static_routes_only
16    }
17    /// <p>The VPN tunnel options.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tunnel_options.is_none()`.
20    pub fn tunnel_options(&self) -> &[crate::types::AwsEc2VpnConnectionOptionsTunnelOptionsDetails] {
21        self.tunnel_options.as_deref().unwrap_or_default()
22    }
23}
24impl AwsEc2VpnConnectionOptionsDetails {
25    /// Creates a new builder-style object to manufacture [`AwsEc2VpnConnectionOptionsDetails`](crate::types::AwsEc2VpnConnectionOptionsDetails).
26    pub fn builder() -> crate::types::builders::AwsEc2VpnConnectionOptionsDetailsBuilder {
27        crate::types::builders::AwsEc2VpnConnectionOptionsDetailsBuilder::default()
28    }
29}
30
31/// A builder for [`AwsEc2VpnConnectionOptionsDetails`](crate::types::AwsEc2VpnConnectionOptionsDetails).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct AwsEc2VpnConnectionOptionsDetailsBuilder {
35    pub(crate) static_routes_only: ::std::option::Option<bool>,
36    pub(crate) tunnel_options: ::std::option::Option<::std::vec::Vec<crate::types::AwsEc2VpnConnectionOptionsTunnelOptionsDetails>>,
37}
38impl AwsEc2VpnConnectionOptionsDetailsBuilder {
39    /// <p>Whether the VPN connection uses static routes only.</p>
40    pub fn static_routes_only(mut self, input: bool) -> Self {
41        self.static_routes_only = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>Whether the VPN connection uses static routes only.</p>
45    pub fn set_static_routes_only(mut self, input: ::std::option::Option<bool>) -> Self {
46        self.static_routes_only = input;
47        self
48    }
49    /// <p>Whether the VPN connection uses static routes only.</p>
50    pub fn get_static_routes_only(&self) -> &::std::option::Option<bool> {
51        &self.static_routes_only
52    }
53    /// Appends an item to `tunnel_options`.
54    ///
55    /// To override the contents of this collection use [`set_tunnel_options`](Self::set_tunnel_options).
56    ///
57    /// <p>The VPN tunnel options.</p>
58    pub fn tunnel_options(mut self, input: crate::types::AwsEc2VpnConnectionOptionsTunnelOptionsDetails) -> Self {
59        let mut v = self.tunnel_options.unwrap_or_default();
60        v.push(input);
61        self.tunnel_options = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>The VPN tunnel options.</p>
65    pub fn set_tunnel_options(
66        mut self,
67        input: ::std::option::Option<::std::vec::Vec<crate::types::AwsEc2VpnConnectionOptionsTunnelOptionsDetails>>,
68    ) -> Self {
69        self.tunnel_options = input;
70        self
71    }
72    /// <p>The VPN tunnel options.</p>
73    pub fn get_tunnel_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AwsEc2VpnConnectionOptionsTunnelOptionsDetails>> {
74        &self.tunnel_options
75    }
76    /// Consumes the builder and constructs a [`AwsEc2VpnConnectionOptionsDetails`](crate::types::AwsEc2VpnConnectionOptionsDetails).
77    pub fn build(self) -> crate::types::AwsEc2VpnConnectionOptionsDetails {
78        crate::types::AwsEc2VpnConnectionOptionsDetails {
79            static_routes_only: self.static_routes_only,
80            tunnel_options: self.tunnel_options,
81        }
82    }
83}