supercode_interchange/orchestration/
profile.rs1use std::collections::BTreeMap;
5use std::path::PathBuf;
6
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9use serde_json::Value;
10
11use super::{Access, ChannelConfig, Fire, Job, Obligation, Route, WebhookSubscription, WorkerSpec};
12use crate::ontology::Binding;
13
14#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
16pub struct PersonaRef {
17 pub path: String,
19 #[serde(default)]
21 pub text: Option<String>,
22 pub sha256: String,
24}
25
26#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
28pub struct ProfileResidue {
29 #[serde(default)]
31 pub config: BTreeMap<String, Value>,
32 #[serde(default)]
34 pub files: Vec<String>,
35}
36
37#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
39pub struct Profile {
40 pub name: String,
42 pub dir: PathBuf,
44 #[serde(default)]
46 pub worker: Option<WorkerSpec>,
47 #[serde(default)]
49 pub persona: Option<PersonaRef>,
50 #[serde(default)]
52 pub channels: BTreeMap<String, ChannelConfig>,
53 #[serde(default)]
55 pub routes: Vec<Route>,
56 #[serde(default)]
58 pub jobs: BTreeMap<String, Job>,
59 #[serde(default)]
61 pub subscriptions: BTreeMap<String, WebhookSubscription>,
62 #[serde(default)]
64 pub access: Access,
65 #[serde(default)]
68 pub bindings: BTreeMap<String, Binding>,
69 #[serde(default)]
71 pub fires: Vec<Fire>,
72 #[serde(default)]
74 pub obligations: Vec<Obligation>,
75 #[serde(default)]
77 pub residue: ProfileResidue,
78}
79
80#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
83pub struct Orchestration {
84 pub root: PathBuf,
86 pub profiles: BTreeMap<String, Profile>,
88}