git-subtree-dir: ruma-client-api git-subtree-mainline: e5233c49f610f866e3c9bf8529a0613171fc2fe4 git-subtree-split: 632eb9d520028816c5fb7224bd0aca8d1e3793f1
34 lines
844 B
Rust
34 lines
844 B
Rust
//! Endpoints for managing devices.
|
|
|
|
use std::time::SystemTime;
|
|
|
|
use ruma_identifiers::DeviceId;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub mod delete_device;
|
|
pub mod delete_devices;
|
|
pub mod get_device;
|
|
pub mod get_devices;
|
|
pub mod update_device;
|
|
|
|
/// Information about a registered device.
|
|
#[derive(Clone, Debug, Deserialize, Hash, PartialEq, Serialize)]
|
|
pub struct Device {
|
|
/// Device ID
|
|
pub device_id: DeviceId,
|
|
|
|
/// Public display name of the device.
|
|
pub display_name: Option<String>,
|
|
|
|
/// Most recently seen IP address of the session.
|
|
pub last_seen_ip: Option<String>,
|
|
|
|
/// Unix timestamp that the session was last active.
|
|
#[serde(
|
|
with = "ruma_serde::time::opt_ms_since_unix_epoch",
|
|
default,
|
|
skip_serializing_if = "Option::is_none"
|
|
)]
|
|
pub last_seen_ts: Option<SystemTime>,
|
|
}
|