Lines
100 %
Functions
42.11 %
Branches
use serde::Deserialize;
use serde_json::{Map, Value};
#[derive(Deserialize)]
pub struct DeviceIdPath {
pub device_id: String,
}
pub struct PostDeviceBody {
pub data: PostDeviceData,
pub struct PostDeviceData {
#[serde(rename = "unitId")]
pub unit_id: String,
#[serde(rename = "networkId")]
pub network_id: String,
#[serde(rename = "networkAddr")]
pub network_addr: String,
pub profile: Option<String>,
pub name: Option<String>,
pub info: Option<Map<String, Value>>,
pub struct PostDeviceBulkBody {
pub data: PostDeviceBulkData,
pub struct PostDeviceBulkData {
#[serde(rename = "networkAddrs")]
pub network_addrs: Vec<String>,
pub struct PostDeviceRangeBody {
pub data: PostDeviceRangeData,
pub struct PostDeviceRangeData {
#[serde(rename = "startAddr")]
pub start_addr: String,
#[serde(rename = "endAddr")]
pub end_addr: String,
pub struct GetDeviceCountQuery {
pub unit: Option<String>,
pub network: Option<String>,
pub addr: Option<String>,
pub contains: Option<String>,
#[derive(Clone, Deserialize)]
pub struct GetDeviceListQuery {
pub offset: Option<u64>,
pub limit: Option<u64>,
pub sort: Option<String>,
pub format: Option<ListFormat>,
pub struct PatchDeviceBody {
pub data: PatchDeviceData,
pub struct PatchDeviceData {
pub network_id: Option<String>,
pub network_addr: Option<String>,
#[derive(Clone, Deserialize, PartialEq)]
pub enum ListFormat {
#[serde(rename = "array")]
Array,
#[serde(rename = "data")]
Data,