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