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" | readme = "README.md" | ||||||
| repository = "https://github.com/ruma/ruma-client-api" | repository = "https://github.com/ruma/ruma-client-api" | ||||||
| version = "0.2.0" | version = "0.2.0" | ||||||
|  | edition = "2018" | ||||||
| 
 | 
 | ||||||
| [dependencies] | [dependencies] | ||||||
| futures = "0.1.25" | futures = "0.1.25" | ||||||
|  | |||||||
							
								
								
									
										21
									
								
								src/lib.rs
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								src/lib.rs
									
									
									
									
									
								
							| @ -5,19 +5,14 @@ | |||||||
| #![deny(missing_debug_implementations, missing_docs)] | #![deny(missing_debug_implementations, missing_docs)] | ||||||
| #![feature(try_from)] | #![feature(try_from)] | ||||||
| 
 | 
 | ||||||
| extern crate futures; | use futures; | ||||||
| extern crate http; | use http; | ||||||
| extern crate hyper; | use hyper; | ||||||
| extern crate ruma_api; | use ruma_api; | ||||||
| extern crate ruma_api_macros; | use serde; | ||||||
| extern crate ruma_events; | use serde_json; | ||||||
| extern crate ruma_identifiers; | use serde_urlencoded; | ||||||
| extern crate ruma_signatures; | use url; | ||||||
| extern crate serde; |  | ||||||
| extern crate serde_json; |  | ||||||
| #[macro_use] extern crate serde_derive; |  | ||||||
| extern crate serde_urlencoded; |  | ||||||
| extern crate url; |  | ||||||
| 
 | 
 | ||||||
| /// Endpoints for the r0.x.x versions of the client API specification.
 | /// Endpoints for the r0.x.x versions of the client API specification.
 | ||||||
| pub mod r0 { | pub mod r0 { | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ | |||||||
| pub mod register { | pub mod register { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -81,7 +82,7 @@ pub mod register { | |||||||
|         #[serde(rename = "type")] |         #[serde(rename = "type")] | ||||||
|         kind: String, |         kind: String, | ||||||
|         /// The value of the session key given by the homeserver.
 |         /// The value of the session key given by the homeserver.
 | ||||||
|         session: Option<String> |         session: Option<String>, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /// The kind of account being registered.
 |     /// The kind of account being registered.
 | ||||||
| @ -90,10 +91,10 @@ pub mod register { | |||||||
|         /// A guest account
 |         /// A guest account
 | ||||||
|         ///
 |         ///
 | ||||||
|         /// These accounts may have limited permissions and may not be supported by all servers.
 |         /// These accounts may have limited permissions and may not be supported by all servers.
 | ||||||
|         #[serde(rename="guest")] |         #[serde(rename = "guest")] | ||||||
|         Guest, |         Guest, | ||||||
|         /// A regular user account
 |         /// A regular user account
 | ||||||
|         #[serde(rename="user")] |         #[serde(rename = "user")] | ||||||
|         User, |         User, | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -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)
 | /// [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 { | pub mod request_password_change_token { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod change_password { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod request_register_token { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ | |||||||
| pub mod create_alias { | pub mod create_alias { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomAliasId, RoomId}; |     use ruma_identifiers::{RoomAliasId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -31,6 +32,7 @@ pub mod create_alias { | |||||||
| pub mod delete_alias { | pub mod delete_alias { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::RoomAliasId; |     use ruma_identifiers::RoomAliasId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -56,6 +58,7 @@ pub mod delete_alias { | |||||||
| pub mod get_alias { | pub mod get_alias { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomAliasId, RoomId}; |     use ruma_identifiers::{RoomAliasId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ | |||||||
| pub mod set_room_account_data { | pub mod set_room_account_data { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, UserId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
|     use serde_json::Value; |     use serde_json::Value; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
| @ -40,9 +41,10 @@ pub mod set_room_account_data { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /// [PUT /_matrix/client/r0/user/{userId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-user-userid-account-data-type)
 | /// [PUT /_matrix/client/r0/user/{userId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-user-userid-account-data-type)
 | ||||||
| pub mod set_global_account_data  { | pub mod set_global_account_data { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
|     use serde_json::Value; |     use serde_json::Value; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     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)
 | /// [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 { | pub mod create_contact { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod get_contacts { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -67,7 +69,7 @@ pub mod get_contacts { | |||||||
|     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] |     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] | ||||||
|     pub enum Medium { |     pub enum Medium { | ||||||
|         /// An email address.
 |         /// An email address.
 | ||||||
|         #[serde(rename="email")] |         #[serde(rename = "email")] | ||||||
|         Email, |         Email, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -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)
 | /// [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 { | pub mod request_contact_verification_token { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod get_context { | ||||||
|     use ruma_identifiers::{EventId, RoomId}; |  | ||||||
|     use ruma_events::collections::only; |  | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use ruma_events::collections::only; | ||||||
|  |     use ruma_identifiers::{EventId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod get_public_rooms { | ||||||
|     use ruma_identifiers::{RoomId, RoomAliasId}; |  | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use ruma_identifiers::{RoomAliasId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| //! Endpoints for event filters.
 | //! Endpoints for event filters.
 | ||||||
| 
 | 
 | ||||||
| use ruma_identifiers::{RoomId, UserId}; | use ruma_identifiers::{RoomId, UserId}; | ||||||
|  | use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
| /// Format to use for returned events
 | /// Format to use for returned events
 | ||||||
| #[derive(Copy, Clone, Debug, Deserialize, Serialize)] | #[derive(Copy, Clone, Debug, Deserialize, Serialize)] | ||||||
| @ -169,6 +170,7 @@ pub struct FilterDefinition { | |||||||
| pub mod create_filter { | pub mod create_filter { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     use super::FilterDefinition; |     use super::FilterDefinition; | ||||||
| 
 | 
 | ||||||
| @ -204,6 +206,7 @@ pub mod create_filter { | |||||||
| pub mod get_filter { | pub mod get_filter { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     use super::FilterDefinition; |     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)
 | /// [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 { | pub mod get_content { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod create_content { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod get_content_thumbnail { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     /// The desired resizing method.
 |     /// The desired resizing method.
 | ||||||
|     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] |     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| //! Endpoints for room membership.
 | //! Endpoints for room membership.
 | ||||||
| 
 | 
 | ||||||
| use ruma_signatures::Signatures; | use ruma_signatures::Signatures; | ||||||
|  | use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
| // TODO: spec requires a nesting ThirdPartySigned { signed: Signed { mxid: ..., ... } }
 | // TODO: spec requires a nesting ThirdPartySigned { signed: Signed { mxid: ..., ... } }
 | ||||||
| //       for join_room_by_id_or_alias but not for join_room_by_id, inconsistency?
 | //       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)
 | /// [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 { | pub mod invite_user { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{UserId, RoomId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -50,6 +52,7 @@ pub mod invite_user { | |||||||
| pub mod join_room_by_id_or_alias { | pub mod join_room_by_id_or_alias { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, RoomIdOrAliasId}; |     use ruma_identifiers::{RoomId, RoomIdOrAliasId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     use super::ThirdPartySigned; |     use super::ThirdPartySigned; | ||||||
| 
 | 
 | ||||||
| @ -84,6 +87,7 @@ pub mod join_room_by_id_or_alias { | |||||||
| pub mod join_room_by_id { | pub mod join_room_by_id { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     use super::ThirdPartySigned; |     use super::ThirdPartySigned; | ||||||
| 
 | 
 | ||||||
| @ -118,6 +122,7 @@ pub mod join_room_by_id { | |||||||
| pub mod forget_room { | pub mod forget_room { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -143,6 +148,7 @@ pub mod forget_room { | |||||||
| pub mod leave_room { | pub mod leave_room { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -168,6 +174,7 @@ pub mod leave_room { | |||||||
| pub mod kick_user { | pub mod kick_user { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, UserId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -198,6 +205,7 @@ pub mod kick_user { | |||||||
| pub mod unban_user { | pub mod unban_user { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, UserId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -225,6 +233,7 @@ pub mod unban_user { | |||||||
| pub mod ban_user { | pub mod ban_user { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, UserId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod set_presence { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |  | ||||||
|     use ruma_events::presence::PresenceState; |     use ruma_events::presence::PresenceState; | ||||||
|  |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -36,6 +37,7 @@ pub mod get_presence { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::presence::PresenceState; |     use ruma_events::presence::PresenceState; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -73,6 +75,7 @@ pub mod get_presence { | |||||||
| pub mod update_presence_subscriptions { | pub mod update_presence_subscriptions { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -107,6 +110,7 @@ pub mod get_subscribed_presences { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::presence::PresenceEvent; |     use ruma_events::presence::PresenceEvent; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ | |||||||
| pub mod get_display_name { | pub mod get_display_name { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -33,6 +34,7 @@ pub mod get_display_name { | |||||||
| pub mod set_display_name { | pub mod set_display_name { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -61,6 +63,7 @@ pub mod set_display_name { | |||||||
| pub mod get_avatar_url { | pub mod get_avatar_url { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -90,6 +93,7 @@ pub mod get_avatar_url { | |||||||
| pub mod set_avatar_url { | pub mod set_avatar_url { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -117,6 +121,7 @@ pub mod set_avatar_url { | |||||||
| pub mod get_profile { | pub mod get_profile { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -6,6 +6,7 @@ pub mod create_receipt { | |||||||
| 
 | 
 | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{EventId, RoomId}; |     use ruma_identifiers::{EventId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -41,7 +42,7 @@ pub mod create_receipt { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     impl Display for ReceiptType { |     impl Display for ReceiptType { | ||||||
|         fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { |         fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { | ||||||
|             match *self { |             match *self { | ||||||
|                 ReceiptType::Read => write!(f, "m.read"), |                 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)
 | /// [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 { | pub mod redact_event { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, EventId}; |     use ruma_identifiers::{EventId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod create_room { | ||||||
|     use ruma_identifiers::{RoomId, UserId}; |  | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -59,7 +60,7 @@ pub mod create_room { | |||||||
|         /// Whether users on other servers can join this room.
 |         /// Whether users on other servers can join this room.
 | ||||||
|         ///
 |         ///
 | ||||||
|         /// Defaults to `true` if key does not exist.
 |         /// Defaults to `true` if key does not exist.
 | ||||||
|         #[serde(rename="m.federate")] |         #[serde(rename = "m.federate")] | ||||||
|         #[serde(skip_serializing_if = "Option::is_none")] |         #[serde(skip_serializing_if = "Option::is_none")] | ||||||
|         pub federate: Option<bool>, |         pub federate: Option<bool>, | ||||||
|     } |     } | ||||||
| @ -68,13 +69,13 @@ pub mod create_room { | |||||||
|     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] |     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] | ||||||
|     pub enum RoomPreset { |     pub enum RoomPreset { | ||||||
|         /// `join_rules` is set to `invite` and `history_visibility` is set to `shared`.
 |         /// `join_rules` is set to `invite` and `history_visibility` is set to `shared`.
 | ||||||
|         #[serde(rename="private_chat")] |         #[serde(rename = "private_chat")] | ||||||
|         PrivateChat, |         PrivateChat, | ||||||
|         /// `join_rules` is set to `public` and `history_visibility` is set to `shared`.
 |         /// `join_rules` is set to `public` and `history_visibility` is set to `shared`.
 | ||||||
|         #[serde(rename="public_chat")] |         #[serde(rename = "public_chat")] | ||||||
|         PublicChat, |         PublicChat, | ||||||
|         /// Same as `PrivateChat`, but all initial invitees get the same power level as the creator.
 |         /// Same as `PrivateChat`, but all initial invitees get the same power level as the creator.
 | ||||||
|         #[serde(rename="trusted_private_chat")] |         #[serde(rename = "trusted_private_chat")] | ||||||
|         TrustedPrivateChat, |         TrustedPrivateChat, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,8 +7,9 @@ pub mod search_events { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::collections::all::Event; |     use ruma_events::collections::all::Event; | ||||||
|     use ruma_identifiers::{EventId, RoomId, UserId}; |     use ruma_identifiers::{EventId, RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     use r0::filter::RoomEventFilter; |     use crate::r0::filter::RoomEventFilter; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -41,7 +42,7 @@ pub mod search_events { | |||||||
|     pub struct Categories { |     pub struct Categories { | ||||||
|         /// Criteria for searching a category of events.
 |         /// Criteria for searching a category of events.
 | ||||||
|         #[serde(skip_serializing_if = "Option::is_none")] |         #[serde(skip_serializing_if = "Option::is_none")] | ||||||
|         pub room_events: Option<Criteria> |         pub room_events: Option<Criteria>, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /// Criteria for searching a category of events.
 |     /// Criteria for searching a category of events.
 | ||||||
| @ -107,17 +108,17 @@ pub mod search_events { | |||||||
|     #[derive(Clone, Debug, Deserialize, Serialize)] |     #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
|     pub struct Grouping { |     pub struct Grouping { | ||||||
|         /// The key within events to use for this 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.
 |     /// The key within events to use for this grouping.
 | ||||||
|     #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] |     #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] | ||||||
|     pub enum GroupingKey { |     pub enum GroupingKey { | ||||||
|         /// `room_id`
 |         /// `room_id`
 | ||||||
|         #[serde(rename="room_id")] |         #[serde(rename = "room_id")] | ||||||
|         RoomId, |         RoomId, | ||||||
|         /// `sender`
 |         /// `sender`
 | ||||||
|         #[serde(rename="sender")] |         #[serde(rename = "sender")] | ||||||
|         Sender, |         Sender, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -132,13 +133,13 @@ pub mod search_events { | |||||||
|     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] |     #[derive(Clone, Copy, Debug, Deserialize, Serialize)] | ||||||
|     pub enum SearchKeys { |     pub enum SearchKeys { | ||||||
|         /// content.body
 |         /// content.body
 | ||||||
|         #[serde(rename="content.body")] |         #[serde(rename = "content.body")] | ||||||
|         ContentBody, |         ContentBody, | ||||||
|         /// content.name
 |         /// content.name
 | ||||||
|         #[serde(rename="content.name")] |         #[serde(rename = "content.name")] | ||||||
|         ContentName, |         ContentName, | ||||||
|         /// content.topic
 |         /// content.topic
 | ||||||
|         #[serde(rename="content.topic")] |         #[serde(rename = "content.topic")] | ||||||
|         ContentTopic, |         ContentTopic, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -147,10 +148,10 @@ pub mod search_events { | |||||||
|     pub enum OrderBy { |     pub enum OrderBy { | ||||||
|         /// Prioritize events by a numerical ranking of how closely they matched the search
 |         /// Prioritize events by a numerical ranking of how closely they matched the search
 | ||||||
|         /// criteria.
 |         /// criteria.
 | ||||||
|         #[serde(rename="rank")] |         #[serde(rename = "rank")] | ||||||
|         Rank, |         Rank, | ||||||
|         /// Prioritize recent events.
 |         /// Prioritize recent events.
 | ||||||
|         #[serde(rename="recent")] |         #[serde(rename = "recent")] | ||||||
|         Recent, |         Recent, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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)
 | /// [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 { | pub mod send_state_event_for_empty_key { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, EventId}; |  | ||||||
|     use ruma_events::EventType; |     use ruma_events::EventType; | ||||||
|  |     use ruma_identifiers::{EventId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
|     use serde_json::Value; |     use serde_json::Value; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     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)
 | /// [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 { | pub mod send_state_event_for_key { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, EventId}; |  | ||||||
|     use ruma_events::EventType; |     use ruma_events::EventType; | ||||||
|  |     use ruma_identifiers::{EventId, RoomId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
|     use serde_json::Value; |     use serde_json::Value; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     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)
 | /// [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 { | pub mod send_message_event { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{RoomId, EventId}; |     use ruma_events::{room::message::MessageEventContent, EventType}; | ||||||
|     use ruma_events::EventType; |     use ruma_identifiers::{EventId, RoomId}; | ||||||
|     use ruma_events::room::message::MessageEventContent; |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -6,6 +6,7 @@ pub mod get_user_info { | |||||||
| 
 | 
 | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ | |||||||
| pub mod login { | pub mod login { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::UserId; |     use ruma_identifiers::UserId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -5,6 +5,7 @@ pub mod get_state_events { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::collections::only; |     use ruma_events::collections::only; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -37,6 +38,7 @@ pub mod get_state_events_for_empty_key { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::EventType; |     use ruma_events::EventType; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -70,6 +72,7 @@ pub mod get_state_events_for_key { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::EventType; |     use ruma_events::EventType; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -106,6 +109,7 @@ pub mod get_member_events { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::room::member::MemberEvent; |     use ruma_events::room::member::MemberEvent; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -135,6 +139,7 @@ pub mod get_message_events { | |||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::collections::only; |     use ruma_events::collections::only; | ||||||
|     use ruma_identifiers::RoomId; |     use ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -186,10 +191,10 @@ pub mod get_message_events { | |||||||
|     #[derive(Clone, Debug, Deserialize, Serialize)] |     #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
|     pub enum Direction { |     pub enum Direction { | ||||||
|         /// Return events backwards in time from the requested `from` token.
 |         /// Return events backwards in time from the requested `from` token.
 | ||||||
|         #[serde(rename="b")] |         #[serde(rename = "b")] | ||||||
|         Backward, |         Backward, | ||||||
|         /// Return events forwards in time from the requested `from` token.
 |         /// Return events forwards in time from the requested `from` token.
 | ||||||
|         #[serde(rename="f")] |         #[serde(rename = "f")] | ||||||
|         Forward, |         Forward, | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -199,10 +204,14 @@ pub mod sync_events { | |||||||
|     use std::collections::HashMap; |     use std::collections::HashMap; | ||||||
| 
 | 
 | ||||||
|     use ruma_api_macros::ruma_api; |     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 ruma_identifiers::RoomId; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     use r0::filter::FilterDefinition; |     use crate::r0::filter::FilterDefinition; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -252,7 +261,7 @@ pub mod sync_events { | |||||||
|     #[derive(Clone, Debug, Deserialize, Serialize)] |     #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
|     pub enum SetPresence { |     pub enum SetPresence { | ||||||
|         /// Do not set the presence of the user calling this API.
 |         /// Do not set the presence of the user calling this API.
 | ||||||
|         #[serde(rename="offline")] |         #[serde(rename = "offline")] | ||||||
|         Offline, |         Offline, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -4,7 +4,8 @@ | |||||||
| pub mod create_tag { | pub mod create_tag { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::tag::TagInfo; |     use ruma_events::tag::TagInfo; | ||||||
|     use ruma_identifiers::{UserId, RoomId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
| @ -39,7 +40,8 @@ pub mod create_tag { | |||||||
| pub mod get_tags { | pub mod get_tags { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_events::tag::TagEventContent; |     use ruma_events::tag::TagEventContent; | ||||||
|     use ruma_identifiers::{UserId, RoomId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod delete_tag { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{UserId, RoomId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod create_typing_event { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|     use ruma_identifiers::{UserId, RoomId}; |     use ruma_identifiers::{RoomId, UserId}; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         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)
 | /// [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 { | pub mod get_turn_server_info { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ | |||||||
| /// [GET /_matrix/client/versions](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions)
 | /// [GET /_matrix/client/versions](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions)
 | ||||||
| pub mod get_supported_versions { | pub mod get_supported_versions { | ||||||
|     use ruma_api_macros::ruma_api; |     use ruma_api_macros::ruma_api; | ||||||
|  |     use serde_derive::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
|     ruma_api! { |     ruma_api! { | ||||||
|         metadata { |         metadata { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user