#[non_exhaustive]
#[derive(
::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
)]
pub enum PartitionInstanceType {
#[allow(missing_docs)] Search2xlarge,
#[allow(missing_docs)] SearchLarge,
#[allow(missing_docs)] SearchM1Large,
#[allow(missing_docs)] SearchM1Small,
#[allow(missing_docs)] SearchM22xlarge,
#[allow(missing_docs)] SearchM2Xlarge,
#[allow(missing_docs)] SearchM32xlarge,
#[allow(missing_docs)] SearchM3Large,
#[allow(missing_docs)] SearchM3Medium,
#[allow(missing_docs)] SearchM3Xlarge,
#[allow(missing_docs)] SearchMedium,
#[allow(missing_docs)] SearchPreviousgeneration2xlarge,
#[allow(missing_docs)] SearchPreviousgenerationLarge,
#[allow(missing_docs)] SearchPreviousgenerationSmall,
#[allow(missing_docs)] SearchPreviousgenerationXlarge,
#[allow(missing_docs)] SearchSmall,
#[allow(missing_docs)] SearchXlarge,
#[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
}
impl ::std::convert::From<&str> for PartitionInstanceType {
fn from(s: &str) -> Self {
match s {
"search.2xlarge" => PartitionInstanceType::Search2xlarge,
"search.large" => PartitionInstanceType::SearchLarge,
"search.m1.large" => PartitionInstanceType::SearchM1Large,
"search.m1.small" => PartitionInstanceType::SearchM1Small,
"search.m2.2xlarge" => PartitionInstanceType::SearchM22xlarge,
"search.m2.xlarge" => PartitionInstanceType::SearchM2Xlarge,
"search.m3.2xlarge" => PartitionInstanceType::SearchM32xlarge,
"search.m3.large" => PartitionInstanceType::SearchM3Large,
"search.m3.medium" => PartitionInstanceType::SearchM3Medium,
"search.m3.xlarge" => PartitionInstanceType::SearchM3Xlarge,
"search.medium" => PartitionInstanceType::SearchMedium,
"search.previousgeneration.2xlarge" => PartitionInstanceType::SearchPreviousgeneration2xlarge,
"search.previousgeneration.large" => PartitionInstanceType::SearchPreviousgenerationLarge,
"search.previousgeneration.small" => PartitionInstanceType::SearchPreviousgenerationSmall,
"search.previousgeneration.xlarge" => PartitionInstanceType::SearchPreviousgenerationXlarge,
"search.small" => PartitionInstanceType::SearchSmall,
"search.xlarge" => PartitionInstanceType::SearchXlarge,
other => PartitionInstanceType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
}
}
}
impl ::std::str::FromStr for PartitionInstanceType {
type Err = ::std::convert::Infallible;
fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
::std::result::Result::Ok(PartitionInstanceType::from(s))
}
}
impl PartitionInstanceType {
pub fn as_str(&self) -> &str {
match self {
PartitionInstanceType::Search2xlarge => "search.2xlarge",
PartitionInstanceType::SearchLarge => "search.large",
PartitionInstanceType::SearchM1Large => "search.m1.large",
PartitionInstanceType::SearchM1Small => "search.m1.small",
PartitionInstanceType::SearchM22xlarge => "search.m2.2xlarge",
PartitionInstanceType::SearchM2Xlarge => "search.m2.xlarge",
PartitionInstanceType::SearchM32xlarge => "search.m3.2xlarge",
PartitionInstanceType::SearchM3Large => "search.m3.large",
PartitionInstanceType::SearchM3Medium => "search.m3.medium",
PartitionInstanceType::SearchM3Xlarge => "search.m3.xlarge",
PartitionInstanceType::SearchMedium => "search.medium",
PartitionInstanceType::SearchPreviousgeneration2xlarge => "search.previousgeneration.2xlarge",
PartitionInstanceType::SearchPreviousgenerationLarge => "search.previousgeneration.large",
PartitionInstanceType::SearchPreviousgenerationSmall => "search.previousgeneration.small",
PartitionInstanceType::SearchPreviousgenerationXlarge => "search.previousgeneration.xlarge",
PartitionInstanceType::SearchSmall => "search.small",
PartitionInstanceType::SearchXlarge => "search.xlarge",
PartitionInstanceType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"search.2xlarge",
"search.large",
"search.m1.large",
"search.m1.small",
"search.m2.2xlarge",
"search.m2.xlarge",
"search.m3.2xlarge",
"search.m3.large",
"search.m3.medium",
"search.m3.xlarge",
"search.medium",
"search.previousgeneration.2xlarge",
"search.previousgeneration.large",
"search.previousgeneration.small",
"search.previousgeneration.xlarge",
"search.small",
"search.xlarge",
]
}
}
impl ::std::convert::AsRef<str> for PartitionInstanceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl PartitionInstanceType {
pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
match Self::from(value) {
#[allow(deprecated)]
Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
known => Ok(known),
}
}
}
impl ::std::fmt::Display for PartitionInstanceType {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match self {
PartitionInstanceType::Search2xlarge => write!(f, "search.2xlarge"),
PartitionInstanceType::SearchLarge => write!(f, "search.large"),
PartitionInstanceType::SearchM1Large => write!(f, "search.m1.large"),
PartitionInstanceType::SearchM1Small => write!(f, "search.m1.small"),
PartitionInstanceType::SearchM22xlarge => write!(f, "search.m2.2xlarge"),
PartitionInstanceType::SearchM2Xlarge => write!(f, "search.m2.xlarge"),
PartitionInstanceType::SearchM32xlarge => write!(f, "search.m3.2xlarge"),
PartitionInstanceType::SearchM3Large => write!(f, "search.m3.large"),
PartitionInstanceType::SearchM3Medium => write!(f, "search.m3.medium"),
PartitionInstanceType::SearchM3Xlarge => write!(f, "search.m3.xlarge"),
PartitionInstanceType::SearchMedium => write!(f, "search.medium"),
PartitionInstanceType::SearchPreviousgeneration2xlarge => write!(f, "search.previousgeneration.2xlarge"),
PartitionInstanceType::SearchPreviousgenerationLarge => write!(f, "search.previousgeneration.large"),
PartitionInstanceType::SearchPreviousgenerationSmall => write!(f, "search.previousgeneration.small"),
PartitionInstanceType::SearchPreviousgenerationXlarge => write!(f, "search.previousgeneration.xlarge"),
PartitionInstanceType::SearchSmall => write!(f, "search.small"),
PartitionInstanceType::SearchXlarge => write!(f, "search.xlarge"),
PartitionInstanceType::Unknown(value) => write!(f, "{}", value),
}
}
}