1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents the Transport Layer Security (TLS) properties for a listener.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VirtualGatewayListenerTls {
/// <p>Specify one of the following modes.</p>
/// <ul>
/// <li>
/// <p><b></b>STRICT – Listener only accepts connections with TLS enabled.</p></li>
/// <li>
/// <p><b></b>PERMISSIVE – Listener accepts connections with or without TLS enabled.</p></li>
/// <li>
/// <p><b></b>DISABLED – Listener only accepts connections without TLS.</p></li>
/// </ul>
pub mode: crate::types::VirtualGatewayListenerTlsMode,
/// <p>A reference to an object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context.</p>
pub validation: ::std::option::Option<crate::types::VirtualGatewayListenerTlsValidationContext>,
/// <p>An object that represents a Transport Layer Security (TLS) certificate.</p>
pub certificate: ::std::option::Option<crate::types::VirtualGatewayListenerTlsCertificate>,
}
impl VirtualGatewayListenerTls {
/// <p>Specify one of the following modes.</p>
/// <ul>
/// <li>
/// <p><b></b>STRICT – Listener only accepts connections with TLS enabled.</p></li>
/// <li>
/// <p><b></b>PERMISSIVE – Listener accepts connections with or without TLS enabled.</p></li>
/// <li>
/// <p><b></b>DISABLED – Listener only accepts connections without TLS.</p></li>
/// </ul>
pub fn mode(&self) -> &crate::types::VirtualGatewayListenerTlsMode {
&self.mode
}
/// <p>A reference to an object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context.</p>
pub fn validation(&self) -> ::std::option::Option<&crate::types::VirtualGatewayListenerTlsValidationContext> {
self.validation.as_ref()
}
/// <p>An object that represents a Transport Layer Security (TLS) certificate.</p>
pub fn certificate(&self) -> ::std::option::Option<&crate::types::VirtualGatewayListenerTlsCertificate> {
self.certificate.as_ref()
}
}
impl VirtualGatewayListenerTls {
/// Creates a new builder-style object to manufacture [`VirtualGatewayListenerTls`](crate::types::VirtualGatewayListenerTls).
pub fn builder() -> crate::types::builders::VirtualGatewayListenerTlsBuilder {
crate::types::builders::VirtualGatewayListenerTlsBuilder::default()
}
}
/// A builder for [`VirtualGatewayListenerTls`](crate::types::VirtualGatewayListenerTls).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VirtualGatewayListenerTlsBuilder {
pub(crate) mode: ::std::option::Option<crate::types::VirtualGatewayListenerTlsMode>,
pub(crate) validation: ::std::option::Option<crate::types::VirtualGatewayListenerTlsValidationContext>,
pub(crate) certificate: ::std::option::Option<crate::types::VirtualGatewayListenerTlsCertificate>,
}
impl VirtualGatewayListenerTlsBuilder {
/// <p>Specify one of the following modes.</p>
/// <ul>
/// <li>
/// <p><b></b>STRICT – Listener only accepts connections with TLS enabled.</p></li>
/// <li>
/// <p><b></b>PERMISSIVE – Listener accepts connections with or without TLS enabled.</p></li>
/// <li>
/// <p><b></b>DISABLED – Listener only accepts connections without TLS.</p></li>
/// </ul>
/// This field is required.
pub fn mode(mut self, input: crate::types::VirtualGatewayListenerTlsMode) -> Self {
self.mode = ::std::option::Option::Some(input);
self
}
/// <p>Specify one of the following modes.</p>
/// <ul>
/// <li>
/// <p><b></b>STRICT – Listener only accepts connections with TLS enabled.</p></li>
/// <li>
/// <p><b></b>PERMISSIVE – Listener accepts connections with or without TLS enabled.</p></li>
/// <li>
/// <p><b></b>DISABLED – Listener only accepts connections without TLS.</p></li>
/// </ul>
pub fn set_mode(mut self, input: ::std::option::Option<crate::types::VirtualGatewayListenerTlsMode>) -> Self {
self.mode = input;
self
}
/// <p>Specify one of the following modes.</p>
/// <ul>
/// <li>
/// <p><b></b>STRICT – Listener only accepts connections with TLS enabled.</p></li>
/// <li>
/// <p><b></b>PERMISSIVE – Listener accepts connections with or without TLS enabled.</p></li>
/// <li>
/// <p><b></b>DISABLED – Listener only accepts connections without TLS.</p></li>
/// </ul>
pub fn get_mode(&self) -> &::std::option::Option<crate::types::VirtualGatewayListenerTlsMode> {
&self.mode
}
/// <p>A reference to an object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context.</p>
pub fn validation(mut self, input: crate::types::VirtualGatewayListenerTlsValidationContext) -> Self {
self.validation = ::std::option::Option::Some(input);
self
}
/// <p>A reference to an object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context.</p>
pub fn set_validation(mut self, input: ::std::option::Option<crate::types::VirtualGatewayListenerTlsValidationContext>) -> Self {
self.validation = input;
self
}
/// <p>A reference to an object that represents a virtual gateway's listener's Transport Layer Security (TLS) validation context.</p>
pub fn get_validation(&self) -> &::std::option::Option<crate::types::VirtualGatewayListenerTlsValidationContext> {
&self.validation
}
/// <p>An object that represents a Transport Layer Security (TLS) certificate.</p>
/// This field is required.
pub fn certificate(mut self, input: crate::types::VirtualGatewayListenerTlsCertificate) -> Self {
self.certificate = ::std::option::Option::Some(input);
self
}
/// <p>An object that represents a Transport Layer Security (TLS) certificate.</p>
pub fn set_certificate(mut self, input: ::std::option::Option<crate::types::VirtualGatewayListenerTlsCertificate>) -> Self {
self.certificate = input;
self
}
/// <p>An object that represents a Transport Layer Security (TLS) certificate.</p>
pub fn get_certificate(&self) -> &::std::option::Option<crate::types::VirtualGatewayListenerTlsCertificate> {
&self.certificate
}
/// Consumes the builder and constructs a [`VirtualGatewayListenerTls`](crate::types::VirtualGatewayListenerTls).
/// This method will fail if any of the following fields are not set:
/// - [`mode`](crate::types::builders::VirtualGatewayListenerTlsBuilder::mode)
pub fn build(self) -> ::std::result::Result<crate::types::VirtualGatewayListenerTls, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::VirtualGatewayListenerTls {
mode: self.mode.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"mode",
"mode was not specified but it is required when building VirtualGatewayListenerTls",
)
})?,
validation: self.validation,
certificate: self.certificate,
})
}
}