1
use serde::Deserialize;
2

            
3
24
#[derive(Deserialize)]
4
pub struct RouteIdPath {
5
    pub route_id: String,
6
}
7

            
8
162
#[derive(Deserialize)]
9
pub struct PostDeviceRouteBody {
10
    pub data: PostDeviceRouteData,
11
}
12

            
13
243
#[derive(Deserialize)]
14
pub struct PostDeviceRouteData {
15
    #[serde(rename = "deviceId")]
16
    pub device_id: String,
17
    #[serde(rename = "applicationId")]
18
    pub application_id: String,
19
}
20

            
21
180
#[derive(Deserialize)]
22
pub struct PostDeviceRouteBulkBody {
23
    pub data: PostDeviceRouteBulkData,
24
}
25

            
26
360
#[derive(Deserialize)]
27
pub struct PostDeviceRouteBulkData {
28
    #[serde(rename = "applicationId")]
29
    pub application_id: String,
30
    #[serde(rename = "networkId")]
31
    pub network_id: String,
32
    #[serde(rename = "networkAddrs")]
33
    pub network_addrs: Vec<String>,
34
}
35

            
36
240
#[derive(Deserialize)]
37
pub struct PostDeviceRouteRangeBody {
38
    pub data: PostDeviceRouteRangeData,
39
}
40

            
41
600
#[derive(Deserialize)]
42
pub struct PostDeviceRouteRangeData {
43
    #[serde(rename = "applicationId")]
44
    pub application_id: String,
45
    #[serde(rename = "networkId")]
46
    pub network_id: String,
47
    #[serde(rename = "startAddr")]
48
    pub start_addr: String,
49
    #[serde(rename = "endAddr")]
50
    pub end_addr: String,
51
}
52

            
53
351
#[derive(Deserialize)]
54
pub struct GetDeviceRouteCountQuery {
55
    pub unit: Option<String>,
56
    pub application: Option<String>,
57
    pub network: Option<String>,
58
    pub device: Option<String>,
59
}
60

            
61
600
#[derive(Clone, Deserialize)]
62
pub struct GetDeviceRouteListQuery {
63
    pub unit: Option<String>,
64
    pub application: Option<String>,
65
    pub network: Option<String>,
66
    pub device: Option<String>,
67
    pub offset: Option<u64>,
68
    pub limit: Option<u64>,
69
    pub sort: Option<String>,
70
    pub format: Option<ListFormat>,
71
}
72

            
73
12
#[derive(Clone, Deserialize, PartialEq)]
74
pub enum ListFormat {
75
    #[serde(rename = "array")]
76
    Array,
77
    #[serde(rename = "data")]
78
    Data,
79
}