ruma_client_api/device/
get_device.rs1pub mod v3 {
6 use ruma_common::{
11 api::{request, response, Metadata},
12 metadata, OwnedDeviceId,
13 };
14
15 use crate::device::Device;
16
17 const METADATA: Metadata = metadata! {
18 method: GET,
19 rate_limited: false,
20 authentication: AccessToken,
21 history: {
22 1.0 => "/_matrix/client/r0/devices/:device_id",
23 1.1 => "/_matrix/client/v3/devices/:device_id",
24 }
25 };
26
27 #[request(error = crate::Error)]
29 pub struct Request {
30 #[ruma_api(path)]
32 pub device_id: OwnedDeviceId,
33 }
34
35 #[response(error = crate::Error)]
37 pub struct Response {
38 #[ruma_api(body)]
40 pub device: Device,
41 }
42
43 impl Request {
44 pub fn new(device_id: OwnedDeviceId) -> Self {
46 Self { device_id }
47 }
48 }
49
50 impl Response {
51 pub fn new(device: Device) -> Self {
53 Self { device }
54 }
55 }
56}