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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use lockchain::errors::Error as LockError;
use serde::{de::DeserializeOwned, Serialize};
#[derive(Serialize, Deserialize)]
pub struct CarrierMessage<T: Serialize + DeserializeOwned> {
pub error: Result<(), LockError>,
#[serde(bound(deserialize = "T: Serialize + DeserializeOwned"))]
pub data: Option<T>,
}
#[derive(Serialize, Deserialize)]
pub struct OperationFailed {
pub reason: String,
pub code: u32,
}
#[derive(Serialize, Deserialize)]
pub struct ApiInformation {
pub version: String,
pub providers: Vec<String>,
pub hostname: Option<String>,
pub supported: String,
}
#[derive(Serialize, Deserialize)]
pub struct VaultList {
pub vaults: Vec<String>,
pub count: usize,
}
#[derive(Serialize, Deserialize)]
pub struct VaultCreate {
pub name: String,
pub location: String,
}
#[derive(Serialize, Deserialize)]
pub struct VaultCreateResponse {
pub name: String,
pub created: bool,
pub error: Option<String>,
}