use ruma_common::{MilliSecondsSinceUnixEpoch, OwnedDeviceId};
use serde::{Deserialize, Serialize};
pub mod delete_device;
pub mod delete_devices;
pub mod get_device;
pub mod get_devices;
pub mod update_device;
#[derive(Clone, Debug, Deserialize, Hash, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Device {
pub device_id: OwnedDeviceId,
pub display_name: Option<String>,
pub last_seen_ip: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_seen_ts: Option<MilliSecondsSinceUnixEpoch>,
}
impl Device {
pub fn new(device_id: OwnedDeviceId) -> Self {
Self { device_id, display_name: None, last_seen_ip: None, last_seen_ts: None }
}
}