#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApiError {
pub status: i32,
pub title: String,
pub detail: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PingResponse {
pub server: String,
pub version: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BusListResponse {
pub buses: Vec<u32>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BusCreateResponse {
#[serde(rename = "busId")]
pub bus_id: u32,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BusRemoveResponse {
#[serde(rename = "busId")]
pub bus_id: u32,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Device {
#[serde(rename = "busId")]
pub bus_id: u32,
#[serde(rename = "devId")]
pub dev_id: String,
pub vid: String,
pub pid: String,
#[serde(rename = "type")]
pub r#type: String,
#[serde(rename = "deviceSpecific")]
pub device_specific: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DevicesListResponse {
pub devices: Vec<Device>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DeviceRemoveResponse {
#[serde(rename = "busId")]
pub bus_id: u32,
#[serde(rename = "devId")]
pub dev_id: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DeviceCreateRequest {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "idVendor")]
pub id_vendor: Option<u16>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "idProduct")]
pub id_product: Option<u16>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "deviceSpecific")]
pub device_specific: Option<std::collections::HashMap<String, serde_json::Value>>,
}