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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents a Transport Layer Security (TLS) validation context trust.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum VirtualGatewayTlsValidationContextTrust {
/// <p>A reference to an object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.</p>
Acm(crate::types::VirtualGatewayTlsValidationContextAcmTrust),
/// <p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>
File(crate::types::VirtualGatewayTlsValidationContextFileTrust),
/// <p>A reference to an object that represents a virtual gateway's Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>
Sds(crate::types::VirtualGatewayTlsValidationContextSdsTrust),
/// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
/// An unknown enum variant
///
/// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
/// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
/// by the client. This can happen when the server adds new functionality, but the client has not been updated.
/// To investigate this, consider turning on debug logging to print the raw HTTP response.
#[non_exhaustive]
Unknown,
}
impl VirtualGatewayTlsValidationContextTrust {
/// Tries to convert the enum instance into [`Acm`](crate::types::VirtualGatewayTlsValidationContextTrust::Acm), extracting the inner [`VirtualGatewayTlsValidationContextAcmTrust`](crate::types::VirtualGatewayTlsValidationContextAcmTrust).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_acm(&self) -> ::std::result::Result<&crate::types::VirtualGatewayTlsValidationContextAcmTrust, &Self> {
if let VirtualGatewayTlsValidationContextTrust::Acm(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`Acm`](crate::types::VirtualGatewayTlsValidationContextTrust::Acm).
pub fn is_acm(&self) -> bool {
self.as_acm().is_ok()
}
/// Tries to convert the enum instance into [`File`](crate::types::VirtualGatewayTlsValidationContextTrust::File), extracting the inner [`VirtualGatewayTlsValidationContextFileTrust`](crate::types::VirtualGatewayTlsValidationContextFileTrust).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_file(&self) -> ::std::result::Result<&crate::types::VirtualGatewayTlsValidationContextFileTrust, &Self> {
if let VirtualGatewayTlsValidationContextTrust::File(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`File`](crate::types::VirtualGatewayTlsValidationContextTrust::File).
pub fn is_file(&self) -> bool {
self.as_file().is_ok()
}
/// Tries to convert the enum instance into [`Sds`](crate::types::VirtualGatewayTlsValidationContextTrust::Sds), extracting the inner [`VirtualGatewayTlsValidationContextSdsTrust`](crate::types::VirtualGatewayTlsValidationContextSdsTrust).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_sds(&self) -> ::std::result::Result<&crate::types::VirtualGatewayTlsValidationContextSdsTrust, &Self> {
if let VirtualGatewayTlsValidationContextTrust::Sds(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`Sds`](crate::types::VirtualGatewayTlsValidationContextTrust::Sds).
pub fn is_sds(&self) -> bool {
self.as_sds().is_ok()
}
/// Returns true if the enum instance is the `Unknown` variant.
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}