1use serde::{Deserialize, Serialize};
2
3use crate::{Run, Sandbox, SandboxId, SandboxSpec};
4
5#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
10#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
11#[cfg_attr(feature = "typescript", ts(export_to = "controller-api.ts"))]
12pub struct Execution {
13 pub id: SandboxId,
14 pub owner: Option<String>,
17 pub spec: SandboxSpec,
18 pub run: Run,
19 pub replays: Vec<Run>,
21}
22
23impl From<Sandbox> for Execution {
24 fn from(sandbox: Sandbox) -> Self {
25 Self {
26 id: sandbox.id,
27 owner: sandbox.owner,
28 spec: sandbox.spec,
29 run: sandbox.run,
30 replays: sandbox.replays,
31 }
32 }
33}