35 lines
800 B
Rust
35 lines
800 B
Rust
|
use std::collections::HashMap;
|
||
|
|
||
|
use serde::Deserialize;
|
||
|
|
||
|
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||
|
#[serde(untagged)]
|
||
|
pub enum CuddleBase {
|
||
|
Bool(bool),
|
||
|
String(String),
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||
|
pub struct CuddleShellScript {
|
||
|
pub description: Option<String>,
|
||
|
}
|
||
|
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||
|
pub struct CuddleDaggerScript {
|
||
|
pub description: Option<String>,
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||
|
#[serde(tag = "type")]
|
||
|
pub enum CuddleScript {
|
||
|
#[serde(alias = "shell")]
|
||
|
Shell(CuddleShellScript),
|
||
|
#[serde(alias = "dagger")]
|
||
|
Dagger(CuddleDaggerScript),
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Clone, PartialEq, Deserialize)]
|
||
|
pub struct CuddlePlan {
|
||
|
pub base: CuddleBase,
|
||
|
pub scripts: Option<HashMap<String, CuddleScript>>,
|
||
|
}
|