use crate::model::discovery::DeviceType;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Deserialize, Eq, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ClientInfo {
    /// The name of the peer.
    pub alias: String,

    /// Client Protocol Version (major.minor)
    pub version: String,

    /// The device model of the peer.
    /// Windows, macOS, iPhone, Samsung, etc.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub device_model: Option<String>,

    /// The device type of the peer.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub device_type: Option<DeviceType>,

    /// A token generated by the client.
    /// Used to merge the same peers detected on different channels (LAN, WebRTC, etc.).
    pub token: String,
}
