aws_sdk_appconfig/types/
_deployment_event_type.rs1#[allow(missing_docs)] #[non_exhaustive]
46#[derive(
47 ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
48)]
49pub enum DeploymentEventType {
50 #[allow(missing_docs)] BakeTimeStarted,
52 #[allow(missing_docs)] DeploymentCompleted,
54 #[allow(missing_docs)] DeploymentStarted,
56 #[allow(missing_docs)] PercentageUpdated,
58 #[allow(missing_docs)] RevertCompleted,
60 #[allow(missing_docs)] RollbackCompleted,
62 #[allow(missing_docs)] RollbackStarted,
64 #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
66 Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
67}
68impl ::std::convert::From<&str> for DeploymentEventType {
69 fn from(s: &str) -> Self {
70 match s {
71 "BAKE_TIME_STARTED" => DeploymentEventType::BakeTimeStarted,
72 "DEPLOYMENT_COMPLETED" => DeploymentEventType::DeploymentCompleted,
73 "DEPLOYMENT_STARTED" => DeploymentEventType::DeploymentStarted,
74 "PERCENTAGE_UPDATED" => DeploymentEventType::PercentageUpdated,
75 "REVERT_COMPLETED" => DeploymentEventType::RevertCompleted,
76 "ROLLBACK_COMPLETED" => DeploymentEventType::RollbackCompleted,
77 "ROLLBACK_STARTED" => DeploymentEventType::RollbackStarted,
78 other => DeploymentEventType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
79 }
80 }
81}
82impl ::std::str::FromStr for DeploymentEventType {
83 type Err = ::std::convert::Infallible;
84
85 fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
86 ::std::result::Result::Ok(DeploymentEventType::from(s))
87 }
88}
89impl DeploymentEventType {
90 pub fn as_str(&self) -> &str {
92 match self {
93 DeploymentEventType::BakeTimeStarted => "BAKE_TIME_STARTED",
94 DeploymentEventType::DeploymentCompleted => "DEPLOYMENT_COMPLETED",
95 DeploymentEventType::DeploymentStarted => "DEPLOYMENT_STARTED",
96 DeploymentEventType::PercentageUpdated => "PERCENTAGE_UPDATED",
97 DeploymentEventType::RevertCompleted => "REVERT_COMPLETED",
98 DeploymentEventType::RollbackCompleted => "ROLLBACK_COMPLETED",
99 DeploymentEventType::RollbackStarted => "ROLLBACK_STARTED",
100 DeploymentEventType::Unknown(value) => value.as_str(),
101 }
102 }
103 pub const fn values() -> &'static [&'static str] {
105 &[
106 "BAKE_TIME_STARTED",
107 "DEPLOYMENT_COMPLETED",
108 "DEPLOYMENT_STARTED",
109 "PERCENTAGE_UPDATED",
110 "REVERT_COMPLETED",
111 "ROLLBACK_COMPLETED",
112 "ROLLBACK_STARTED",
113 ]
114 }
115}
116impl ::std::convert::AsRef<str> for DeploymentEventType {
117 fn as_ref(&self) -> &str {
118 self.as_str()
119 }
120}
121impl DeploymentEventType {
122 pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
126 match Self::from(value) {
127 #[allow(deprecated)]
128 Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
129 known => Ok(known),
130 }
131 }
132}
133impl ::std::fmt::Display for DeploymentEventType {
134 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
135 match self {
136 DeploymentEventType::BakeTimeStarted => write!(f, "BAKE_TIME_STARTED"),
137 DeploymentEventType::DeploymentCompleted => write!(f, "DEPLOYMENT_COMPLETED"),
138 DeploymentEventType::DeploymentStarted => write!(f, "DEPLOYMENT_STARTED"),
139 DeploymentEventType::PercentageUpdated => write!(f, "PERCENTAGE_UPDATED"),
140 DeploymentEventType::RevertCompleted => write!(f, "REVERT_COMPLETED"),
141 DeploymentEventType::RollbackCompleted => write!(f, "ROLLBACK_COMPLETED"),
142 DeploymentEventType::RollbackStarted => write!(f, "ROLLBACK_STARTED"),
143 DeploymentEventType::Unknown(value) => write!(f, "{value}"),
144 }
145 }
146}