use ruma_api::ruma_api;
use ruma_identifiers::DeviceId;
use super::Device;
ruma_api! {
metadata: {
description: "Get a device for authenticated user.",
method: GET,
name: "get_device",
path: "/_matrix/client/r0/devices/:device_id",
rate_limited: false,
authentication: AccessToken,
}
request: {
#[ruma_api(path)]
pub device_id: &'a DeviceId,
}
response: {
#[ruma_api(body)]
pub device: Device,
}
error: crate::Error
}
impl<'a> Request<'a> {
pub fn new(device_id: &'a DeviceId) -> Self {
Self { device_id }
}
}
impl Response {
pub fn new(device: Device) -> Self {
Self { device }
}
}