commit
c78faf0bf3
1
.rustfmt.toml
Normal file
1
.rustfmt.toml
Normal file
@ -0,0 +1 @@
|
||||
merge_imports = true
|
@ -9,6 +9,7 @@ name = "ruma-client-api"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/ruma/ruma-client-api"
|
||||
version = "0.2.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures = "0.1.25"
|
||||
|
21
src/lib.rs
21
src/lib.rs
@ -5,19 +5,14 @@
|
||||
#![deny(missing_debug_implementations, missing_docs)]
|
||||
#![feature(try_from)]
|
||||
|
||||
extern crate futures;
|
||||
extern crate http;
|
||||
extern crate hyper;
|
||||
extern crate ruma_api;
|
||||
extern crate ruma_api_macros;
|
||||
extern crate ruma_events;
|
||||
extern crate ruma_identifiers;
|
||||
extern crate ruma_signatures;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
#[macro_use] extern crate serde_derive;
|
||||
extern crate serde_urlencoded;
|
||||
extern crate url;
|
||||
use futures;
|
||||
use http;
|
||||
use hyper;
|
||||
use ruma_api;
|
||||
use serde;
|
||||
use serde_json;
|
||||
use serde_urlencoded;
|
||||
use url;
|
||||
|
||||
/// Endpoints for the r0.x.x versions of the client API specification.
|
||||
pub mod r0 {
|
||||
|
@ -4,6 +4,7 @@
|
||||
pub mod register {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -81,7 +82,7 @@ pub mod register {
|
||||
#[serde(rename = "type")]
|
||||
kind: String,
|
||||
/// The value of the session key given by the homeserver.
|
||||
session: Option<String>
|
||||
session: Option<String>,
|
||||
}
|
||||
|
||||
/// The kind of account being registered.
|
||||
@ -101,6 +102,7 @@ pub mod register {
|
||||
/// [POST /_matrix/client/r0/account/password/email/requestToken](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-account-password-email-requesttoken)
|
||||
pub mod request_password_change_token {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -153,6 +155,7 @@ pub mod deactivate {
|
||||
/// [POST /_matrix/client/r0/account/password](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-account-password)
|
||||
pub mod change_password {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -177,6 +180,7 @@ pub mod change_password {
|
||||
/// [POST /_matrix/client/r0/register/email/requestToken](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register-email-requesttoken)
|
||||
pub mod request_register_token {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -4,6 +4,7 @@
|
||||
pub mod create_alias {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomAliasId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -31,6 +32,7 @@ pub mod create_alias {
|
||||
pub mod delete_alias {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::RoomAliasId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -56,6 +58,7 @@ pub mod delete_alias {
|
||||
pub mod get_alias {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomAliasId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -4,6 +4,7 @@
|
||||
pub mod set_room_account_data {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
ruma_api! {
|
||||
@ -43,6 +44,7 @@ pub mod set_room_account_data {
|
||||
pub mod set_global_account_data {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
ruma_api! {
|
||||
|
@ -3,6 +3,7 @@
|
||||
/// [POST /_matrix/client/r0/account/3pid](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-account-3pid)
|
||||
pub mod create_contact {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -43,6 +44,7 @@ pub mod create_contact {
|
||||
/// [GET /_matrix/client/r0/account/3pid](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-account-3pid)
|
||||
pub mod get_contacts {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -84,6 +86,7 @@ pub mod get_contacts {
|
||||
/// [POST /_matrix/client/r0/account/3pid/email/requestToken](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-account-3pid-email-requesttoken)
|
||||
pub mod request_contact_verification_token {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -2,9 +2,10 @@
|
||||
|
||||
/// [GET /_matrix/client/r0/rooms/{roomId}/context/{eventId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-context-eventid)
|
||||
pub mod get_context {
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use ruma_events::collections::only;
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::collections::only;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
/// [GET /_matrix/client/r0/publicRooms](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-publicrooms)
|
||||
pub mod get_public_rooms {
|
||||
use ruma_identifiers::{RoomId, RoomAliasId};
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomAliasId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! Endpoints for event filters.
|
||||
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
/// Format to use for returned events
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
|
||||
@ -169,6 +170,7 @@ pub struct FilterDefinition {
|
||||
pub mod create_filter {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use super::FilterDefinition;
|
||||
|
||||
@ -204,6 +206,7 @@ pub mod create_filter {
|
||||
pub mod get_filter {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use super::FilterDefinition;
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
/// [GET /_matrix/media/r0/download/{serverName}/{mediaId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-media-r0-download-servername-mediaid)
|
||||
pub mod get_content {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -40,6 +41,7 @@ pub mod get_content {
|
||||
/// [POST /_matrix/media/r0/upload](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-media-r0-upload)
|
||||
pub mod create_content {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -67,6 +69,7 @@ pub mod create_content {
|
||||
/// [GET /_matrix/media/r0/thumbnail/{serverName}/{mediaId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-media-r0-thumbnail-servername-mediaid)
|
||||
pub mod get_content_thumbnail {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
/// The desired resizing method.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! Endpoints for room membership.
|
||||
|
||||
use ruma_signatures::Signatures;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
// TODO: spec requires a nesting ThirdPartySigned { signed: Signed { mxid: ..., ... } }
|
||||
// for join_room_by_id_or_alias but not for join_room_by_id, inconsistency?
|
||||
@ -22,7 +23,8 @@ pub struct ThirdPartySigned {
|
||||
/// [POST /_matrix/client/r0/rooms/{roomId}/invite](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite)
|
||||
pub mod invite_user {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{UserId, RoomId};
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -50,6 +52,7 @@ pub mod invite_user {
|
||||
pub mod join_room_by_id_or_alias {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, RoomIdOrAliasId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use super::ThirdPartySigned;
|
||||
|
||||
@ -84,6 +87,7 @@ pub mod join_room_by_id_or_alias {
|
||||
pub mod join_room_by_id {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use super::ThirdPartySigned;
|
||||
|
||||
@ -118,6 +122,7 @@ pub mod join_room_by_id {
|
||||
pub mod forget_room {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -143,6 +148,7 @@ pub mod forget_room {
|
||||
pub mod leave_room {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -168,6 +174,7 @@ pub mod leave_room {
|
||||
pub mod kick_user {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -198,6 +205,7 @@ pub mod kick_user {
|
||||
pub mod unban_user {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -225,6 +233,7 @@ pub mod unban_user {
|
||||
pub mod ban_user {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -3,8 +3,9 @@
|
||||
/// [PUT /_matrix/client/r0/presence/{userId}/status](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-presence-userid-status)
|
||||
pub mod set_presence {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use ruma_events::presence::PresenceState;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -36,6 +37,7 @@ pub mod get_presence {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::presence::PresenceState;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -73,6 +75,7 @@ pub mod get_presence {
|
||||
pub mod update_presence_subscriptions {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -107,6 +110,7 @@ pub mod get_subscribed_presences {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::presence::PresenceEvent;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -4,6 +4,7 @@
|
||||
pub mod get_display_name {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -33,6 +34,7 @@ pub mod get_display_name {
|
||||
pub mod set_display_name {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -61,6 +63,7 @@ pub mod set_display_name {
|
||||
pub mod get_avatar_url {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -90,6 +93,7 @@ pub mod get_avatar_url {
|
||||
pub mod set_avatar_url {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -117,6 +121,7 @@ pub mod set_avatar_url {
|
||||
pub mod get_profile {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -6,6 +6,7 @@ pub mod create_receipt {
|
||||
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -41,7 +42,7 @@ pub mod create_receipt {
|
||||
}
|
||||
|
||||
impl Display for ReceiptType {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
|
||||
match *self {
|
||||
ReceiptType::Read => write!(f, "m.read"),
|
||||
}
|
||||
|
@ -3,7 +3,8 @@
|
||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid)
|
||||
pub mod redact_event {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, EventId};
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
/// [POST /_matrix/client/r0/createRoom](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom)
|
||||
pub mod create_room {
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -7,8 +7,9 @@ pub mod search_events {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::collections::all::Event;
|
||||
use ruma_identifiers::{EventId, RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use r0::filter::RoomEventFilter;
|
||||
use crate::r0::filter::RoomEventFilter;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -41,7 +42,7 @@ pub mod search_events {
|
||||
pub struct Categories {
|
||||
/// Criteria for searching a category of events.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub room_events: Option<Criteria>
|
||||
pub room_events: Option<Criteria>,
|
||||
}
|
||||
|
||||
/// Criteria for searching a category of events.
|
||||
@ -107,7 +108,7 @@ pub mod search_events {
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Grouping {
|
||||
/// The key within events to use for this grouping.
|
||||
pub key: GroupingKey
|
||||
pub key: GroupingKey,
|
||||
}
|
||||
|
||||
/// The key within events to use for this grouping.
|
||||
|
@ -3,8 +3,9 @@
|
||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype)
|
||||
pub mod send_state_event_for_empty_key {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, EventId};
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
ruma_api! {
|
||||
@ -39,8 +40,9 @@ pub mod send_state_event_for_empty_key {
|
||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey)
|
||||
pub mod send_state_event_for_key {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, EventId};
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
ruma_api! {
|
||||
@ -78,9 +80,9 @@ pub mod send_state_event_for_key {
|
||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid)
|
||||
pub mod send_message_event {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{RoomId, EventId};
|
||||
use ruma_events::EventType;
|
||||
use ruma_events::room::message::MessageEventContent;
|
||||
use ruma_events::{room::message::MessageEventContent, EventType};
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -6,6 +6,7 @@ pub mod get_user_info {
|
||||
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -4,6 +4,7 @@
|
||||
pub mod login {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -5,6 +5,7 @@ pub mod get_state_events {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::collections::only;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -37,6 +38,7 @@ pub mod get_state_events_for_empty_key {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -70,6 +72,7 @@ pub mod get_state_events_for_key {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -106,6 +109,7 @@ pub mod get_member_events {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::room::member::MemberEvent;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -135,6 +139,7 @@ pub mod get_message_events {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::collections::only;
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -199,10 +204,14 @@ pub mod sync_events {
|
||||
use std::collections::HashMap;
|
||||
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::{collections::{all, only}, stripped};
|
||||
use ruma_events::{
|
||||
collections::{all, only},
|
||||
stripped,
|
||||
};
|
||||
use ruma_identifiers::RoomId;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use r0::filter::FilterDefinition;
|
||||
use crate::r0::filter::FilterDefinition;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -4,7 +4,8 @@
|
||||
pub mod create_tag {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::tag::TagInfo;
|
||||
use ruma_identifiers::{UserId, RoomId};
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -39,7 +40,8 @@ pub mod create_tag {
|
||||
pub mod get_tags {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_events::tag::TagEventContent;
|
||||
use ruma_identifiers::{UserId, RoomId};
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -70,7 +72,8 @@ pub mod get_tags {
|
||||
/// [DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag}](https://matrix.org/docs/spec/client_server/r0.2.0.html#delete-matrix-client-r0-user-userid-rooms-roomid-tags-tag)
|
||||
pub mod delete_tag {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{UserId, RoomId};
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -3,7 +3,8 @@
|
||||
/// [PUT /_matrix/client/r0/rooms/{roomId}/typing/{userId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid)
|
||||
pub mod create_typing_event {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use ruma_identifiers::{UserId, RoomId};
|
||||
use ruma_identifiers::{RoomId, UserId};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -3,6 +3,7 @@
|
||||
/// [GET /_matrix/client/r0/voip/turnServer](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-voip-turnserver)
|
||||
pub mod get_turn_server_info {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
@ -3,6 +3,7 @@
|
||||
/// [GET /_matrix/client/versions](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions)
|
||||
pub mod get_supported_versions {
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
|
Loading…
x
Reference in New Issue
Block a user