ruma_client_api/
membership.rs1pub mod ban_user;
4pub mod forget_room;
5pub mod get_member_events;
6pub mod invite_user;
7pub mod join_room_by_id;
8pub mod join_room_by_id_or_alias;
9pub mod joined_members;
10pub mod joined_rooms;
11pub mod kick_user;
12pub mod leave_room;
13#[cfg(feature = "unstable-msc2666")]
14pub mod mutual_rooms;
15pub mod unban_user;
16
17use ruma_common::{thirdparty::Medium, OwnedUserId, ServerSignatures};
18use serde::{Deserialize, Serialize};
19
20#[derive(Clone, Debug, Deserialize, Serialize)]
23#[cfg_attr(not(ruma_unstable_exhaustive_types), non_exhaustive)]
24pub struct ThirdPartySigned {
25 pub sender: OwnedUserId,
27
28 pub mxid: OwnedUserId,
30
31 pub token: String,
33
34 pub signatures: ServerSignatures,
36}
37
38impl ThirdPartySigned {
39 pub fn new(
42 sender: OwnedUserId,
43 mxid: OwnedUserId,
44 token: String,
45 signatures: ServerSignatures,
46 ) -> Self {
47 Self { sender, mxid, token, signatures }
48 }
49}
50
51#[derive(Clone, Debug, Deserialize, Serialize)]
56#[cfg_attr(not(ruma_unstable_exhaustive_types), non_exhaustive)]
57pub struct Invite3pid {
58 pub id_server: String,
60
61 pub id_access_token: String,
63
64 pub medium: Medium,
66
67 pub address: String,
69}
70
71#[derive(Debug)]
76#[allow(clippy::exhaustive_structs)]
77pub struct Invite3pidInit {
78 pub id_server: String,
80
81 pub id_access_token: String,
83
84 pub medium: Medium,
86
87 pub address: String,
89}
90
91impl From<Invite3pidInit> for Invite3pid {
92 fn from(init: Invite3pidInit) -> Self {
93 let Invite3pidInit { id_server, id_access_token, medium, address } = init;
94 Self { id_server, id_access_token, medium, address }
95 }
96}