1use crate::dto::prelude::*;
2
3#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
8pub enum AppCommand {
9 SetStatus(AppStatus),
10 SetCyclesFundingEnabled(bool),
11}
12
13#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
18pub enum AppCommandResponse {
19 Status(SetStateResponse<AppStatus>),
20 CyclesFundingEnabled(SetStateResponse<bool>),
21}
22
23#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
28pub struct SetStateResponse<T> {
29 pub previous: T,
30 pub current: T,
31 pub changed: bool,
32}
33
34#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
39pub enum AppStatus {
40 Active,
41 Readonly,
42 Stopped,
43}
44
45#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
50pub enum AppMode {
51 Enabled,
52 Readonly,
53 Disabled,
54}
55
56#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
61pub struct AppStateInput {
62 pub mode: AppMode,
63 pub cycles_funding_enabled: bool,
64}
65
66#[derive(CandidType, Deserialize)]
71pub struct AppStateResponse {
72 pub mode: AppMode,
73 pub cycles_funding_enabled: bool,
74}
75
76#[derive(CandidType, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
81pub struct SubnetAuthStateInput {}
82
83#[derive(CandidType, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
88pub struct SubnetStateInput {
89 pub auth: SubnetAuthStateInput,
90}
91
92#[derive(CandidType, Clone, Debug, Default, Deserialize, Eq, PartialEq)]
97pub struct SubnetStateResponse {
98 pub auth: SubnetAuthStateInput,
99}
100
101#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
106pub struct BootstrapStatusResponse {
107 pub ready: bool,
108 pub phase: String,
109 pub last_error: Option<String>,
110}