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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes the respective AWS Interconnect Partner organization.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Provider {
/// <p>The provider's name. Specifically, connections to/from this Cloud Service Provider will be considered Multicloud connections.</p>
CloudServiceProvider(::std::string::String),
/// <p>The provider's name. Specifically, connections to/from this Last Mile Provider will be considered LastMile connections.</p>
LastMileProvider(::std::string::String),
/// 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 Provider {
/// Tries to convert the enum instance into [`CloudServiceProvider`](crate::types::Provider::CloudServiceProvider), extracting the inner [`String`](::std::string::String).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_cloud_service_provider(&self) -> ::std::result::Result<&::std::string::String, &Self> {
if let Provider::CloudServiceProvider(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`CloudServiceProvider`](crate::types::Provider::CloudServiceProvider).
pub fn is_cloud_service_provider(&self) -> bool {
self.as_cloud_service_provider().is_ok()
}
/// Tries to convert the enum instance into [`LastMileProvider`](crate::types::Provider::LastMileProvider), extracting the inner [`String`](::std::string::String).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_last_mile_provider(&self) -> ::std::result::Result<&::std::string::String, &Self> {
if let Provider::LastMileProvider(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`LastMileProvider`](crate::types::Provider::LastMileProvider).
pub fn is_last_mile_provider(&self) -> bool {
self.as_last_mile_provider().is_ok()
}
/// Returns true if the enum instance is the `Unknown` variant.
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}