1
use serde::Deserialize;
2
use serde_json::{Map, Value};
3

            
4
192
#[derive(Deserialize)]
5
pub struct ApplicationIdPath {
6
    pub application_id: String,
7
}
8

            
9
84
#[derive(Deserialize)]
10
pub struct PostApplicationBody {
11
    pub data: PostApplicationData,
12
}
13

            
14
177
#[derive(Deserialize)]
15
pub struct PostApplicationData {
16
    pub code: String,
17
    #[serde(rename = "unitId")]
18
    pub unit_id: String,
19
    #[serde(rename = "hostUri")]
20
    pub host_uri: String,
21
    pub name: Option<String>,
22
    pub info: Option<Map<String, Value>>,
23
}
24

            
25
135
#[derive(Deserialize)]
26
pub struct GetApplicationCountQuery {
27
    pub unit: Option<String>,
28
    pub code: Option<String>,
29
    pub contains: Option<String>,
30
}
31

            
32
345
#[derive(Clone, Deserialize)]
33
pub struct GetApplicationListQuery {
34
    pub unit: Option<String>,
35
    pub code: Option<String>,
36
    pub contains: Option<String>,
37
    pub offset: Option<u64>,
38
    pub limit: Option<u64>,
39
    pub sort: Option<String>,
40
    pub format: Option<ListFormat>,
41
}
42

            
43
78
#[derive(Deserialize)]
44
pub struct PatchApplicationBody {
45
    pub data: PatchApplicationData,
46
}
47

            
48
99
#[derive(Deserialize)]
49
pub struct PatchApplicationData {
50
    #[serde(rename = "hostUri")]
51
    pub host_uri: Option<String>,
52
    pub name: Option<String>,
53
    pub info: Option<Map<String, Value>>,
54
}
55

            
56
12
#[derive(Clone, Deserialize, PartialEq)]
57
pub enum ListFormat {
58
    #[serde(rename = "array")]
59
    Array,
60
    #[serde(rename = "data")]
61
    Data,
62
}