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

            
4
246
#[derive(Deserialize)]
5
pub struct NetworkIdPath {
6
    pub network_id: String,
7
}
8

            
9
132
#[derive(Deserialize)]
10
pub struct PostNetworkBody {
11
    pub data: PostNetworkData,
12
}
13

            
14
276
#[derive(Deserialize)]
15
pub struct PostNetworkData {
16
    pub code: String,
17
    #[serde(rename = "unitId")]
18
    pub unit_id: Option<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 GetNetworkCountQuery {
27
    pub unit: Option<String>,
28
    pub code: Option<String>,
29
    pub contains: Option<String>,
30
}
31

            
32
354
#[derive(Clone, Deserialize)]
33
pub struct GetNetworkListQuery {
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
102
#[derive(Deserialize)]
44
pub struct PatchNetworkBody {
45
    pub data: PatchNetworkData,
46
}
47

            
48
138
#[derive(Deserialize)]
49
pub struct PatchNetworkData {
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
}