mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
21 lines
551 B
Rust
21 lines
551 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::ActionId;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub enum ProcedureName {
|
|
CreateBackup,
|
|
GetActionInput(ActionId),
|
|
RunAction(ActionId),
|
|
}
|
|
|
|
impl ProcedureName {
|
|
pub fn js_function_name(&self) -> String {
|
|
match self {
|
|
ProcedureName::CreateBackup => "/backup/create".to_string(),
|
|
ProcedureName::RunAction(id) => format!("/actions/{}/run", id),
|
|
ProcedureName::GetActionInput(id) => format!("/actions/{}/getInput", id),
|
|
}
|
|
}
|
|
}
|