ruma_client_api/device/
update_device.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedDeviceId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 metadata! {
17 method: PUT,
18 rate_limited: false,
19 authentication: AccessToken,
20 history: {
21 1.0 => "/_matrix/client/r0/devices/{device_id}",
22 1.1 => "/_matrix/client/v3/devices/{device_id}",
23 }
24 }
25
26 #[request(error = crate::Error)]
28 pub struct Request {
29 #[ruma_api(path)]
31 pub device_id: OwnedDeviceId,
32
33 #[serde(skip_serializing_if = "Option::is_none")]
37 pub display_name: Option<String>,
38 }
39
40 #[response(error = crate::Error)]
42 #[derive(Default)]
43 pub struct Response {}
44
45 impl Request {
46 pub fn new(device_id: OwnedDeviceId) -> Self {
48 Self { device_id, display_name: None }
49 }
50 }
51
52 impl Response {
53 pub fn new() -> Self {
55 Self {}
56 }
57 }
58}