1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use serde::Deserialize;

use crate::Error;

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct AppStopAll {
    pub already_in_process: Vec<String>,
    pub already_offline: Vec<String>,
    pub stopped: Vec<String>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct AppStopResponseUnique {
    pub message: String,
    pub status: String,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct AppStopResponseAll {
    pub message: String,
    pub status: String,
    pub apps: AppStopAll,
}

#[derive(Debug)]
pub enum AppStopError {
    AlreadyOffline,
    Other(Error),
}

impl From<Error> for AppStopError {
    fn from(error: Error) -> Self {
        Self::Other(error)
    }
}