aboutsummaryrefslogtreecommitdiff
path: root/lockchain-http/src/models/inputs.rs
blob: b4c775fda28fa251f8f08e15265518965de2b38b (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
use crate::lockchain::users::Role;

/// Fields provided when creating a new vault
#[derive(Serialize, Deserialize)]
pub struct VaultCreate {
    pub name: String,
    pub location: String,
    pub token: String,
}

/// Fields provided when deleting a vault
#[derive(Serialize, Deserialize)]
pub struct VaultDelete {
    pub name: String,
    pub location: String,
    pub token: String,
}

/// Add a vault to the API scope
#[derive(Serialize, Deserialize)]
pub struct ScopeVault {
    pub name: String,
    pub location: String,
    pub token: String,
}

/// Remove a vault from the API scope
#[derive(Serialize, Deserialize)]
pub struct UnscopeVault {
    pub name: String,
    pub location: String,
    pub token: String,
}

#[derive(Serialize, Deserialize)]
pub struct UpdateVault {
    pub name: String,
    pub token: String,
}

#[derive(Serialize, Deserialize)]
pub struct CreateRecord {
    pub vault: String,
    pub token: String,
}

/// Query to get a record
#[derive(Serialize, Deserialize)]
pub struct GetRecord {
    pub name: String,
    pub range: Option<(u32, u32)>,
    pub token: String,
}

#[derive(Serialize, Deserialize)]
pub struct UpdateRecord {
    pub vault: String,
    pub record: String,
    pub token: String,
}

#[derive(Serialize, Deserialize)]
pub struct DeleteRecord {
    pub vault: String,
    pub record: String,
    pub token: String,
}

#[derive(Serialize, Deserialize)]
pub struct Authenticate {
    pub username: String,
    pub password: String,
}

#[derive(Serialize, Deserialize)]
pub struct Deauthenticate {
    pub token: String,
}