1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5#[serde(rename_all = "lowercase")]
6pub enum SecurityProfile {
7 Permissive,
8 Moderate,
9 Restrictive,
10}
11
12#[derive(Debug, Default, Serialize)]
14pub struct RunOptions {
15 #[serde(skip_serializing_if = "Option::is_none")]
16 pub image: Option<String>,
17 #[serde(skip_serializing_if = "Option::is_none")]
18 pub profile: Option<SecurityProfile>,
19 #[serde(skip_serializing_if = "Option::is_none")]
20 pub fast: Option<bool>,
21}
22
23#[derive(Debug, Deserialize)]
25pub struct RunOutput {
26 pub output: String,
27}
28
29#[derive(Debug, Deserialize)]
31pub struct SandboxInfo {
32 pub name: String,
33 pub status: String,
34 pub backend: String,
35}
36
37#[derive(Debug)]
39pub struct StreamEvent {
40 pub event_type: String,
41 pub data: serde_json::Value,
42}
43
44#[derive(Debug, Deserialize)]
46pub(crate) struct ApiResponse<T> {
47 pub success: bool,
48 pub data: Option<T>,
49 pub error: Option<String>,
50}
51
52#[derive(Serialize)]
54pub(crate) struct RunRequest {
55 pub command: Vec<String>,
56 #[serde(skip_serializing_if = "Option::is_none")]
57 pub image: Option<String>,
58 #[serde(skip_serializing_if = "Option::is_none")]
59 pub profile: Option<SecurityProfile>,
60 pub fast: bool,
61}
62
63#[derive(Serialize)]
65pub(crate) struct CreateRequest {
66 pub name: String,
67 #[serde(skip_serializing_if = "Option::is_none")]
68 pub image: Option<String>,
69}
70
71#[derive(Serialize)]
73pub(crate) struct ExecRequest {
74 pub command: Vec<String>,
75}