1use crate::dto::prelude::*;
2use crate::ids::WasmStoreBinding;
3
4#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
9pub enum AppCommand {
10 SetStatus(AppStatus),
11 SetCyclesFundingEnabled(bool),
12}
13
14#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
19pub enum AppStatus {
20 Active,
21 Readonly,
22 Stopped,
23}
24
25#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
30pub enum AppMode {
31 Enabled,
32 Readonly,
33 Disabled,
34}
35
36#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq)]
41pub struct AppStateInput {
42 pub mode: AppMode,
43 pub cycles_funding_enabled: bool,
44}
45
46#[derive(CandidType, Deserialize)]
51pub struct AppStateResponse {
52 pub mode: AppMode,
53 pub cycles_funding_enabled: bool,
54}
55
56#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
61pub struct WasmStoreStateInput {
62 pub binding: WasmStoreBinding,
63 pub pid: Principal,
64 pub created_at: u64,
65}
66
67#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
72pub struct SubnetStateInput {
73 pub wasm_stores: Option<Vec<WasmStoreStateInput>>,
74}
75
76#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
81pub struct WasmStoreStateResponse {
82 pub binding: WasmStoreBinding,
83 pub pid: Principal,
84 pub created_at: u64,
85}
86
87#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
88pub struct SubnetStateResponse {
89 pub wasm_stores: Vec<WasmStoreStateResponse>,
90}