pub mod ban_user;
pub mod forget_room;
pub mod get_member_events;
pub mod invite_user;
pub mod join_room_by_id;
pub mod join_room_by_id_or_alias;
pub mod joined_members;
pub mod joined_rooms;
pub mod kick_user;
pub mod leave_room;
#[cfg(feature = "unstable-msc2666")]
pub mod mutual_rooms;
pub mod unban_user;
use std::collections::BTreeMap;
use ruma_common::{
serde::Incoming, thirdparty::Medium, OwnedServerName, OwnedServerSigningKeyId, UserId,
};
use serde::Serialize;
#[derive(Clone, Debug, Incoming, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct ThirdPartySigned<'a> {
pub sender: &'a UserId,
pub mxid: &'a UserId,
pub token: &'a str,
pub signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
}
impl<'a> ThirdPartySigned<'a> {
pub fn new(
sender: &'a UserId,
mxid: &'a UserId,
token: &'a str,
signatures: BTreeMap<OwnedServerName, BTreeMap<OwnedServerSigningKeyId, String>>,
) -> Self {
Self { sender, mxid, token, signatures }
}
}
#[derive(Clone, Debug, Incoming, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Invite3pid<'a> {
pub id_server: &'a str,
pub id_access_token: &'a str,
pub medium: Medium,
pub address: &'a str,
}
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct Invite3pidInit<'a> {
pub id_server: &'a str,
pub id_access_token: &'a str,
pub medium: Medium,
pub address: &'a str,
}
impl<'a> From<Invite3pidInit<'a>> for Invite3pid<'a> {
fn from(init: Invite3pidInit<'a>) -> Self {
let Invite3pidInit { id_server, id_access_token, medium, address } = init;
Self { id_server, id_access_token, medium, address }
}
}