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;
13pub mod mutual_rooms;
14pub mod unban_user;
15
16use ruma_common::{OwnedUserId, ServerSignatures, thirdparty::Medium};
17use serde::{Deserialize, Serialize};
18
19#[derive(Clone, Debug, Deserialize, Serialize)]
22#[cfg_attr(not(ruma_unstable_exhaustive_types), non_exhaustive)]
23pub struct ThirdPartySigned {
24 pub sender: OwnedUserId,
26
27 pub mxid: OwnedUserId,
29
30 pub token: String,
32
33 pub signatures: ServerSignatures,
35}
36
37impl ThirdPartySigned {
38 pub fn new(
41 sender: OwnedUserId,
42 mxid: OwnedUserId,
43 token: String,
44 signatures: ServerSignatures,
45 ) -> Self {
46 Self { sender, mxid, token, signatures }
47 }
48}
49
50#[derive(Clone, Debug, Deserialize, Serialize)]
55#[cfg_attr(not(ruma_unstable_exhaustive_types), non_exhaustive)]
56pub struct Invite3pid {
57 pub id_server: String,
59
60 pub id_access_token: String,
62
63 pub medium: Medium,
65
66 pub address: String,
68}
69
70#[derive(Debug)]
75#[allow(clippy::exhaustive_structs)]
76pub struct Invite3pidInit {
77 pub id_server: String,
79
80 pub id_access_token: String,
82
83 pub medium: Medium,
85
86 pub address: String,
88}
89
90impl From<Invite3pidInit> for Invite3pid {
91 fn from(init: Invite3pidInit) -> Self {
92 let Invite3pidInit { id_server, id_access_token, medium, address } = init;
93 Self { id_server, id_access_token, medium, address }
94 }
95}