model/enums: add flexver variant to UpdateStrategy
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I8c82af278d54ed4730e808087fa19e846a6a6964
This commit is contained in:
parent
1c08e00ccf
commit
66317d98de
1 changed files with 4 additions and 0 deletions
|
|
@ -79,6 +79,8 @@ impl std::fmt::Display for ProjectSide {
|
|||
pub enum UpdateStrategy {
|
||||
#[serde(rename = "LATEST")]
|
||||
Latest,
|
||||
#[serde(rename = "FLEXVER")]
|
||||
FlexVer,
|
||||
#[serde(rename = "NONE")]
|
||||
None,
|
||||
}
|
||||
|
|
@ -88,6 +90,7 @@ impl FromStr for UpdateStrategy {
|
|||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s.to_uppercase().as_str() {
|
||||
"LATEST" => Ok(Self::Latest),
|
||||
"FLEXVER" => Ok(Self::FlexVer),
|
||||
"NONE" => Ok(Self::None),
|
||||
_ => Err(format!("Invalid update strategy: {s}")),
|
||||
}
|
||||
|
|
@ -98,6 +101,7 @@ impl std::fmt::Display for UpdateStrategy {
|
|||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Latest => write!(f, "LATEST"),
|
||||
Self::FlexVer => write!(f, "FLEXVER"),
|
||||
Self::None => write!(f, "NONE"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue