use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TerminalInfo {
#[serde(rename = "version")]
pub firmware_version: String,
#[serde(rename = "type")]
pub hardware_type: HardwareType,
pub connected: bool,
pub client_id: u32,
#[serde(rename = "wifi")]
pub current_ssid: String,
pub server: String,
pub mac_address: String,
pub shockers: Vec<ShockerInfo>,
pub networks: Vec<NetworkInfo>,
pub otk: String,
pub claimed: bool,
pub is_dev: bool,
pub publisher: bool,
pub polled: bool,
pub subscriber: bool,
pub public_ip: String,
#[serde(rename = "internet")]
pub internet_access: bool,
pub owner_id: u32,
}
#[repr(transparent)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct HardwareType(pub u8);
impl HardwareType {
pub const NEXT: HardwareType = HardwareType(3);
pub const LITE: HardwareType = HardwareType(4);
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ShockerInfo {
#[serde(rename = "id")]
pub shocker_id: u32,
#[serde(rename = "type")]
pub model: ShockerModel,
pub paused: bool,
}
#[repr(transparent)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct ShockerModel(pub u8);
impl ShockerModel {
pub const PETRAINER: ShockerModel = ShockerModel(0);
pub const SMALL_ONE: ShockerModel = ShockerModel(1);
}
#[derive(Debug, Serialize, Deserialize)]
pub struct NetworkInfo {
pub ssid: String,
pub password: String,
}