workyard_application/actions/recover/
input.rs1use schemars::JsonSchema;
2use serde::Deserialize;
3use trine::NativePath;
4
5#[derive(Default, Deserialize, JsonSchema)]
7#[serde(deny_unknown_fields)]
8pub struct RecoverInput {
9 pub task: Option<String>,
11 #[serde(default)]
13 pub activate_here: bool,
14 pub workspace: Option<NativePath>,
16 #[serde(default)]
18 pub undo: bool,
19 #[serde(default)]
21 pub yes: bool,
22 #[serde(default)]
24 pub force: bool,
25}
26
27#[derive(Deserialize, JsonSchema)]
28#[serde(deny_unknown_fields)]
29pub(crate) struct NamedParticipantRecovery {
30 pub task: String,
32 pub workspace: Option<NativePath>,
34}
35
36#[derive(Deserialize, JsonSchema)]
37#[serde(from = "RecoverInput")]
38#[schemars(rename = "RecoverInput")]
39pub(crate) enum RecoveryRequest {
40 General(RecoverInput),
41 Participants(NamedParticipantRecovery),
42}
43
44impl From<RecoverInput> for RecoveryRequest {
45 fn from(input: RecoverInput) -> Self {
46 Self::General(input)
47 }
48}