#[allow(missing_docs)] #[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 ServerSideEncryption {
#[allow(missing_docs)] Aes256,
#[allow(missing_docs)] AwsFsx,
#[allow(missing_docs)] AwsKms,
#[allow(missing_docs)] AwsKmsDsse,
#[deprecated(
note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants."
)]
Unknown(crate::model::sealed_enum_unknown::UnknownVariantValue),
}
impl ::std::convert::From<&str> for ServerSideEncryption {
fn from(s: &str) -> Self {
match s {
"AES256" => ServerSideEncryption::Aes256,
"aws:fsx" => ServerSideEncryption::AwsFsx,
"aws:kms" => ServerSideEncryption::AwsKms,
"aws:kms:dsse" => ServerSideEncryption::AwsKmsDsse,
other => ServerSideEncryption::Unknown(
crate::model::sealed_enum_unknown::UnknownVariantValue(other.to_owned()),
),
}
}
}
impl ::std::str::FromStr for ServerSideEncryption {
type Err = ::std::convert::Infallible;
fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
::std::result::Result::Ok(ServerSideEncryption::from(s))
}
}
impl ServerSideEncryption {
pub fn as_str(&self) -> &str {
match self {
ServerSideEncryption::Aes256 => "AES256",
ServerSideEncryption::AwsFsx => "aws:fsx",
ServerSideEncryption::AwsKms => "aws:kms",
ServerSideEncryption::AwsKmsDsse => "aws:kms:dsse",
ServerSideEncryption::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["AES256", "aws:fsx", "aws:kms", "aws:kms:dsse"]
}
}
impl ::std::convert::AsRef<str> for ServerSideEncryption {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl ServerSideEncryption {
pub fn try_parse(
value: &str,
) -> ::std::result::Result<Self, crate::model::error::UnknownVariantError> {
match Self::from(value) {
#[allow(deprecated)]
Self::Unknown(_) => {
::std::result::Result::Err(crate::model::error::UnknownVariantError::new(value))
}
known => Ok(known),
}
}
}
impl ::std::fmt::Display for ServerSideEncryption {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match self {
ServerSideEncryption::Aes256 => write!(f, "AES256"),
ServerSideEncryption::AwsFsx => write!(f, "aws:fsx"),
ServerSideEncryption::AwsKms => write!(f, "aws:kms"),
ServerSideEncryption::AwsKmsDsse => write!(f, "aws:kms:dsse"),
ServerSideEncryption::Unknown(value) => write!(f, "{value}"),
}
}
}