1
use serde::Deserialize;
2
use serde_with;
3

            
4
116
#[derive(Deserialize)]
5
pub struct ClientIdPath {
6
    pub client_id: String,
7
}
8

            
9
4
#[derive(Deserialize)]
10
pub struct UserIdPath {
11
    pub user_id: String,
12
}
13

            
14
50
#[derive(Deserialize)]
15
pub struct PostClientBody {
16
    pub data: PostClientData,
17
    pub credentials: Option<bool>,
18
}
19

            
20
126
#[derive(Deserialize)]
21
pub struct PostClientData {
22
    #[serde(rename = "redirectUris")]
23
    pub redirect_uris: Vec<String>,
24
    pub scopes: Vec<String>,
25
    #[serde(rename = "userId")]
26
    pub user_id: Option<String>,
27
    pub name: String,
28
    pub image: Option<String>,
29
}
30

            
31
10
#[derive(Deserialize)]
32
pub struct GetClientCountQuery {
33
    pub user: Option<String>,
34
}
35

            
36
128
#[derive(Clone, Deserialize)]
37
pub struct GetClientListQuery {
38
    pub user: Option<String>,
39
    pub offset: Option<u64>,
40
    pub limit: Option<u64>,
41
    pub sort: Option<String>,
42
    pub format: Option<ListFormat>,
43
}
44

            
45
72
#[derive(Deserialize)]
46
pub struct PatchClientBody {
47
    pub data: Option<PatchClientData>,
48
    #[serde(rename = "regenSecret")]
49
    pub regen_secret: Option<bool>,
50
}
51

            
52
96
#[derive(Deserialize)]
53
pub struct PatchClientData {
54
    #[serde(rename = "redirectUris")]
55
    pub redirect_uris: Option<Vec<String>>,
56
    pub scopes: Option<Vec<String>>,
57
    pub name: Option<String>,
58
    #[serde(default, with = "serde_with::rust::double_option")]
59
    pub image: Option<Option<String>>,
60
}
61

            
62
8
#[derive(Clone, Deserialize, PartialEq)]
63
pub enum ListFormat {
64
    #[serde(rename = "array")]
65
    Array,
66
    #[serde(rename = "data")]
67
    Data,
68
}