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