1#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct APIError {
10 pub status: i32,
11
12 pub title: String,
13
14 pub detail: String,
15}
16
17
18#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
20#[serde(rename_all = "camelCase")]
21pub struct PingResponse {
22 pub server: String,
23
24 pub version: String,
25}
26
27
28#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
30#[serde(rename_all = "camelCase")]
31pub struct BusListResponse {
32 pub buses: Vec<u32>,
33}
34
35
36#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
38#[serde(rename_all = "camelCase")]
39pub struct BusCreateResponse {
40 #[serde(rename = "busId")]
41 pub bus_id: u32,
42}
43
44
45#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
47#[serde(rename_all = "camelCase")]
48pub struct BusRemoveResponse {
49 #[serde(rename = "busId")]
50 pub bus_id: u32,
51}
52
53
54#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
56#[serde(rename_all = "camelCase")]
57pub struct Device {
58 #[serde(rename = "busId")]
59 pub bus_id: u32,
60
61 #[serde(rename = "devId")]
62 pub dev_id: String,
63
64 pub vid: String,
65
66 pub pid: String,
67
68 #[serde(rename = "type")]
69 pub r#type: String,
70
71 #[serde(rename = "deviceSpecific")]
72 pub device_specific: std::collections::HashMap<String, serde_json::Value>,
73}
74
75
76#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
78#[serde(rename_all = "camelCase")]
79pub struct DevicesListResponse {
80 pub devices: Vec<Device>,
81}
82
83
84#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
86#[serde(rename_all = "camelCase")]
87pub struct DeviceRemoveResponse {
88 #[serde(rename = "busId")]
89 pub bus_id: u32,
90
91 #[serde(rename = "devId")]
92 pub dev_id: String,
93}
94
95
96#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
98#[serde(rename_all = "camelCase")]
99pub struct DeviceCreateRequest {
100 #[serde(skip_serializing_if = "Option::is_none")]
101 #[serde(rename = "type")]
102 pub r#type: Option<String>,
103
104 #[serde(skip_serializing_if = "Option::is_none")]
105 #[serde(rename = "idVendor")]
106 pub id_vendor: Option<u16>,
107
108 #[serde(skip_serializing_if = "Option::is_none")]
109 #[serde(rename = "idProduct")]
110 pub id_product: Option<u16>,
111
112 #[serde(skip_serializing_if = "Option::is_none")]
113 #[serde(rename = "deviceSpecific")]
114 pub device_specific: Option<std::collections::HashMap<String, serde_json::Value>>,
115}
116
117