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.
/// Controls how clients identify themselves when interacting with an extension.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Authentication {
/// Clients sign requests with SigV4 using a key the service issues.
ExtensionKey(crate::types::ExtensionKey),
/// Whether clients may interact with the extension interface without authenticating.
None(bool),
/// Clients sign requests with SigV4 using the AWS credentials the Cloud Extensions Runtime gets from its environment.
RuntimeCredentials(crate::types::RuntimeCredentials),
/// 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 Authentication {
/// Tries to convert the enum instance into [`ExtensionKey`](crate::types::Authentication::ExtensionKey), extracting the inner [`ExtensionKey`](crate::types::ExtensionKey).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_extension_key(&self) -> ::std::result::Result<&crate::types::ExtensionKey, &Self> {
if let Authentication::ExtensionKey(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`ExtensionKey`](crate::types::Authentication::ExtensionKey).
pub fn is_extension_key(&self) -> bool {
self.as_extension_key().is_ok()
}
/// Tries to convert the enum instance into [`None`](crate::types::Authentication::None), extracting the inner [`bool`](bool).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_none(&self) -> ::std::result::Result<&bool, &Self> {
if let Authentication::None(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`None`](crate::types::Authentication::None).
pub fn is_none(&self) -> bool {
self.as_none().is_ok()
}
/// Tries to convert the enum instance into [`RuntimeCredentials`](crate::types::Authentication::RuntimeCredentials), extracting the inner [`RuntimeCredentials`](crate::types::RuntimeCredentials).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_runtime_credentials(&self) -> ::std::result::Result<&crate::types::RuntimeCredentials, &Self> {
if let Authentication::RuntimeCredentials(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`RuntimeCredentials`](crate::types::Authentication::RuntimeCredentials).
pub fn is_runtime_credentials(&self) -> bool {
self.as_runtime_credentials().is_ok()
}
/// Returns true if the enum instance is the `Unknown` variant.
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}