aws_sdk_appmesh/types/_virtual_gateway_access_log.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The access log configuration for a virtual gateway.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub enum VirtualGatewayAccessLog {
7 /// <p>The file object to send virtual gateway access logs to.</p>
8 File(crate::types::VirtualGatewayFileAccessLog),
9 /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
10 /// An unknown enum variant
11 ///
12 /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
13 /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
14 /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
15 /// To investigate this, consider turning on debug logging to print the raw HTTP response.
16 #[non_exhaustive]
17 Unknown,
18}
19impl VirtualGatewayAccessLog {
20 #[allow(irrefutable_let_patterns)]
21 /// Tries to convert the enum instance into [`File`](crate::types::VirtualGatewayAccessLog::File), extracting the inner [`VirtualGatewayFileAccessLog`](crate::types::VirtualGatewayFileAccessLog).
22 /// Returns `Err(&Self)` if it can't be converted.
23 pub fn as_file(&self) -> ::std::result::Result<&crate::types::VirtualGatewayFileAccessLog, &Self> {
24 if let VirtualGatewayAccessLog::File(val) = &self {
25 ::std::result::Result::Ok(val)
26 } else {
27 ::std::result::Result::Err(self)
28 }
29 }
30 /// Returns true if this is a [`File`](crate::types::VirtualGatewayAccessLog::File).
31 pub fn is_file(&self) -> bool {
32 self.as_file().is_ok()
33 }
34 /// Returns true if the enum instance is the `Unknown` variant.
35 pub fn is_unknown(&self) -> bool {
36 matches!(self, Self::Unknown)
37 }
38}