ruma_client_api/profile/
set_display_name.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedUserId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15
16 metadata! {
17 method: PUT,
18 rate_limited: true,
19 authentication: AccessToken,
20 history: {
21 1.0 => "/_matrix/client/r0/profile/{user_id}/displayname",
22 1.1 => "/_matrix/client/v3/profile/{user_id}/displayname",
23 }
24 }
25
26 #[request(error = crate::Error)]
28 pub struct Request {
29 #[ruma_api(path)]
31 pub user_id: OwnedUserId,
32
33 #[serde(skip_serializing_if = "Option::is_none")]
35 pub displayname: Option<String>,
36 }
37
38 #[response(error = crate::Error)]
40 #[derive(Default)]
41 pub struct Response {}
42
43 impl Request {
44 #[deprecated = "Use the set_profile_field endpoint instead."]
46 pub fn new(user_id: OwnedUserId, displayname: Option<String>) -> Self {
47 Self { user_id, displayname }
48 }
49 }
50
51 impl Response {
52 pub fn new() -> Self {
54 Self {}
55 }
56 }
57}