aws_sdk_redshift/types/_lake_formation_scope_union.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A list of scopes set up for Lake Formation integration.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub enum LakeFormationScopeUnion {
7 /// <p>The Lake Formation scope.</p>
8 LakeFormationQuery(crate::types::LakeFormationQuery),
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 LakeFormationScopeUnion {
20 #[allow(irrefutable_let_patterns)]
21 /// Tries to convert the enum instance into [`LakeFormationQuery`](crate::types::LakeFormationScopeUnion::LakeFormationQuery), extracting the inner [`LakeFormationQuery`](crate::types::LakeFormationQuery).
22 /// Returns `Err(&Self)` if it can't be converted.
23 pub fn as_lake_formation_query(&self) -> ::std::result::Result<&crate::types::LakeFormationQuery, &Self> {
24 if let LakeFormationScopeUnion::LakeFormationQuery(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 [`LakeFormationQuery`](crate::types::LakeFormationScopeUnion::LakeFormationQuery).
31 pub fn is_lake_formation_query(&self) -> bool {
32 self.as_lake_formation_query().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}