use serde::Serialize; use serde_json::{Map, Value}; #[derive(Debug, Serialize)] pub struct PostUnit { pub data: PostUnitData, } #[derive(Debug, Serialize)] pub struct PostUnitData { pub code: String, #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")] pub owner_id: Option, #[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 GetUnitCount { #[serde(skip_serializing_if = "Option::is_none")] pub owner: Option, #[serde(skip_serializing_if = "Option::is_none")] pub member: Option, #[serde(skip_serializing_if = "Option::is_none")] pub contains: Option, } #[derive(Debug, Default, Serialize)] pub struct GetUnitList { #[serde(skip_serializing_if = "Option::is_none")] pub owner: Option, #[serde(skip_serializing_if = "Option::is_none")] pub member: 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 PatchUnit { pub data: PatchUnitData, } #[derive(Debug, Default, Serialize)] pub struct PatchUnitData { #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")] pub owner_id: Option, #[serde(rename = "memberIds", skip_serializing_if = "Option::is_none")] pub member_ids: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub info: Option>, }