ruma_client_api/tag/
create_tag.rs1pub mod v3 {
6 use ruma_common::{
11 OwnedRoomId, OwnedUserId,
12 api::{auth_scheme::AccessToken, request, response},
13 metadata,
14 };
15 use ruma_events::tag::TagInfo;
16
17 metadata! {
18 method: PUT,
19 rate_limited: false,
20 authentication: AccessToken,
21 history: {
22 1.0 => "/_matrix/client/r0/user/{user_id}/rooms/{room_id}/tags/{tag}",
23 1.1 => "/_matrix/client/v3/user/{user_id}/rooms/{room_id}/tags/{tag}",
24 }
25 }
26
27 #[request(error = crate::Error)]
29 pub struct Request {
30 #[ruma_api(path)]
32 pub user_id: OwnedUserId,
33
34 #[ruma_api(path)]
36 pub room_id: OwnedRoomId,
37
38 #[ruma_api(path)]
40 pub tag: String,
41
42 #[ruma_api(body)]
44 pub tag_info: TagInfo,
45 }
46
47 #[response(error = crate::Error)]
49 #[derive(Default)]
50 pub struct Response {}
51
52 impl Request {
53 pub fn new(
55 user_id: OwnedUserId,
56 room_id: OwnedRoomId,
57 tag: String,
58 tag_info: TagInfo,
59 ) -> Self {
60 Self { user_id, room_id, tag, tag_info }
61 }
62 }
63
64 impl Response {
65 pub fn new() -> Self {
67 Self {}
68 }
69 }
70}