#[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 Runtime {
#[allow(missing_docs)] Corretto11,
#[allow(missing_docs)] Corretto8,
#[allow(missing_docs)] Dotnet6,
#[allow(missing_docs)] Go1,
#[allow(missing_docs)] Nodejs12,
#[allow(missing_docs)] Nodejs14,
#[allow(missing_docs)] Nodejs16,
#[allow(missing_docs)] Nodejs18,
#[allow(missing_docs)] Nodejs22,
#[allow(missing_docs)] Php81,
#[allow(missing_docs)] Python3,
#[allow(missing_docs)] Python311,
#[allow(missing_docs)] Ruby31,
#[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 Runtime {
fn from(s: &str) -> Self {
match s {
"CORRETTO_11" => Runtime::Corretto11,
"CORRETTO_8" => Runtime::Corretto8,
"DOTNET_6" => Runtime::Dotnet6,
"GO_1" => Runtime::Go1,
"NODEJS_12" => Runtime::Nodejs12,
"NODEJS_14" => Runtime::Nodejs14,
"NODEJS_16" => Runtime::Nodejs16,
"NODEJS_18" => Runtime::Nodejs18,
"NODEJS_22" => Runtime::Nodejs22,
"PHP_81" => Runtime::Php81,
"PYTHON_3" => Runtime::Python3,
"PYTHON_311" => Runtime::Python311,
"RUBY_31" => Runtime::Ruby31,
other => Runtime::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
}
}
}
impl ::std::str::FromStr for Runtime {
type Err = ::std::convert::Infallible;
fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
::std::result::Result::Ok(Runtime::from(s))
}
}
impl Runtime {
pub fn as_str(&self) -> &str {
match self {
Runtime::Corretto11 => "CORRETTO_11",
Runtime::Corretto8 => "CORRETTO_8",
Runtime::Dotnet6 => "DOTNET_6",
Runtime::Go1 => "GO_1",
Runtime::Nodejs12 => "NODEJS_12",
Runtime::Nodejs14 => "NODEJS_14",
Runtime::Nodejs16 => "NODEJS_16",
Runtime::Nodejs18 => "NODEJS_18",
Runtime::Nodejs22 => "NODEJS_22",
Runtime::Php81 => "PHP_81",
Runtime::Python3 => "PYTHON_3",
Runtime::Python311 => "PYTHON_311",
Runtime::Ruby31 => "RUBY_31",
Runtime::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"CORRETTO_11",
"CORRETTO_8",
"DOTNET_6",
"GO_1",
"NODEJS_12",
"NODEJS_14",
"NODEJS_16",
"NODEJS_18",
"NODEJS_22",
"PHP_81",
"PYTHON_3",
"PYTHON_311",
"RUBY_31",
]
}
}
impl ::std::convert::AsRef<str> for Runtime {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl Runtime {
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 Runtime {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match self {
Runtime::Corretto11 => write!(f, "CORRETTO_11"),
Runtime::Corretto8 => write!(f, "CORRETTO_8"),
Runtime::Dotnet6 => write!(f, "DOTNET_6"),
Runtime::Go1 => write!(f, "GO_1"),
Runtime::Nodejs12 => write!(f, "NODEJS_12"),
Runtime::Nodejs14 => write!(f, "NODEJS_14"),
Runtime::Nodejs16 => write!(f, "NODEJS_16"),
Runtime::Nodejs18 => write!(f, "NODEJS_18"),
Runtime::Nodejs22 => write!(f, "NODEJS_22"),
Runtime::Php81 => write!(f, "PHP_81"),
Runtime::Python3 => write!(f, "PYTHON_3"),
Runtime::Python311 => write!(f, "PYTHON_311"),
Runtime::Ruby31 => write!(f, "RUBY_31"),
Runtime::Unknown(value) => write!(f, "{value}"),
}
}
}