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

            
4
82
#[derive(Deserialize, Serialize)]
5
pub struct PostApplicationBody {
6
    pub data: PostApplicationData,
7
}
8

            
9
222
#[derive(Deserialize, Serialize)]
10
pub struct PostApplicationData {
11
    pub code: String,
12
    #[serde(rename = "unitId")]
13
    pub unit_id: String,
14
    #[serde(rename = "hostUri")]
15
    pub host_uri: String,
16
    pub name: Option<String>,
17
    pub info: Option<Map<String, Value>>,
18
    #[serde(skip_serializing)]
19
    pub ttl: Option<usize>,
20
    #[serde(skip_serializing)]
21
    pub length: Option<usize>,
22
}
23

            
24
52
#[derive(Deserialize, Serialize)]
25
pub struct PatchApplicationBody {
26
    pub data: PatchApplicationData,
27
}
28

            
29
80
#[derive(Default, Deserialize, Serialize)]
30
pub struct PatchApplicationData {
31
    #[serde(rename = "hostUri", skip_serializing_if = "Option::is_none")]
32
    pub host_uri: Option<String>,
33
    #[serde(skip_serializing_if = "Option::is_none")]
34
    pub name: Option<String>,
35
    #[serde(skip_serializing_if = "Option::is_none")]
36
    pub info: Option<Map<String, Value>>,
37
    #[serde(skip_serializing)]
38
    pub ttl: Option<usize>,
39
    #[serde(skip_serializing)]
40
    pub length: Option<usize>,
41
    #[serde(skip_serializing)]
42
    pub password: Option<String>,
43
}
44

            
45
28
#[derive(Deserialize)]
46
pub struct PostApplicationDlDataBody {
47
    pub data: PostApplicationDlData,
48
}
49

            
50
42
#[derive(Deserialize)]
51
pub struct PostApplicationDlData {
52
    #[serde(rename = "deviceId")]
53
    pub device_id: String,
54
    pub payload: String,
55
}
56

            
57
94
#[derive(Deserialize, Serialize)]
58
pub struct PostNetworkBody {
59
    pub data: PostNetworkData,
60
}
61

            
62
260
#[derive(Deserialize, Serialize)]
63
pub struct PostNetworkData {
64
    pub code: String,
65
    #[serde(rename = "unitId")]
66
    pub unit_id: Option<String>,
67
    #[serde(rename = "hostUri")]
68
    pub host_uri: String,
69
    pub name: Option<String>,
70
    pub info: Option<Map<String, Value>>,
71
    #[serde(skip_serializing)]
72
    pub ttl: Option<usize>,
73
    #[serde(skip_serializing)]
74
    pub length: Option<usize>,
75
}
76

            
77
52
#[derive(Deserialize, Serialize)]
78
pub struct PatchNetworkBody {
79
    pub data: PatchNetworkData,
80
}
81

            
82
80
#[derive(Default, Deserialize, Serialize)]
83
pub struct PatchNetworkData {
84
    #[serde(rename = "hostUri", skip_serializing_if = "Option::is_none")]
85
    pub host_uri: Option<String>,
86
    #[serde(skip_serializing_if = "Option::is_none")]
87
    pub name: Option<String>,
88
    #[serde(skip_serializing_if = "Option::is_none")]
89
    pub info: Option<Map<String, Value>>,
90
    #[serde(skip_serializing)]
91
    pub ttl: Option<usize>,
92
    #[serde(skip_serializing)]
93
    pub length: Option<usize>,
94
    #[serde(skip_serializing)]
95
    pub password: Option<String>,
96
}
97

            
98
28
#[derive(Deserialize)]
99
pub struct PostNetworkUlDataBody {
100
    pub data: PostNetworkUlData,
101
}
102

            
103
42
#[derive(Deserialize)]
104
pub struct PostNetworkUlData {
105
    #[serde(rename = "deviceId")]
106
    pub device_id: String,
107
    pub payload: String,
108
}