ruma_client_api/profile/
set_display_name.rs1pub mod v3 {
6    use ruma_common::{
11        api::{request, response, Metadata},
12        metadata, OwnedUserId,
13    };
14
15    const METADATA: Metadata = 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        pub fn new(user_id: OwnedUserId, displayname: Option<String>) -> Self {
45            Self { user_id, displayname }
46        }
47    }
48
49    impl Response {
50        pub fn new() -> Self {
52            Self {}
53        }
54    }
55}