use serde::Serialize; use serde_json::{Map, Value}; #[derive(Debug, Serialize)] pub struct PostNetwork { pub data: PostNetworkData, } #[derive(Debug, Serialize)] pub struct PostNetworkData { pub code: String, #[serde(rename = "unitId")] pub unit_id: Option, #[serde(rename = "hostUri")] pub host_uri: String, #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub info: Option>, } #[derive(Debug, Default, Serialize)] pub struct GetNetworkCount { #[serde(skip_serializing_if = "Option::is_none")] pub unit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub code: Option, #[serde(skip_serializing_if = "Option::is_none")] pub contains: Option, } #[derive(Debug, Default, Serialize)] pub struct GetNetworkList { #[serde(skip_serializing_if = "Option::is_none")] pub unit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub code: Option, #[serde(skip_serializing_if = "Option::is_none")] pub contains: Option, #[serde(skip_serializing_if = "Option::is_none")] pub offset: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub sort: Option, // this will be fill from sort_vec automatically. #[serde(skip_serializing)] pub sort_vec: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub format: Option, } #[derive(Debug, Default, Serialize)] pub struct PatchNetwork { pub data: PatchNetworkData, } #[derive(Debug, Default, Serialize)] pub struct PatchNetworkData { #[serde(rename = "hostUri", skip_serializing_if = "Option::is_none")] pub host_uri: Option, #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub info: Option>, }