aws_sdk_appmesh/types/_virtual_gateway_tls_validation_context_trust.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that represents a Transport Layer Security (TLS) validation context trust.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub enum VirtualGatewayTlsValidationContextTrust {
7 /// <p>A reference to an object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.</p>
8 Acm(crate::types::VirtualGatewayTlsValidationContextAcmTrust),
9 /// <p>An object that represents a Transport Layer Security (TLS) validation context trust for a local file.</p>
10 File(crate::types::VirtualGatewayTlsValidationContextFileTrust),
11 /// <p>A reference to an object that represents a virtual gateway's Transport Layer Security (TLS) Secret Discovery Service validation context trust.</p>
12 Sds(crate::types::VirtualGatewayTlsValidationContextSdsTrust),
13 /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
14 /// An unknown enum variant
15 ///
16 /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
17 /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
18 /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
19 /// To investigate this, consider turning on debug logging to print the raw HTTP response.
20 #[non_exhaustive]
21 Unknown,
22}
23impl VirtualGatewayTlsValidationContextTrust {
24 /// Tries to convert the enum instance into [`Acm`](crate::types::VirtualGatewayTlsValidationContextTrust::Acm), extracting the inner [`VirtualGatewayTlsValidationContextAcmTrust`](crate::types::VirtualGatewayTlsValidationContextAcmTrust).
25 /// Returns `Err(&Self)` if it can't be converted.
26 pub fn as_acm(&self) -> ::std::result::Result<&crate::types::VirtualGatewayTlsValidationContextAcmTrust, &Self> {
27 if let VirtualGatewayTlsValidationContextTrust::Acm(val) = &self {
28 ::std::result::Result::Ok(val)
29 } else {
30 ::std::result::Result::Err(self)
31 }
32 }
33 /// Returns true if this is a [`Acm`](crate::types::VirtualGatewayTlsValidationContextTrust::Acm).
34 pub fn is_acm(&self) -> bool {
35 self.as_acm().is_ok()
36 }
37 /// Tries to convert the enum instance into [`File`](crate::types::VirtualGatewayTlsValidationContextTrust::File), extracting the inner [`VirtualGatewayTlsValidationContextFileTrust`](crate::types::VirtualGatewayTlsValidationContextFileTrust).
38 /// Returns `Err(&Self)` if it can't be converted.
39 pub fn as_file(&self) -> ::std::result::Result<&crate::types::VirtualGatewayTlsValidationContextFileTrust, &Self> {
40 if let VirtualGatewayTlsValidationContextTrust::File(val) = &self {
41 ::std::result::Result::Ok(val)
42 } else {
43 ::std::result::Result::Err(self)
44 }
45 }
46 /// Returns true if this is a [`File`](crate::types::VirtualGatewayTlsValidationContextTrust::File).
47 pub fn is_file(&self) -> bool {
48 self.as_file().is_ok()
49 }
50 /// Tries to convert the enum instance into [`Sds`](crate::types::VirtualGatewayTlsValidationContextTrust::Sds), extracting the inner [`VirtualGatewayTlsValidationContextSdsTrust`](crate::types::VirtualGatewayTlsValidationContextSdsTrust).
51 /// Returns `Err(&Self)` if it can't be converted.
52 pub fn as_sds(&self) -> ::std::result::Result<&crate::types::VirtualGatewayTlsValidationContextSdsTrust, &Self> {
53 if let VirtualGatewayTlsValidationContextTrust::Sds(val) = &self {
54 ::std::result::Result::Ok(val)
55 } else {
56 ::std::result::Result::Err(self)
57 }
58 }
59 /// Returns true if this is a [`Sds`](crate::types::VirtualGatewayTlsValidationContextTrust::Sds).
60 pub fn is_sds(&self) -> bool {
61 self.as_sds().is_ok()
62 }
63 /// Returns true if the enum instance is the `Unknown` variant.
64 pub fn is_unknown(&self) -> bool {
65 matches!(self, Self::Unknown)
66 }
67}