diff --git a/ruma-api-macros/README.md b/ruma-api-macros/README.md index 88747d28..4449c152 100644 --- a/ruma-api-macros/README.md +++ b/ruma-api-macros/README.md @@ -14,7 +14,7 @@ pub mod some_endpoint { use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Does something.", method: GET, // An `http::Method` constant. No imports required. name: "some_endpoint", @@ -23,7 +23,7 @@ pub mod some_endpoint { requires_authentication: false, } - request { + request: { // With no attribute on the field, it will be put into the body of the request. pub foo: String, @@ -41,7 +41,7 @@ pub mod some_endpoint { pub baz: String, } - response { + response: { // This value will be extracted from the "Content-Type" HTTP header. #[ruma_api(header = CONTENT_TYPE)] pub content_type: String @@ -49,6 +49,9 @@ pub mod some_endpoint { // With no attribute on the field, it will be extracted from the body of the response. pub value: String, } + + // An error can also be specified or defaults to `ruma_api::error::Void`. + error: ruma_api::Error } } ``` diff --git a/ruma-api-macros/src/api.rs b/ruma-api-macros/src/api.rs index e4a3a381..cb1b2cff 100644 --- a/ruma-api-macros/src/api.rs +++ b/ruma-api-macros/src/api.rs @@ -564,6 +564,7 @@ pub struct RawMetadata { impl Parse for RawMetadata { fn parse(input: ParseStream<'_>) -> syn::Result { let metadata_kw = input.parse::()?; + input.parse::()?; let field_values; braced!(field_values in input); @@ -585,6 +586,7 @@ pub struct RawRequest { impl Parse for RawRequest { fn parse(input: ParseStream<'_>) -> syn::Result { let request_kw = input.parse::()?; + input.parse::()?; let fields; braced!(fields in input); @@ -606,6 +608,7 @@ pub struct RawResponse { impl Parse for RawResponse { fn parse(input: ParseStream<'_>) -> syn::Result { let response_kw = input.parse::()?; + input.parse::()?; let fields; braced!(fields in input); diff --git a/ruma-api/src/lib.rs b/ruma-api/src/lib.rs index 4239732c..f1d7d496 100644 --- a/ruma-api/src/lib.rs +++ b/ruma-api/src/lib.rs @@ -23,7 +23,7 @@ use http::Method; /// /// ```text /// ruma_api! { -/// metadata { +/// metadata: { /// description: &'static str, /// method: http::Method, /// name: &'static str, @@ -32,15 +32,18 @@ use http::Method; /// requires_authentication: bool, /// } /// -/// request { +/// request: { /// // Struct fields for each piece of data required /// // to make a request to this API endpoint. /// } /// -/// response { +/// response: { /// // Struct fields for each piece of data expected /// // in the response from this API endpoint. /// } +/// +/// // The error returned when a response fails, defaults to `Void`. +/// error: path::to::Error /// } /// ``` /// @@ -129,7 +132,7 @@ use http::Method; /// use ruma_api_macros::ruma_api; /// /// ruma_api! { -/// metadata { +/// metadata: { /// description: "Does something.", /// method: POST, /// name: "some_endpoint", @@ -138,7 +141,7 @@ use http::Method; /// requires_authentication: false, /// } /// -/// request { +/// request: { /// pub foo: String, /// /// #[ruma_api(header = CONTENT_TYPE)] @@ -151,7 +154,7 @@ use http::Method; /// pub baz: String, /// } /// -/// response { +/// response: { /// #[ruma_api(header = CONTENT_TYPE)] /// pub content_type: String, /// @@ -170,7 +173,7 @@ use http::Method; /// } /// /// ruma_api! { -/// metadata { +/// metadata: { /// description: "Does something.", /// method: PUT, /// name: "newtype_body_endpoint", @@ -179,12 +182,12 @@ use http::Method; /// requires_authentication: false, /// } /// -/// request { +/// request: { /// #[ruma_api(raw_body)] /// pub file: Vec, /// } /// -/// response { +/// response: { /// #[ruma_api(body)] /// pub my_custom_type: MyCustomType, /// } diff --git a/ruma-api/tests/conversions.rs b/ruma-api/tests/conversions.rs index 3aa11675..b9094df9 100644 --- a/ruma-api/tests/conversions.rs +++ b/ruma-api/tests/conversions.rs @@ -2,7 +2,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Does something.", method: POST, name: "my_endpoint", @@ -11,7 +11,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { pub hello: String, #[ruma_api(header = CONTENT_TYPE)] pub world: String, @@ -25,7 +25,7 @@ ruma_api! { pub baz: UserId, } - response { + response: { pub hello: String, #[ruma_api(header = CONTENT_TYPE)] pub world: String, diff --git a/ruma-api/tests/no_fields.rs b/ruma-api/tests/no_fields.rs index e2508737..db131af2 100644 --- a/ruma-api/tests/no_fields.rs +++ b/ruma-api/tests/no_fields.rs @@ -3,7 +3,7 @@ use std::convert::TryFrom; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Does something.", method: GET, name: "no_fields", @@ -12,8 +12,8 @@ ruma_api! { requires_authentication: false, } - request {} - response {} + request: {} + response: {} } #[test] diff --git a/ruma-api/tests/ruma_api_macros.rs b/ruma-api/tests/ruma_api_macros.rs index 7898f143..a689f6ea 100644 --- a/ruma-api/tests/ruma_api_macros.rs +++ b/ruma-api/tests/ruma_api_macros.rs @@ -3,7 +3,7 @@ pub mod some_endpoint { use ruma_events::{tag::TagEvent, AnyRoomEvent, EventJson}; ruma_api! { - metadata { + metadata: { description: "Does something.", method: POST, // An `http::Method` constant. No imports required. name: "some_endpoint", @@ -12,7 +12,7 @@ pub mod some_endpoint { requires_authentication: false, } - request { + request: { // With no attribute on the field, it will be put into the body of the request. pub foo: String, @@ -30,7 +30,7 @@ pub mod some_endpoint { pub baz: String, } - response { + response: { // This value will be extracted from the "Content-Type" HTTP header. #[ruma_api(header = CONTENT_TYPE)] pub content_type: String, @@ -60,7 +60,7 @@ pub mod newtype_body_endpoint { } ruma_api! { - metadata { + metadata: { description: "Does something.", method: PUT, name: "newtype_body_endpoint", @@ -69,12 +69,12 @@ pub mod newtype_body_endpoint { requires_authentication: false, } - request { + request: { #[ruma_api(body)] pub list_of_custom_things: Vec, } - response { + response: { #[ruma_api(body)] pub my_custom_thing: MyCustomType, } @@ -90,7 +90,7 @@ pub mod newtype_raw_body_endpoint { } ruma_api! { - metadata { + metadata: { description: "Does something.", method: PUT, name: "newtype_body_endpoint", @@ -99,12 +99,12 @@ pub mod newtype_raw_body_endpoint { requires_authentication: false, } - request { + request: { #[ruma_api(raw_body)] pub file: Vec, } - response { + response: { #[ruma_api(raw_body)] pub file: Vec, } @@ -115,7 +115,7 @@ pub mod query_map_endpoint { use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Does something.", method: GET, name: "newtype_body_endpoint", @@ -124,12 +124,12 @@ pub mod query_map_endpoint { requires_authentication: false, } - request { + request: { #[ruma_api(query_map)] pub fields: Vec<(String, String)>, } - response { + response: { } } } diff --git a/ruma-appservice-api/src/v1/event/push_events.rs b/ruma-appservice-api/src/v1/event/push_events.rs index 6f165ca5..699d92f7 100644 --- a/ruma-appservice-api/src/v1/event/push_events.rs +++ b/ruma-appservice-api/src/v1/event/push_events.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_events::{AnyEvent, EventJson}; ruma_api! { - metadata { + metadata: { description: "This API is called by the homeserver when it wants to push an event (or batch of events) to the application service.", method: PUT, name: "push_events", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The transaction ID for this set of events. /// /// Homeservers generate these IDs and they are used to ensure idempotency of results. @@ -24,5 +24,5 @@ ruma_api! { pub events: Vec>, } - response {} + response: {} } diff --git a/ruma-appservice-api/src/v1/query/query_room_alias.rs b/ruma-appservice-api/src/v1/query/query_room_alias.rs index ea0e17fe..078c02a8 100644 --- a/ruma-appservice-api/src/v1/query/query_room_alias.rs +++ b/ruma-appservice-api/src/v1/query/query_room_alias.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomAliasId; ruma_api! { - metadata { + metadata: { description: "This endpoint is invoked by the homeserver on an application service to query the existence of a given room alias.", method: GET, name: "query_room_alias", @@ -13,11 +13,11 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room alias being queried. #[ruma_api(path)] pub room_alias: RoomAliasId, } - response {} + response: {} } diff --git a/ruma-appservice-api/src/v1/query/query_user_id.rs b/ruma-appservice-api/src/v1/query/query_user_id.rs index d45cccc3..2b9f0ba4 100644 --- a/ruma-appservice-api/src/v1/query/query_user_id.rs +++ b/ruma-appservice-api/src/v1/query/query_user_id.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "This endpoint is invoked by the homeserver on an application service to query the existence of a given user ID.", method: GET, name: "query_user_id", @@ -13,11 +13,11 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user ID being queried. #[ruma_api(path)] pub user_id: UserId, } - response {} + response: {} } diff --git a/ruma-appservice-api/src/v1/thirdparty/get_location_for_protocol.rs b/ruma-appservice-api/src/v1/thirdparty/get_location_for_protocol.rs index 6c791fd3..c4a0b420 100644 --- a/ruma-appservice-api/src/v1/thirdparty/get_location_for_protocol.rs +++ b/ruma-appservice-api/src/v1/thirdparty/get_location_for_protocol.rs @@ -7,7 +7,7 @@ use ruma_api::ruma_api; use super::Location; ruma_api! { - metadata { + metadata: { description: "Fetches third party locations for a protocol.", method: GET, name: "get_location_for_protocol", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The protocol used to communicate to the third party network. #[ruma_api(path)] pub protocol: String, @@ -26,7 +26,7 @@ ruma_api! { pub fields: BTreeMap, } - response { + response: { /// List of matched third party locations. #[ruma_api(body)] pub locations: Vec, diff --git a/ruma-appservice-api/src/v1/thirdparty/get_location_for_room_alias.rs b/ruma-appservice-api/src/v1/thirdparty/get_location_for_room_alias.rs index 270e2661..14aa3b9b 100644 --- a/ruma-appservice-api/src/v1/thirdparty/get_location_for_room_alias.rs +++ b/ruma-appservice-api/src/v1/thirdparty/get_location_for_room_alias.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomAliasId; use super::Location; ruma_api! { - metadata { + metadata: { description: "Retrieve an array of third party network locations from a Matrix room alias.", method: GET, name: "get_location_for_room_alias", @@ -15,13 +15,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The Matrix room alias to look up. #[ruma_api(query)] pub alias: RoomAliasId, } - response { + response: { /// List of matched third party locations. #[ruma_api(body)] pub locations: Vec, diff --git a/ruma-appservice-api/src/v1/thirdparty/get_protocol.rs b/ruma-appservice-api/src/v1/thirdparty/get_protocol.rs index 726336c6..faf9ddbc 100644 --- a/ruma-appservice-api/src/v1/thirdparty/get_protocol.rs +++ b/ruma-appservice-api/src/v1/thirdparty/get_protocol.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::Protocol; ruma_api! { - metadata { + metadata: { description: "Fetches the metadata from the homeserver about a particular third party protocol.", method: GET, name: "get_protocol", @@ -14,13 +14,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The name of the protocol. #[ruma_api(path)] pub protocol: String, } - response { + response: { /// Metadata about the protocol. #[ruma_api(body)] pub protocol: Protocol, diff --git a/ruma-appservice-api/src/v1/thirdparty/get_user_for_protocol.rs b/ruma-appservice-api/src/v1/thirdparty/get_user_for_protocol.rs index f9fb14a2..6dfdc5eb 100644 --- a/ruma-appservice-api/src/v1/thirdparty/get_user_for_protocol.rs +++ b/ruma-appservice-api/src/v1/thirdparty/get_user_for_protocol.rs @@ -7,7 +7,7 @@ use ruma_api::ruma_api; use super::User; ruma_api! { - metadata { + metadata: { description: "Fetches third party users for a protocol.", method: GET, name: "get_user_for_protocol", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The protocol used to communicate to the third party network. #[ruma_api(path)] pub protocol: String, @@ -26,7 +26,7 @@ ruma_api! { pub fields: BTreeMap, } - response { + response: { /// List of matched third party users. #[ruma_api(body)] pub users: Vec, diff --git a/ruma-appservice-api/src/v1/thirdparty/get_user_for_user_id.rs b/ruma-appservice-api/src/v1/thirdparty/get_user_for_user_id.rs index 7ac655ef..d95b7093 100644 --- a/ruma-appservice-api/src/v1/thirdparty/get_user_for_user_id.rs +++ b/ruma-appservice-api/src/v1/thirdparty/get_user_for_user_id.rs @@ -6,7 +6,7 @@ use ruma_identifiers::UserId; use super::User; ruma_api! { - metadata { + metadata: { description: "Retrieve an array of third party users from a Matrix User ID.", method: GET, name: "get_user_for_user_id", @@ -15,13 +15,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The Matrix User ID to look up. #[ruma_api(query)] pub userid: UserId, } - response { + response: { /// List of matched third party users. #[ruma_api(body)] pub users: Vec, diff --git a/ruma-client-api/src/r0/account/add_3pid.rs b/ruma-client-api/src/r0/account/add_3pid.rs index 44b663b2..413acc4e 100644 --- a/ruma-client-api/src/r0/account/add_3pid.rs +++ b/ruma-client-api/src/r0/account/add_3pid.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use crate::r0::uiaa::{AuthData, UiaaResponse}; ruma_api! { - metadata { + metadata: { description: "Add contact information to a user's account", method: POST, name: "add_3pid", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Additional information for the User-Interactive Authentication API. #[serde(skip_serializing_if = "Option::is_none")] pub auth: Option, @@ -26,7 +26,7 @@ ruma_api! { pub sid: String, } - response {} + response: {} error: UiaaResponse } diff --git a/ruma-client-api/src/r0/account/bind_3pid.rs b/ruma-client-api/src/r0/account/bind_3pid.rs index d13c31b2..fff6820e 100644 --- a/ruma-client-api/src/r0/account/bind_3pid.rs +++ b/ruma-client-api/src/r0/account/bind_3pid.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::IdentityServerInfo; ruma_api! { - metadata { + metadata: { description: "Bind a 3PID to a user's account on an identity server", method: POST, name: "bind_3pid", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -27,7 +27,7 @@ ruma_api! { pub sid: String, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/account/change_password.rs b/ruma-client-api/src/r0/account/change_password.rs index 8a4223d1..efd83aa7 100644 --- a/ruma-client-api/src/r0/account/change_password.rs +++ b/ruma-client-api/src/r0/account/change_password.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use crate::r0::uiaa::{AuthData, UiaaResponse}; ruma_api! { - metadata { + metadata: { description: "Change the password of the current user's account.", method: POST, name: "change_password", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The new password for the account. pub new_password: String, @@ -22,7 +22,7 @@ ruma_api! { pub auth: Option, } - response {} + response: {} error: UiaaResponse } diff --git a/ruma-client-api/src/r0/account/deactivate.rs b/ruma-client-api/src/r0/account/deactivate.rs index a46b666a..0f220aa5 100644 --- a/ruma-client-api/src/r0/account/deactivate.rs +++ b/ruma-client-api/src/r0/account/deactivate.rs @@ -7,7 +7,7 @@ use crate::r0::uiaa::{AuthData, UiaaResponse}; use super::ThirdPartyIdRemovalStatus; ruma_api! { - metadata { + metadata: { description: "Deactivate the current user's account.", method: POST, name: "deactivate", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Additional authentication information for the user-interactive authentication API. #[serde(skip_serializing_if = "Option::is_none")] pub auth: Option, @@ -27,7 +27,7 @@ ruma_api! { pub id_server: Option, } - response { + response: { /// Result of unbind operation. pub id_server_unbind_result: ThirdPartyIdRemovalStatus, } diff --git a/ruma-client-api/src/r0/account/delete_3pid.rs b/ruma-client-api/src/r0/account/delete_3pid.rs index 3138cdb5..f35e4997 100644 --- a/ruma-client-api/src/r0/account/delete_3pid.rs +++ b/ruma-client-api/src/r0/account/delete_3pid.rs @@ -6,7 +6,7 @@ use super::ThirdPartyIdRemovalStatus; use crate::r0::thirdparty::Medium; ruma_api! { - metadata { + metadata: { description: "Delete a 3PID from a user's account on an identity server.", method: POST, name: "delete_3pid", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Identity server to delete from. #[serde(skip_serializing_if = "Option::is_none")] pub id_server: Option, @@ -27,7 +27,7 @@ ruma_api! { pub address: String, } - response { + response: { /// Result of unbind operation. pub id_server_unbind_result: ThirdPartyIdRemovalStatus, } diff --git a/ruma-client-api/src/r0/account/get_username_availability.rs b/ruma-client-api/src/r0/account/get_username_availability.rs index ffe1be74..48ee79a9 100644 --- a/ruma-client-api/src/r0/account/get_username_availability.rs +++ b/ruma-client-api/src/r0/account/get_username_availability.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Checks to see if a username is available, and valid, for the server.", method: GET, name: "get_username_availability", @@ -12,13 +12,13 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The username to check the availability of. #[ruma_api(query)] pub username: String, } - response { + response: { /// A flag to indicate that the username is available. /// This should always be true when the server replies with 200 OK. pub available: bool diff --git a/ruma-client-api/src/r0/account/register.rs b/ruma-client-api/src/r0/account/register.rs index 1c14e99a..9a5c667f 100644 --- a/ruma-client-api/src/r0/account/register.rs +++ b/ruma-client-api/src/r0/account/register.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use crate::r0::uiaa::{AuthData, UiaaResponse}; ruma_api! { - metadata { + metadata: { description: "Register an account on this homeserver.", method: POST, name: "register", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The desired password for the account. /// /// May be empty for accounts that should not be able to log in again @@ -65,7 +65,7 @@ ruma_api! { pub inhibit_login: bool, } - response { + response: { /// An access token for the account. /// /// This access token can then be used to authorize other requests. diff --git a/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs b/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs index 3042225b..c5205c5e 100644 --- a/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs +++ b/ruma-client-api/src/r0/account/request_3pid_management_token_via_email.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use super::IdentityServerInfo; ruma_api! { - metadata { + metadata: { description: "Request a 3PID management token with a 3rd party email.", method: POST, name: "request_3pid_association_token_via_email", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -35,7 +35,7 @@ ruma_api! { pub identity_server_info: Option, } - response { + response: { /// The session identifier given by the identity server. pub sid: String, diff --git a/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs b/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs index 21ce58af..d420af33 100644 --- a/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs +++ b/ruma-client-api/src/r0/account/request_3pid_management_token_via_msisdn.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use super::IdentityServerInfo; ruma_api! { - metadata { + metadata: { description: "Request a 3PID management token with a phone number.", method: POST, name: "request_3pid_association_token_via_msisdn", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -38,7 +38,7 @@ ruma_api! { pub identity_server_info: Option, } - response { + response: { /// The session identifier given by the identity server. pub sid: String, diff --git a/ruma-client-api/src/r0/account/request_openid_token.rs b/ruma-client-api/src/r0/account/request_openid_token.rs index 94107189..4b6bee3a 100644 --- a/ruma-client-api/src/r0/account/request_openid_token.rs +++ b/ruma-client-api/src/r0/account/request_openid_token.rs @@ -7,7 +7,7 @@ use ruma_identifiers::UserId; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Request an OpenID 1.0 token to verify identity with a third party.", name: "request_openid_token", method: POST, @@ -16,13 +16,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// User ID of authenticated user. #[ruma_api(path)] pub user_id: UserId, } - response { + response: { /// Access token for verifying user's identity. pub access_token: String, diff --git a/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs b/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs index f796191f..e79d9e7f 100644 --- a/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs +++ b/ruma-client-api/src/r0/account/request_password_change_token_via_email.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use super::IdentityServerInfo; ruma_api! { - metadata { + metadata: { description: "Request that a password change token is sent to the given email address.", method: POST, name: "request_password_change_token_via_email", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -35,7 +35,7 @@ ruma_api! { pub identity_server_info: Option, } - response { + response: { /// The session identifier given by the identity server. pub sid: String, diff --git a/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs b/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs index 7e14e2ad..e8e9d5a6 100644 --- a/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs +++ b/ruma-client-api/src/r0/account/request_password_change_token_via_msisdn.rs @@ -4,7 +4,7 @@ use js_int::UInt; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Request that a password change token is sent to the given phone number.", method: POST, name: "request_password_change_token_via_msisdn", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -31,7 +31,7 @@ ruma_api! { pub next_link: Option, } - response { + response: { /// The session identifier given by the identity server. pub sid: String, diff --git a/ruma-client-api/src/r0/account/request_registration_token_via_email.rs b/ruma-client-api/src/r0/account/request_registration_token_via_email.rs index dc1c4cd0..ca28acb9 100644 --- a/ruma-client-api/src/r0/account/request_registration_token_via_email.rs +++ b/ruma-client-api/src/r0/account/request_registration_token_via_email.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use super::IdentityServerInfo; ruma_api! { - metadata { + metadata: { description: "Request a registration token with a 3rd party email.", method: POST, name: "request_registration_token_via_email", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -35,7 +35,7 @@ ruma_api! { pub identity_server_info: Option, } - response { + response: { /// The session identifier given by the identity server. pub sid: String, diff --git a/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs b/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs index afe7e53b..a9b0d902 100644 --- a/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs +++ b/ruma-client-api/src/r0/account/request_registration_token_via_msisdn.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use super::IdentityServerInfo; ruma_api! { - metadata { + metadata: { description: "Request a registration token with a phone number.", method: POST, name: "request_registration_token_via_msisdn", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -38,7 +38,7 @@ ruma_api! { pub identity_server_info: Option, } - response { + response: { /// The session identifier given by the identity server. pub sid: String, diff --git a/ruma-client-api/src/r0/account/unbind_3pid.rs b/ruma-client-api/src/r0/account/unbind_3pid.rs index 8bdd7098..92c00a5e 100644 --- a/ruma-client-api/src/r0/account/unbind_3pid.rs +++ b/ruma-client-api/src/r0/account/unbind_3pid.rs @@ -6,7 +6,7 @@ use super::ThirdPartyIdRemovalStatus; use crate::r0::thirdparty::Medium; ruma_api! { - metadata { + metadata: { description: "Unbind a 3PID from a user's account on an identity server.", method: POST, name: "unbind_3pid", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Identity server to unbind from. #[serde(skip_serializing_if = "Option::is_none")] pub id_server: Option, @@ -27,7 +27,7 @@ ruma_api! { pub address: String, } - response { + response: { /// Result of unbind operation. pub id_server_unbind_result: ThirdPartyIdRemovalStatus, } diff --git a/ruma-client-api/src/r0/account/whoami.rs b/ruma-client-api/src/r0/account/whoami.rs index cdc2b7e7..f2c44d7b 100644 --- a/ruma-client-api/src/r0/account/whoami.rs +++ b/ruma-client-api/src/r0/account/whoami.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Get information about the owner of a given access token.", method: GET, name: "whoami", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// The id of the user that owns the access token. pub user_id: UserId, } diff --git a/ruma-client-api/src/r0/alias/create_alias.rs b/ruma-client-api/src/r0/alias/create_alias.rs index 0c84c30c..dba3e74b 100644 --- a/ruma-client-api/src/r0/alias/create_alias.rs +++ b/ruma-client-api/src/r0/alias/create_alias.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomAliasId, RoomId}; ruma_api! { - metadata { + metadata: { description: "Add an alias to a room.", method: PUT, name: "create_alias", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room alias to set. #[ruma_api(path)] pub room_alias: RoomAliasId, @@ -22,7 +22,7 @@ ruma_api! { pub room_id: RoomId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/alias/delete_alias.rs b/ruma-client-api/src/r0/alias/delete_alias.rs index c8dbedc2..f5c2aa26 100644 --- a/ruma-client-api/src/r0/alias/delete_alias.rs +++ b/ruma-client-api/src/r0/alias/delete_alias.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomAliasId; ruma_api! { - metadata { + metadata: { description: "Remove an alias from a room.", method: DELETE, name: "delete_alias", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room alias to remove. #[ruma_api(path)] pub room_alias: RoomAliasId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/alias/get_alias.rs b/ruma-client-api/src/r0/alias/get_alias.rs index 8e462a7c..f3184dc1 100644 --- a/ruma-client-api/src/r0/alias/get_alias.rs +++ b/ruma-client-api/src/r0/alias/get_alias.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomAliasId, RoomId}; ruma_api! { - metadata { + metadata: { description: "Resolve a room alias to a room ID.", method: GET, name: "get_alias", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room alias. #[ruma_api(path)] pub room_alias: RoomAliasId, } - response { + response: { /// The room ID for this room alias. pub room_id: RoomId, diff --git a/ruma-client-api/src/r0/appservice/set_room_visibility.rs b/ruma-client-api/src/r0/appservice/set_room_visibility.rs index f819e762..1d107067 100644 --- a/ruma-client-api/src/r0/appservice/set_room_visibility.rs +++ b/ruma-client-api/src/r0/appservice/set_room_visibility.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use crate::r0::room::Visibility; ruma_api! { - metadata { + metadata: { description: "Updates the visibility of a given room on the application service's room directory.", method: PUT, name: "set_room_visibility", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The protocol (network) ID to update the room list for. #[ruma_api(path)] pub network_id: String, @@ -28,7 +28,7 @@ ruma_api! { pub visibility: Visibility, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/capabilities/get_capabilities.rs b/ruma-client-api/src/r0/capabilities/get_capabilities.rs index b4f1e97a..0c7bb7d7 100644 --- a/ruma-client-api/src/r0/capabilities/get_capabilities.rs +++ b/ruma-client-api/src/r0/capabilities/get_capabilities.rs @@ -7,7 +7,7 @@ use serde_json::Value as JsonValue; use std::collections::BTreeMap; ruma_api! { - metadata { + metadata: { description: "Gets information about the server's supported feature set and other relevant capabilities.", method: GET, name: "get_capabilities", @@ -16,9 +16,9 @@ ruma_api! { requires_authentication: true } - request {} + request: {} - response { + response: { /// The capabilities the server supports pub capabilities: Capabilities, } diff --git a/ruma-client-api/src/r0/config/get_global_account_data.rs b/ruma-client-api/src/r0/config/get_global_account_data.rs index f61282ee..d6f840c7 100644 --- a/ruma-client-api/src/r0/config/get_global_account_data.rs +++ b/ruma-client-api/src/r0/config/get_global_account_data.rs @@ -5,7 +5,7 @@ use ruma_events::{AnyBasicEvent, EventJson}; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Gets global account data for a user.", name: "get_global_account_data", method: GET, @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// User ID of user for whom to retrieve data. #[ruma_api(path)] pub user_id: UserId, @@ -24,7 +24,7 @@ ruma_api! { pub event_type: String, } - response { + response: { /// Account data content for the given type. #[ruma_api(body)] pub account_data: EventJson, diff --git a/ruma-client-api/src/r0/config/get_room_account_data.rs b/ruma-client-api/src/r0/config/get_room_account_data.rs index bda18c73..b9f5af71 100644 --- a/ruma-client-api/src/r0/config/get_room_account_data.rs +++ b/ruma-client-api/src/r0/config/get_room_account_data.rs @@ -5,7 +5,7 @@ use ruma_events::{AnyBasicEvent, EventJson}; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Gets account data room for a user for a given room", name: "get_room_account_data", method: GET, @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// User ID of user for whom to retrieve data. #[ruma_api(path)] pub user_id: UserId, @@ -28,7 +28,7 @@ ruma_api! { pub event_type: String, } - response { + response: { /// Account data content for the given type. #[ruma_api(body)] pub account_data: EventJson, diff --git a/ruma-client-api/src/r0/config/set_global_account_data.rs b/ruma-client-api/src/r0/config/set_global_account_data.rs index 9214271c..eeabef26 100644 --- a/ruma-client-api/src/r0/config/set_global_account_data.rs +++ b/ruma-client-api/src/r0/config/set_global_account_data.rs @@ -5,7 +5,7 @@ use ruma_identifiers::UserId; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Sets global account data.", method: PUT, name: "set_global_account_data", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Arbitrary JSON to store as config data. /// /// To create a `Box`, use `serde_json::value::to_raw_value`. @@ -34,7 +34,7 @@ ruma_api! { pub user_id: UserId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/config/set_room_account_data.rs b/ruma-client-api/src/r0/config/set_room_account_data.rs index 457ee643..63029553 100644 --- a/ruma-client-api/src/r0/config/set_room_account_data.rs +++ b/ruma-client-api/src/r0/config/set_room_account_data.rs @@ -5,7 +5,7 @@ use ruma_identifiers::{RoomId, UserId}; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Associate account data with a room.", method: PUT, name: "set_room_account_data", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Arbitrary JSON to store as config data. /// /// To create a `Box`, use `serde_json::value::to_raw_value`. @@ -38,7 +38,7 @@ ruma_api! { pub user_id: UserId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/contact/get_contacts.rs b/ruma-client-api/src/r0/contact/get_contacts.rs index 9d532719..4e5c3600 100644 --- a/ruma-client-api/src/r0/contact/get_contacts.rs +++ b/ruma-client-api/src/r0/contact/get_contacts.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use crate::r0::thirdparty::Medium; ruma_api! { - metadata { + metadata: { description: "Get a list of 3rd party contacts associated with the user's account.", method: GET, name: "get_contacts", @@ -17,9 +17,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// A list of third party identifiers the homeserver has associated with the user's /// account. #[serde(default, skip_serializing_if = "Vec::is_empty")] diff --git a/ruma-client-api/src/r0/contact/request_contact_verification_token.rs b/ruma-client-api/src/r0/contact/request_contact_verification_token.rs index 03cda2ee..721106f2 100644 --- a/ruma-client-api/src/r0/contact/request_contact_verification_token.rs +++ b/ruma-client-api/src/r0/contact/request_contact_verification_token.rs @@ -4,7 +4,7 @@ use js_int::UInt; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Ask for a verification token for a given 3rd party ID.", method: POST, name: "request_contact_verification_token", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Client-generated secret string used to protect this session. pub client_secret: String, @@ -41,7 +41,7 @@ ruma_api! { pub id_access_token: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/context/get_context.rs b/ruma-client-api/src/r0/context/get_context.rs index 0b476c90..dc0b20b4 100644 --- a/ruma-client-api/src/r0/context/get_context.rs +++ b/ruma-client-api/src/r0/context/get_context.rs @@ -8,7 +8,7 @@ use ruma_identifiers::{EventId, RoomId}; use crate::r0::filter::RoomEventFilter; ruma_api! { - metadata { + metadata: { description: "Get the events immediately preceding and following a given event.", method: GET, path: "/_matrix/client/r0/rooms/:room_id/context/:event_id", @@ -17,7 +17,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to get events from. #[ruma_api(path)] pub room_id: RoomId, @@ -43,7 +43,7 @@ ruma_api! { pub filter: Option, } - response { + response: { /// A token that can be used to paginate backwards with. #[serde(skip_serializing_if = "Option::is_none")] pub start: Option, diff --git a/ruma-client-api/src/r0/device/delete_device.rs b/ruma-client-api/src/r0/device/delete_device.rs index 19a8df30..ca99100f 100644 --- a/ruma-client-api/src/r0/device/delete_device.rs +++ b/ruma-client-api/src/r0/device/delete_device.rs @@ -6,7 +6,7 @@ use ruma_identifiers::DeviceId; use crate::r0::uiaa::{AuthData, UiaaResponse}; ruma_api! { - metadata { + metadata: { description: "Delete a device for authenticated user.", method: DELETE, name: "delete_device", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The device to delete. #[ruma_api(path)] pub device_id: DeviceId, @@ -25,7 +25,7 @@ ruma_api! { pub auth: Option, } - response {} + response: {} error: UiaaResponse } diff --git a/ruma-client-api/src/r0/device/delete_devices.rs b/ruma-client-api/src/r0/device/delete_devices.rs index d8f35b6d..72f3eaa0 100644 --- a/ruma-client-api/src/r0/device/delete_devices.rs +++ b/ruma-client-api/src/r0/device/delete_devices.rs @@ -6,7 +6,7 @@ use ruma_identifiers::DeviceId; use crate::r0::uiaa::{AuthData, UiaaResponse}; ruma_api! { - metadata { + metadata: { description: "Delete specified devices.", method: POST, path: "/_matrix/client/r0/delete_devices", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// List of devices to delete. pub devices: Vec, @@ -24,7 +24,7 @@ ruma_api! { pub auth: Option, } - response {} + response: {} error: UiaaResponse } diff --git a/ruma-client-api/src/r0/device/get_device.rs b/ruma-client-api/src/r0/device/get_device.rs index 7095162b..2b6b01c5 100644 --- a/ruma-client-api/src/r0/device/get_device.rs +++ b/ruma-client-api/src/r0/device/get_device.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use ruma_identifiers::DeviceId; ruma_api! { - metadata { + metadata: { description: "Get a device for authenticated user.", method: GET, name: "get_device", @@ -14,13 +14,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The device to retrieve. #[ruma_api(path)] pub device_id: DeviceId, } - response { + response: { /// Information about the device. #[ruma_api(body)] pub device: Device, diff --git a/ruma-client-api/src/r0/device/get_devices.rs b/ruma-client-api/src/r0/device/get_devices.rs index 0e6fef51..01f1cc97 100644 --- a/ruma-client-api/src/r0/device/get_devices.rs +++ b/ruma-client-api/src/r0/device/get_devices.rs @@ -4,7 +4,7 @@ use super::Device; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Get registered devices for authenticated user.", method: GET, name: "get_devices", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// A list of all registered devices for this user pub devices: Vec, } diff --git a/ruma-client-api/src/r0/device/update_device.rs b/ruma-client-api/src/r0/device/update_device.rs index fdd30d67..ff874e5d 100644 --- a/ruma-client-api/src/r0/device/update_device.rs +++ b/ruma-client-api/src/r0/device/update_device.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::DeviceId; ruma_api! { - metadata { + metadata: { description: "Update metadata for a device.", method: PUT, name: "update_device", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The device to update. #[ruma_api(path)] pub device_id: DeviceId, @@ -24,7 +24,7 @@ ruma_api! { pub display_name: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/directory/get_public_rooms.rs b/ruma-client-api/src/r0/directory/get_public_rooms.rs index edac36b8..1d1b3241 100644 --- a/ruma-client-api/src/r0/directory/get_public_rooms.rs +++ b/ruma-client-api/src/r0/directory/get_public_rooms.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use super::PublicRoomsChunk; ruma_api! { - metadata { + metadata: { description: "Get the list of rooms in this homeserver's public directory.", method: GET, name: "get_public_rooms", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Limit for the number of results to return. #[serde(skip_serializing_if = "Option::is_none")] #[ruma_api(query)] @@ -34,7 +34,7 @@ ruma_api! { pub server: Option, } - response { + response: { /// A paginated chunk of public rooms. pub chunk: Vec, diff --git a/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs b/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs index dba8e366..0a1d9116 100644 --- a/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs +++ b/ruma-client-api/src/r0/directory/get_public_rooms_filtered.rs @@ -15,7 +15,7 @@ use serde_json::Value as JsonValue; use super::PublicRoomsChunk; ruma_api! { - metadata { + metadata: { description: "Get the list of rooms in this homeserver's public directory.", method: POST, name: "get_public_rooms_filtered", @@ -24,7 +24,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The server to fetch the public room lists from. /// /// `None` means the server this request is sent to. @@ -49,7 +49,7 @@ ruma_api! { pub room_network: RoomNetwork, } - response { + response: { /// A paginated chunk of public rooms. pub chunk: Vec, diff --git a/ruma-client-api/src/r0/directory/get_room_visibility.rs b/ruma-client-api/src/r0/directory/get_room_visibility.rs index 5ab16326..b9be8413 100644 --- a/ruma-client-api/src/r0/directory/get_room_visibility.rs +++ b/ruma-client-api/src/r0/directory/get_room_visibility.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use crate::r0::room::Visibility; ruma_api! { - metadata { + metadata: { description: "Get the visibility of a public room on a directory.", name: "get_room_visibility", method: GET, @@ -15,13 +15,13 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The ID of the room of which to request the visibility. #[ruma_api(path)] pub room_id: RoomId, } - response { + response: { /// Visibility of the room. pub visibility: Visibility, } diff --git a/ruma-client-api/src/r0/directory/set_room_visibility.rs b/ruma-client-api/src/r0/directory/set_room_visibility.rs index dc04c5cd..1c6426ee 100644 --- a/ruma-client-api/src/r0/directory/set_room_visibility.rs +++ b/ruma-client-api/src/r0/directory/set_room_visibility.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use crate::r0::room::Visibility; ruma_api! { - metadata { + metadata: { description: "Set the visibility of a public room on a directory.", name: "set_room_visibility", method: PUT, @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The ID of the room of which to set the visibility. #[ruma_api(path)] pub room_id: RoomId, @@ -24,7 +24,7 @@ ruma_api! { pub visibility: Visibility, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/filter/create_filter.rs b/ruma-client-api/src/r0/filter/create_filter.rs index a3d2dc1f..61daa97b 100644 --- a/ruma-client-api/src/r0/filter/create_filter.rs +++ b/ruma-client-api/src/r0/filter/create_filter.rs @@ -6,7 +6,7 @@ use ruma_identifiers::UserId; use super::FilterDefinition; ruma_api! { - metadata { + metadata: { description: "Create a new filter for event retrieval.", method: POST, name: "create_filter", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The ID of the user uploading the filter. /// /// The access token must be authorized to make requests for this user ID. @@ -27,7 +27,7 @@ ruma_api! { pub filter: FilterDefinition, } - response { + response: { /// The ID of the filter that was created. pub filter_id: String, } diff --git a/ruma-client-api/src/r0/filter/get_filter.rs b/ruma-client-api/src/r0/filter/get_filter.rs index c69c57d9..e7684490 100644 --- a/ruma-client-api/src/r0/filter/get_filter.rs +++ b/ruma-client-api/src/r0/filter/get_filter.rs @@ -6,7 +6,7 @@ use ruma_identifiers::UserId; use super::FilterDefinition; ruma_api! { - metadata { + metadata: { description: "Retrieve a previously created filter.", method: GET, name: "get_filter", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user ID to download a filter for. #[ruma_api(path)] pub user_id: UserId, @@ -25,7 +25,7 @@ ruma_api! { pub filter_id: String, } - response { + response: { /// The filter definition. #[ruma_api(body)] pub filter: FilterDefinition, diff --git a/ruma-client-api/src/r0/keys/claim_keys.rs b/ruma-client-api/src/r0/keys/claim_keys.rs index d894d400..50457619 100644 --- a/ruma-client-api/src/r0/keys/claim_keys.rs +++ b/ruma-client-api/src/r0/keys/claim_keys.rs @@ -11,7 +11,7 @@ use serde_json::Value as JsonValue; use super::{AlgorithmAndDeviceId, KeyAlgorithm, OneTimeKey}; ruma_api! { - metadata { + metadata: { description: "Claims one-time keys for use in pre-key messages.", method: POST, name: "claim_keys", @@ -20,7 +20,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The time (in milliseconds) to wait when downloading keys from remote servers. /// 10 seconds is the recommended default. #[serde( @@ -34,7 +34,7 @@ ruma_api! { pub one_time_keys: BTreeMap>, } - response { + response: { /// If any remote homeservers could not be reached, they are recorded here. /// The names of the properties are the names of the unreachable servers. pub failures: BTreeMap, diff --git a/ruma-client-api/src/r0/keys/get_key_changes.rs b/ruma-client-api/src/r0/keys/get_key_changes.rs index fb979f8d..c399e826 100644 --- a/ruma-client-api/src/r0/keys/get_key_changes.rs +++ b/ruma-client-api/src/r0/keys/get_key_changes.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Gets a list of users who have updated their device identity keys since a previous sync token.", method: GET, name: "get_key_changes", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The desired start point of the list. /// Should be the next_batch field from a response to an earlier call to /sync. #[ruma_api(query)] @@ -25,7 +25,7 @@ ruma_api! { pub to: String, } - response { + response: { /// The Matrix User IDs of all users who updated their device identity keys. pub changed: Vec, diff --git a/ruma-client-api/src/r0/keys/get_keys.rs b/ruma-client-api/src/r0/keys/get_keys.rs index a8ec4dd2..949b8570 100644 --- a/ruma-client-api/src/r0/keys/get_keys.rs +++ b/ruma-client-api/src/r0/keys/get_keys.rs @@ -9,7 +9,7 @@ use serde_json::Value as JsonValue; use super::DeviceKeys; ruma_api! { - metadata { + metadata: { description: "Returns the current devices and identity keys for the given users.", method: POST, name: "get_keys", @@ -18,7 +18,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The time (in milliseconds) to wait when downloading keys from remote /// servers. 10 seconds is the recommended default. #[serde( @@ -41,7 +41,7 @@ ruma_api! { pub token: Option, } - response { + response: { /// If any remote homeservers could not be reached, they are recorded /// here. The names of the properties are the names of the unreachable /// servers. diff --git a/ruma-client-api/src/r0/keys/upload_keys.rs b/ruma-client-api/src/r0/keys/upload_keys.rs index 95224f3c..0d649bde 100644 --- a/ruma-client-api/src/r0/keys/upload_keys.rs +++ b/ruma-client-api/src/r0/keys/upload_keys.rs @@ -8,7 +8,7 @@ use ruma_api::ruma_api; use super::{AlgorithmAndDeviceId, DeviceKeys, KeyAlgorithm, OneTimeKey}; ruma_api! { - metadata { + metadata: { description: "Publishes end-to-end encryption keys for the device.", method: POST, name: "upload_keys", @@ -17,7 +17,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Identity keys for the device. May be absent if no new identity keys are required. #[serde(skip_serializing_if = "Option::is_none")] pub device_keys: Option, @@ -27,7 +27,7 @@ ruma_api! { pub one_time_keys: Option>, } - response { + response: { /// For each key algorithm, the number of unclaimed one-time keys of that /// type currently held on the server for this device. pub one_time_key_counts: BTreeMap diff --git a/ruma-client-api/src/r0/media/create_content.rs b/ruma-client-api/src/r0/media/create_content.rs index 1f75f0de..25bc4044 100644 --- a/ruma-client-api/src/r0/media/create_content.rs +++ b/ruma-client-api/src/r0/media/create_content.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Upload content to the media store.", method: POST, name: "create_media_content", @@ -12,7 +12,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The name of the file being uploaded. #[ruma_api(query)] #[serde(skip_serializing_if = "Option::is_none")] @@ -28,7 +28,7 @@ ruma_api! { pub file: Vec, } - response { + response: { /// The MXC URI for the uploaded content. pub content_uri: String, } diff --git a/ruma-client-api/src/r0/media/get_content.rs b/ruma-client-api/src/r0/media/get_content.rs index 94d625a4..d5e1d825 100644 --- a/ruma-client-api/src/r0/media/get_content.rs +++ b/ruma-client-api/src/r0/media/get_content.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Retrieve content from the media store.", method: GET, name: "get_media_content", @@ -12,7 +12,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The media ID from the mxc:// URI (the path component). #[ruma_api(path)] pub media_id: String, @@ -27,7 +27,7 @@ ruma_api! { pub allow_remote: Option, } - response { + response: { /// The content that was previously uploaded. #[ruma_api(raw_body)] pub file: Vec, diff --git a/ruma-client-api/src/r0/media/get_content_as_filename.rs b/ruma-client-api/src/r0/media/get_content_as_filename.rs index 0664b331..fc451e53 100644 --- a/ruma-client-api/src/r0/media/get_content_as_filename.rs +++ b/ruma-client-api/src/r0/media/get_content_as_filename.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Retrieve content from the media store, specifying a filename to return.", method: GET, name: "get_media_content_as_filename", @@ -12,7 +12,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The media ID from the mxc:// URI (the path component). #[ruma_api(path)] pub media_id: String, @@ -31,7 +31,7 @@ ruma_api! { pub allow_remote: Option, } - response { + response: { /// The content that was previously uploaded. #[ruma_api(raw_body)] pub file: Vec, diff --git a/ruma-client-api/src/r0/media/get_content_thumbnail.rs b/ruma-client-api/src/r0/media/get_content_thumbnail.rs index ad73e327..7e9fe07a 100644 --- a/ruma-client-api/src/r0/media/get_content_thumbnail.rs +++ b/ruma-client-api/src/r0/media/get_content_thumbnail.rs @@ -16,7 +16,7 @@ pub enum Method { } ruma_api! { - metadata { + metadata: { description: "Get a thumbnail of content from the media store.", method: GET, name: "get_content_thumbnail", @@ -25,7 +25,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Whether to fetch media deemed remote. /// /// Used to prevent routing loops. Defaults to `true`. @@ -57,7 +57,7 @@ ruma_api! { pub width: UInt, } - response { + response: { /// The content type of the thumbnail. #[ruma_api(header = CONTENT_TYPE)] pub content_type: String, diff --git a/ruma-client-api/src/r0/media/get_media_config.rs b/ruma-client-api/src/r0/media/get_media_config.rs index ff4aba2a..963a0d2e 100644 --- a/ruma-client-api/src/r0/media/get_media_config.rs +++ b/ruma-client-api/src/r0/media/get_media_config.rs @@ -4,7 +4,7 @@ use js_int::UInt; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Gets the config for the media repository.", method: GET, path: "/_matrix/media/r0/config", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// Maximum size of upload in bytes. #[serde(rename = "m.upload.size")] pub upload_size: UInt, diff --git a/ruma-client-api/src/r0/media/get_media_preview.rs b/ruma-client-api/src/r0/media/get_media_preview.rs index 28f18b08..ba500513 100644 --- a/ruma-client-api/src/r0/media/get_media_preview.rs +++ b/ruma-client-api/src/r0/media/get_media_preview.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Get a preview for a URL.", name: "get_media_preview", method: GET, @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// URL to get a preview of. #[ruma_api(query)] pub url: String, @@ -26,7 +26,7 @@ ruma_api! { pub ts: SystemTime, } - response { + response: { /// OpenGraph-like data for the URL. /// /// Differences from OpenGraph: the image size in bytes is added to the `matrix:image:size` diff --git a/ruma-client-api/src/r0/membership/ban_user.rs b/ruma-client-api/src/r0/membership/ban_user.rs index 0da3e1a8..54dbda5f 100644 --- a/ruma-client-api/src/r0/membership/ban_user.rs +++ b/ruma-client-api/src/r0/membership/ban_user.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Ban a user from a room.", method: POST, name: "ban_user", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to kick the user from. #[ruma_api(path)] pub room_id: RoomId, @@ -26,7 +26,7 @@ ruma_api! { pub reason: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/membership/forget_room.rs b/ruma-client-api/src/r0/membership/forget_room.rs index 39644b06..93b11867 100644 --- a/ruma-client-api/src/r0/membership/forget_room.rs +++ b/ruma-client-api/src/r0/membership/forget_room.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomId; ruma_api! { - metadata { + metadata: { description: "Forget a room.", method: POST, name: "forget_room", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to forget. #[ruma_api(path)] pub room_id: RoomId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/membership/get_member_events.rs b/ruma-client-api/src/r0/membership/get_member_events.rs index b23fa277..8ca11eec 100644 --- a/ruma-client-api/src/r0/membership/get_member_events.rs +++ b/ruma-client-api/src/r0/membership/get_member_events.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Get membership events for a room.", method: GET, name: "get_member_events", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to get the member events for. #[ruma_api(path)] pub room_id: RoomId, @@ -40,7 +40,7 @@ ruma_api! { pub not_membership: Option, } - response { + response: { /// A list of member events. pub chunk: Vec> } diff --git a/ruma-client-api/src/r0/membership/invite_user.rs b/ruma-client-api/src/r0/membership/invite_user.rs index 497da5d6..bc893225 100644 --- a/ruma-client-api/src/r0/membership/invite_user.rs +++ b/ruma-client-api/src/r0/membership/invite_user.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; use super::Invite3pid; ruma_api! { - metadata { + metadata: { description: "Invite a user to a room.", method: POST, name: "invite_user", @@ -22,7 +22,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room where the user should be invited. #[ruma_api(path)] pub room_id: RoomId, @@ -32,7 +32,7 @@ ruma_api! { pub recipient: InvitationRecipient, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/membership/join_room_by_id.rs b/ruma-client-api/src/r0/membership/join_room_by_id.rs index 340a677c..be791aef 100644 --- a/ruma-client-api/src/r0/membership/join_room_by_id.rs +++ b/ruma-client-api/src/r0/membership/join_room_by_id.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use super::ThirdPartySigned; ruma_api! { - metadata { + metadata: { description: "Join a room using its ID.", method: POST, name: "join_room_by_id", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room where the user should be invited. #[ruma_api(path)] pub room_id: RoomId, @@ -26,7 +26,7 @@ ruma_api! { pub third_party_signed: Option, } - response { + response: { /// The room that the user joined. pub room_id: RoomId, } diff --git a/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs b/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs index 91ecda4e..030fded6 100644 --- a/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs +++ b/ruma-client-api/src/r0/membership/join_room_by_id_or_alias.rs @@ -6,7 +6,7 @@ use ruma_identifiers::{RoomId, RoomIdOrAliasId}; use super::ThirdPartySigned; ruma_api! { - metadata { + metadata: { description: "Join a room using its ID or one of its aliases.", method: POST, name: "join_room_by_id_or_alias", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room where the user should be invited. #[ruma_api(path)] pub room_id_or_alias: RoomIdOrAliasId, @@ -32,7 +32,7 @@ ruma_api! { pub third_party_signed: Option, } - response { + response: { /// The room that the user joined. pub room_id: RoomId, } diff --git a/ruma-client-api/src/r0/membership/joined_members.rs b/ruma-client-api/src/r0/membership/joined_members.rs index dfd92cbc..adc7dc77 100644 --- a/ruma-client-api/src/r0/membership/joined_members.rs +++ b/ruma-client-api/src/r0/membership/joined_members.rs @@ -7,7 +7,7 @@ use ruma_identifiers::{RoomId, UserId}; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Get a map of user ids to member info objects for members of the room. Primarily for use in Application Services.", method: GET, name: "joined_members", @@ -16,13 +16,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to get the members of. #[ruma_api(path)] pub room_id: RoomId, } - response { + response: { /// A list of the rooms the user is in, i.e. /// the ID of each room in which the user has joined membership. pub joined: BTreeMap, diff --git a/ruma-client-api/src/r0/membership/joined_rooms.rs b/ruma-client-api/src/r0/membership/joined_rooms.rs index f3ec413c..3bf0a6ad 100644 --- a/ruma-client-api/src/r0/membership/joined_rooms.rs +++ b/ruma-client-api/src/r0/membership/joined_rooms.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomId; ruma_api! { - metadata { + metadata: { description: "Get a list of the user's current rooms.", method: GET, name: "joined_rooms", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// A list of the rooms the user is in, i.e. the ID of each room in /// which the user has joined membership. pub joined_rooms: Vec, diff --git a/ruma-client-api/src/r0/membership/kick_user.rs b/ruma-client-api/src/r0/membership/kick_user.rs index f6c5da5b..19a15639 100644 --- a/ruma-client-api/src/r0/membership/kick_user.rs +++ b/ruma-client-api/src/r0/membership/kick_user.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Kick a user from a room.", method: POST, name: "kick_user", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to kick the user from. #[ruma_api(path)] pub room_id: RoomId, @@ -26,7 +26,7 @@ ruma_api! { pub reason: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/membership/leave_room.rs b/ruma-client-api/src/r0/membership/leave_room.rs index c0227806..99a22b12 100644 --- a/ruma-client-api/src/r0/membership/leave_room.rs +++ b/ruma-client-api/src/r0/membership/leave_room.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomId; ruma_api! { - metadata { + metadata: { description: "Leave a room.", method: POST, name: "leave_room", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to leave. #[ruma_api(path)] pub room_id: RoomId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/membership/unban_user.rs b/ruma-client-api/src/r0/membership/unban_user.rs index b754b701..ba1d6eab 100644 --- a/ruma-client-api/src/r0/membership/unban_user.rs +++ b/ruma-client-api/src/r0/membership/unban_user.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Unban a user from a room.", method: POST, name: "unban_user", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to unban the user from. #[ruma_api(path)] pub room_id: RoomId, @@ -22,7 +22,7 @@ ruma_api! { pub user_id: UserId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/message/create_message_event.rs b/ruma-client-api/src/r0/message/create_message_event.rs index d223bc65..5a4c20de 100644 --- a/ruma-client-api/src/r0/message/create_message_event.rs +++ b/ruma-client-api/src/r0/message/create_message_event.rs @@ -6,7 +6,7 @@ use ruma_identifiers::{EventId, RoomId}; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Send a message event to a room.", method: PUT, name: "create_message_event", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to send the event to. #[ruma_api(path)] pub room_id: RoomId, @@ -39,7 +39,7 @@ ruma_api! { pub data: Box, } - response { + response: { /// A unique identifier for the event. pub event_id: EventId, } diff --git a/ruma-client-api/src/r0/message/get_message_events.rs b/ruma-client-api/src/r0/message/get_message_events.rs index 9779a8df..1eeb9ac5 100644 --- a/ruma-client-api/src/r0/message/get_message_events.rs +++ b/ruma-client-api/src/r0/message/get_message_events.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use crate::r0::filter::RoomEventFilter; ruma_api! { - metadata { + metadata: { description: "Get message events for a room.", method: GET, name: "get_message_events", @@ -18,7 +18,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to get events from. #[ruma_api(path)] pub room_id: RoomId, @@ -61,7 +61,7 @@ ruma_api! { pub filter: Option, } - response { + response: { /// The token the pagination starts from. #[serde(skip_serializing_if = "Option::is_none")] pub start: Option, diff --git a/ruma-client-api/src/r0/presence/get_presence.rs b/ruma-client-api/src/r0/presence/get_presence.rs index bb7184c2..d796bd65 100644 --- a/ruma-client-api/src/r0/presence/get_presence.rs +++ b/ruma-client-api/src/r0/presence/get_presence.rs @@ -7,7 +7,7 @@ use ruma_events::presence::PresenceState; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Get presence status for this user.", method: GET, name: "get_presence", @@ -16,13 +16,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user whose presence state will be retrieved. #[ruma_api(path)] pub user_id: UserId, } - response { + response: { /// The state message for this user if one was set. #[serde(skip_serializing_if = "Option::is_none")] pub status_msg: Option, diff --git a/ruma-client-api/src/r0/presence/set_presence.rs b/ruma-client-api/src/r0/presence/set_presence.rs index 4d3636f8..19b10659 100644 --- a/ruma-client-api/src/r0/presence/set_presence.rs +++ b/ruma-client-api/src/r0/presence/set_presence.rs @@ -5,7 +5,7 @@ use ruma_events::presence::PresenceState; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Set presence status for this user.", method: PUT, name: "set_presence", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user whose presence state will be updated. #[ruma_api(path)] pub user_id: UserId, @@ -27,7 +27,7 @@ ruma_api! { pub status_msg: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/profile/get_avatar_url.rs b/ruma-client-api/src/r0/profile/get_avatar_url.rs index 6a950c01..504c02a4 100644 --- a/ruma-client-api/src/r0/profile/get_avatar_url.rs +++ b/ruma-client-api/src/r0/profile/get_avatar_url.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Get the avatar URL of a user.", method: GET, name: "get_avatar_url", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The user whose avatar URL will be retrieved. #[ruma_api(path)] pub user_id: UserId } - response { + response: { /// The user's avatar URL, if set. #[serde(skip_serializing_if = "Option::is_none")] pub avatar_url: Option diff --git a/ruma-client-api/src/r0/profile/get_display_name.rs b/ruma-client-api/src/r0/profile/get_display_name.rs index d864cb60..87d4c0bf 100644 --- a/ruma-client-api/src/r0/profile/get_display_name.rs +++ b/ruma-client-api/src/r0/profile/get_display_name.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Get the display name of a user.", method: GET, name: "get_display_name", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The user whose display name will be retrieved. #[ruma_api(path)] pub user_id: UserId } - response { + response: { /// The user's display name, if set. #[serde(skip_serializing_if = "Option::is_none")] pub displayname: Option diff --git a/ruma-client-api/src/r0/profile/get_profile.rs b/ruma-client-api/src/r0/profile/get_profile.rs index 5bdb781e..77957740 100644 --- a/ruma-client-api/src/r0/profile/get_profile.rs +++ b/ruma-client-api/src/r0/profile/get_profile.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Get all profile information of an user.", method: GET, name: "get_profile", @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The user whose profile will be retrieved. #[ruma_api(path)] pub user_id: UserId, } - response { + response: { /// The user's avatar URL, if set. #[serde(skip_serializing_if = "Option::is_none")] pub avatar_url: Option, diff --git a/ruma-client-api/src/r0/profile/set_avatar_url.rs b/ruma-client-api/src/r0/profile/set_avatar_url.rs index b6d6064e..8b7ba642 100644 --- a/ruma-client-api/src/r0/profile/set_avatar_url.rs +++ b/ruma-client-api/src/r0/profile/set_avatar_url.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Set the avatar URL of the user.", method: PUT, name: "set_avatar_url", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user whose avatar URL will be set. #[ruma_api(path)] pub user_id: UserId, @@ -24,7 +24,7 @@ ruma_api! { pub avatar_url: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/profile/set_display_name.rs b/ruma-client-api/src/r0/profile/set_display_name.rs index 147740df..b9a2ed15 100644 --- a/ruma-client-api/src/r0/profile/set_display_name.rs +++ b/ruma-client-api/src/r0/profile/set_display_name.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::UserId; ruma_api! { - metadata { + metadata: { description: "Set the display name of the user.", method: PUT, name: "set_display_name", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user whose display name will be set. #[ruma_api(path)] pub user_id: UserId, @@ -23,7 +23,7 @@ ruma_api! { pub displayname: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/push/delete_pushrule.rs b/ruma-client-api/src/r0/push/delete_pushrule.rs index a5a35377..61d95f79 100644 --- a/ruma-client-api/src/r0/push/delete_pushrule.rs +++ b/ruma-client-api/src/r0/push/delete_pushrule.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::RuleKind; ruma_api! { - metadata { + metadata: { description: "This endpoint removes the push rule defined in the path.", method: DELETE, name: "delete_pushrule", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to delete from. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -28,7 +28,7 @@ ruma_api! { pub rule_id: String, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/push/get_notifications.rs b/ruma-client-api/src/r0/push/get_notifications.rs index f7e07b9d..8be8da8a 100644 --- a/ruma-client-api/src/r0/push/get_notifications.rs +++ b/ruma-client-api/src/r0/push/get_notifications.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use super::Action; ruma_api! { - metadata { + metadata: { description: "Paginate through the list of events that the user has been, or would have been notified about.", method: GET, name: "get_notifications", @@ -20,7 +20,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Pagination token given to retrieve the next set of events. #[ruma_api(query)] #[serde(skip_serializing_if = "Option::is_none")] @@ -38,7 +38,7 @@ ruma_api! { pub only: Option } - response { + response: { /// The token to supply in the from param of the next /notifications request in order /// to request more events. If this is absent, there are no more results. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/ruma-client-api/src/r0/push/get_pushers.rs b/ruma-client-api/src/r0/push/get_pushers.rs index 729a62e7..12bace50 100644 --- a/ruma-client-api/src/r0/push/get_pushers.rs +++ b/ruma-client-api/src/r0/push/get_pushers.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::Pusher; ruma_api! { - metadata { + metadata: { description: "Gets all currently active pushers for the authenticated user.", method: GET, name: "get_pushers", @@ -14,9 +14,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// An array containing the current pushers for the user. pub pushers: Vec } diff --git a/ruma-client-api/src/r0/push/get_pushrule.rs b/ruma-client-api/src/r0/push/get_pushrule.rs index 482e8dd5..ad320350 100644 --- a/ruma-client-api/src/r0/push/get_pushrule.rs +++ b/ruma-client-api/src/r0/push/get_pushrule.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::{PushRule, RuleKind}; ruma_api! { - metadata { + metadata: { description: "Retrieve a single specified push rule.", method: GET, name: "get_pushrule", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to fetch rules from. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -28,7 +28,7 @@ ruma_api! { pub rule_id: String, } - response { + response: { /// The specific push rule. #[ruma_api(body)] pub rule: PushRule diff --git a/ruma-client-api/src/r0/push/get_pushrule_actions.rs b/ruma-client-api/src/r0/push/get_pushrule_actions.rs index 0fd7b048..f7752cf0 100644 --- a/ruma-client-api/src/r0/push/get_pushrule_actions.rs +++ b/ruma-client-api/src/r0/push/get_pushrule_actions.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::{Action, RuleKind}; ruma_api! { - metadata { + metadata: { description: "This endpoint get the actions for the specified push rule.", method: GET, name: "get_pushrule_actions", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to fetch a rule from. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -28,7 +28,7 @@ ruma_api! { pub rule_id: String, } - response { + response: { /// The actions to perform for this rule. pub actions: Vec } diff --git a/ruma-client-api/src/r0/push/get_pushrule_enabled.rs b/ruma-client-api/src/r0/push/get_pushrule_enabled.rs index ae9fcfbf..61230db7 100644 --- a/ruma-client-api/src/r0/push/get_pushrule_enabled.rs +++ b/ruma-client-api/src/r0/push/get_pushrule_enabled.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::RuleKind; ruma_api! { - metadata { + metadata: { description: "This endpoint gets whether the specified push rule is enabled.", method: GET, name: "get_pushrule_enabled", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to fetch a rule from. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -28,7 +28,7 @@ ruma_api! { pub rule_id: String, } - response { + response: { /// Whether the push rule is enabled or not. pub enabled: bool } diff --git a/ruma-client-api/src/r0/push/get_pushrules_all.rs b/ruma-client-api/src/r0/push/get_pushrules_all.rs index d485689d..9e942d92 100644 --- a/ruma-client-api/src/r0/push/get_pushrules_all.rs +++ b/ruma-client-api/src/r0/push/get_pushrules_all.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_common::push::Ruleset; ruma_api! { - metadata { + metadata: { description: "Retrieve all push rulesets for this user.", method: GET, name: "get_pushrules_all", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// The global ruleset pub global: Ruleset, } diff --git a/ruma-client-api/src/r0/push/get_pushrules_global_scope.rs b/ruma-client-api/src/r0/push/get_pushrules_global_scope.rs index 0a5bac76..430cb992 100644 --- a/ruma-client-api/src/r0/push/get_pushrules_global_scope.rs +++ b/ruma-client-api/src/r0/push/get_pushrules_global_scope.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_common::push::Ruleset; ruma_api! { - metadata { + metadata: { description: "Retrieve all push rulesets in the global scope for this user.", method: GET, name: "get_pushrules_global_scope", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// The global ruleset. #[ruma_api(body)] pub global: Ruleset, diff --git a/ruma-client-api/src/r0/push/set_pusher.rs b/ruma-client-api/src/r0/push/set_pusher.rs index 17c90599..1987bf5a 100644 --- a/ruma-client-api/src/r0/push/set_pusher.rs +++ b/ruma-client-api/src/r0/push/set_pusher.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::Pusher; ruma_api! { - metadata { + metadata: { description: "This endpoint allows the creation, modification and deletion of pushers for this user ID.", method: POST, name: "set_pusher", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The pusher to configure #[serde(flatten)] pub pusher: Pusher, @@ -26,7 +26,7 @@ ruma_api! { } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/push/set_pushrule.rs b/ruma-client-api/src/r0/push/set_pushrule.rs index f1066c3f..517ebce9 100644 --- a/ruma-client-api/src/r0/push/set_pushrule.rs +++ b/ruma-client-api/src/r0/push/set_pushrule.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::{Action, PushCondition, RuleKind}; ruma_api! { - metadata { + metadata: { description: "This endpoint allows the creation, modification and deletion of pushers for this user ID.", method: PUT, name: "set_pushrule", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to set the rule in. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -48,7 +48,7 @@ ruma_api! { pub pattern: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/push/set_pushrule_actions.rs b/ruma-client-api/src/r0/push/set_pushrule_actions.rs index d3088b63..4d1e75f3 100644 --- a/ruma-client-api/src/r0/push/set_pushrule_actions.rs +++ b/ruma-client-api/src/r0/push/set_pushrule_actions.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::{Action, RuleKind}; ruma_api! { - metadata { + metadata: { description: "This endpoint allows clients to change the actions of a push rule. This can be used to change the actions of builtin rules.", method: PUT, name: "set_pushrule_actions", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to fetch a rule from. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -31,7 +31,7 @@ ruma_api! { pub actions: Vec } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/push/set_pushrule_enabled.rs b/ruma-client-api/src/r0/push/set_pushrule_enabled.rs index d0a04002..51e1e435 100644 --- a/ruma-client-api/src/r0/push/set_pushrule_enabled.rs +++ b/ruma-client-api/src/r0/push/set_pushrule_enabled.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::RuleKind; ruma_api! { - metadata { + metadata: { description: "This endpoint allows clients to enable or disable the specified push rule.", method: PUT, name: "set_pushrule_enabled", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The scope to fetch a rule from. 'global' to specify global rules. #[ruma_api(path)] pub scope: String, @@ -31,7 +31,7 @@ ruma_api! { pub enabled: bool } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/read_marker/set_read_marker.rs b/ruma-client-api/src/r0/read_marker/set_read_marker.rs index 5ef38743..b9de5182 100644 --- a/ruma-client-api/src/r0/read_marker/set_read_marker.rs +++ b/ruma-client-api/src/r0/read_marker/set_read_marker.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{EventId, RoomId}; ruma_api! { - metadata { + metadata: { description: "Sets the position of the read marker for a given room, and optionally the read receipt's location.", method: POST, name: "set_read_marker", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room ID to set the read marker in for the user. #[ruma_api(path)] pub room_id: RoomId, @@ -31,7 +31,7 @@ ruma_api! { } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/receipt/create_receipt.rs b/ruma-client-api/src/r0/receipt/create_receipt.rs index 0b4b25e7..8a716d7b 100644 --- a/ruma-client-api/src/r0/receipt/create_receipt.rs +++ b/ruma-client-api/src/r0/receipt/create_receipt.rs @@ -7,7 +7,7 @@ use ruma_identifiers::{EventId, RoomId}; use strum::{Display, EnumString}; ruma_api! { - metadata { + metadata: { description: "Send a receipt event to a room.", method: POST, name: "create_receipt", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room in which to send the event. #[ruma_api(path)] pub room_id: RoomId, @@ -30,7 +30,7 @@ ruma_api! { pub event_id: EventId, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/redact/redact_event.rs b/ruma-client-api/src/r0/redact/redact_event.rs index 30bc294b..ca1bf3ca 100644 --- a/ruma-client-api/src/r0/redact/redact_event.rs +++ b/ruma-client-api/src/r0/redact/redact_event.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{EventId, RoomId}; ruma_api! { - metadata { + metadata: { description: "Redact an event, stripping all information not critical to the event graph integrity.", method: PUT, name: "redact_event", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The ID of the room of the event to redact. #[ruma_api(path)] pub room_id: RoomId, @@ -33,7 +33,7 @@ ruma_api! { pub reason: Option, } - response { + response: { /// The ID of the redacted event. pub event_id: EventId, } diff --git a/ruma-client-api/src/r0/room/create_room.rs b/ruma-client-api/src/r0/room/create_room.rs index b05462d2..ce842692 100644 --- a/ruma-client-api/src/r0/room/create_room.rs +++ b/ruma-client-api/src/r0/room/create_room.rs @@ -16,7 +16,7 @@ use super::Visibility; use crate::r0::membership::Invite3pid; ruma_api! { - metadata { + metadata: { description: "Create a new room.", method: POST, name: "create_room", @@ -25,7 +25,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Extra keys to be added to the content of the `m.room.create`. #[serde(skip_serializing_if = "Option::is_none")] pub creation_content: Option, @@ -84,7 +84,7 @@ ruma_api! { pub visibility: Option, } - response { + response: { /// The created room's ID. pub room_id: RoomId, } diff --git a/ruma-client-api/src/r0/room/get_room_event.rs b/ruma-client-api/src/r0/room/get_room_event.rs index 8ff6afe9..3371f797 100644 --- a/ruma-client-api/src/r0/room/get_room_event.rs +++ b/ruma-client-api/src/r0/room/get_room_event.rs @@ -5,7 +5,7 @@ use ruma_events::{AnyRoomEvent, EventJson}; use ruma_identifiers::{EventId, RoomId}; ruma_api! { - metadata { + metadata: { description: "Get a single event based on roomId/eventId", method: GET, name: "get_room_event", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The ID of the room the event is in. #[ruma_api(path)] pub room_id: RoomId, @@ -24,7 +24,7 @@ ruma_api! { pub event_id: EventId, } - response { + response: { /// Arbitrary JSON of the event body. Returns both room and state events. #[ruma_api(body)] pub event: EventJson, diff --git a/ruma-client-api/src/r0/room/report_content.rs b/ruma-client-api/src/r0/room/report_content.rs index 690e3d03..42325387 100644 --- a/ruma-client-api/src/r0/room/report_content.rs +++ b/ruma-client-api/src/r0/room/report_content.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{EventId, RoomId}; ruma_api! { - metadata { + metadata: { description: "Report content as inappropriate.", method: POST, name: "report_content", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Room in which the event to be reported is located. #[ruma_api(path)] pub room_id: RoomId, @@ -30,7 +30,7 @@ ruma_api! { pub reason: String, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/room/upgrade_room.rs b/ruma-client-api/src/r0/room/upgrade_room.rs index 58e7e925..17832349 100644 --- a/ruma-client-api/src/r0/room/upgrade_room.rs +++ b/ruma-client-api/src/r0/room/upgrade_room.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomId; ruma_api! { - metadata { + metadata: { description: "Upgrades a room to a particular version.", method: POST, name: "upgrade_room", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// ID of the room to be upgraded. #[ruma_api(path)] pub room_id: RoomId, @@ -22,7 +22,7 @@ ruma_api! { pub new_version: String, } - response { + response: { /// ID of the new room. pub replacement_room: RoomId, } diff --git a/ruma-client-api/src/r0/search/search_events.rs b/ruma-client-api/src/r0/search/search_events.rs index 988dd157..57b30aec 100644 --- a/ruma-client-api/src/r0/search/search_events.rs +++ b/ruma-client-api/src/r0/search/search_events.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use crate::r0::filter::RoomEventFilter; ruma_api! { - metadata { + metadata: { description: "Search events.", method: POST, name: "search", @@ -20,7 +20,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The point to return events from. /// /// If given, this should be a `next_batch` result from a previous call to this endpoint. @@ -31,7 +31,7 @@ ruma_api! { pub search_categories: Categories, } - response { + response: { /// A grouping of search results by category. pub search_categories: ResultCategories, } diff --git a/ruma-client-api/src/r0/server/get_user_info.rs b/ruma-client-api/src/r0/server/get_user_info.rs index 4f00ddd8..02a2367b 100644 --- a/ruma-client-api/src/r0/server/get_user_info.rs +++ b/ruma-client-api/src/r0/server/get_user_info.rs @@ -7,7 +7,7 @@ use ruma_identifiers::UserId; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Get information about a particular user.", method: GET, name: "get_user_info", @@ -16,13 +16,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user to look up. #[ruma_api(path)] pub user_id: UserId, } - response { + response: { /// The Matrix user ID of the user. #[serde(skip_serializing_if = "Option::is_none")] pub user_id: Option, diff --git a/ruma-client-api/src/r0/session/get_login_types.rs b/ruma-client-api/src/r0/session/get_login_types.rs index 0e30d789..4447d359 100644 --- a/ruma-client-api/src/r0/session/get_login_types.rs +++ b/ruma-client-api/src/r0/session/get_login_types.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Gets the homeserver's supported login types to authenticate users. Clients should pick one of these and supply it as the type when logging in.", method: GET, name: "get_login_types", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: false, } - request {} + request: {} - response { + response: { /// The homeserver's supported login types. pub flows: Vec } diff --git a/ruma-client-api/src/r0/session/login.rs b/ruma-client-api/src/r0/session/login.rs index 16a1a3ca..4082566c 100644 --- a/ruma-client-api/src/r0/session/login.rs +++ b/ruma-client-api/src/r0/session/login.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use crate::r0::thirdparty::Medium; ruma_api! { - metadata { + metadata: { description: "Login to the homeserver.", method: POST, name: "login", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// Identification information for the user. #[serde(flatten)] pub user: UserInfo, @@ -35,7 +35,7 @@ ruma_api! { pub initial_device_display_name: Option, } - response { + response: { /// The fully-qualified Matrix ID that has been registered. pub user_id: UserId, diff --git a/ruma-client-api/src/r0/session/logout.rs b/ruma-client-api/src/r0/session/logout.rs index f3bd75e4..bc3f6067 100644 --- a/ruma-client-api/src/r0/session/logout.rs +++ b/ruma-client-api/src/r0/session/logout.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Log out of the homeserver.", method: POST, name: "logout", @@ -12,9 +12,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/session/logout_all.rs b/ruma-client-api/src/r0/session/logout_all.rs index afc20fe1..5a92adda 100644 --- a/ruma-client-api/src/r0/session/logout_all.rs +++ b/ruma-client-api/src/r0/session/logout_all.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Invalidates all access tokens for a user, so that they can no longer be used for authorization.", method: POST, name: "logout_all", @@ -12,9 +12,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/session/sso_login.rs b/ruma-client-api/src/r0/session/sso_login.rs index b043698d..6e740112 100644 --- a/ruma-client-api/src/r0/session/sso_login.rs +++ b/ruma-client-api/src/r0/session/sso_login.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "", method: GET, name: "sso_login", @@ -13,14 +13,14 @@ ruma_api! { } - request { + request: { /// URL to which the homeserver should return the user after completing /// authentication with the SSO identity provider. #[ruma_api(query)] pub redirect_url: String, } - response { + response: { /// Redirect URL to the SSO identity provider. #[ruma_api(header = LOCATION)] pub location: String, diff --git a/ruma-client-api/src/r0/state/create_state_event_for_empty_key.rs b/ruma-client-api/src/r0/state/create_state_event_for_empty_key.rs index e1cf1e87..5ec6ce9e 100644 --- a/ruma-client-api/src/r0/state/create_state_event_for_empty_key.rs +++ b/ruma-client-api/src/r0/state/create_state_event_for_empty_key.rs @@ -6,7 +6,7 @@ use ruma_identifiers::{EventId, RoomId}; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Send a state event to a room associated with the empty state key.", method: PUT, name: "create_state_event_for_empty_key", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to set the state in. #[ruma_api(path)] pub room_id: RoomId, @@ -31,7 +31,7 @@ ruma_api! { pub data: Box, } - response { + response: { /// A unique identifier for the event. pub event_id: EventId, } diff --git a/ruma-client-api/src/r0/state/create_state_event_for_key.rs b/ruma-client-api/src/r0/state/create_state_event_for_key.rs index e6c96883..b3fad18b 100644 --- a/ruma-client-api/src/r0/state/create_state_event_for_key.rs +++ b/ruma-client-api/src/r0/state/create_state_event_for_key.rs @@ -6,7 +6,7 @@ use ruma_identifiers::{EventId, RoomId}; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Send a state event to a room associated with a given state key.", method: PUT, name: "create_state_event_for_key", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to set the state in. #[ruma_api(path)] pub room_id: RoomId, @@ -35,7 +35,7 @@ ruma_api! { pub data: Box, } - response { + response: { /// A unique identifier for the event. pub event_id: EventId, } diff --git a/ruma-client-api/src/r0/state/get_state_events.rs b/ruma-client-api/src/r0/state/get_state_events.rs index 54202e53..f2a23930 100644 --- a/ruma-client-api/src/r0/state/get_state_events.rs +++ b/ruma-client-api/src/r0/state/get_state_events.rs @@ -5,7 +5,7 @@ use ruma_events::{AnyStateEvent, EventJson}; use ruma_identifiers::RoomId; ruma_api! { - metadata { + metadata: { description: "Get state events for a room.", method: GET, name: "get_state_events", @@ -14,13 +14,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to look up the state for. #[ruma_api(path)] pub room_id: RoomId, } - response { + response: { /// If the user is a member of the room this will be the current state of the room as a /// list of events. If the user has left the room then this will be the state of the /// room when they left as a list of events. diff --git a/ruma-client-api/src/r0/state/get_state_events_for_empty_key.rs b/ruma-client-api/src/r0/state/get_state_events_for_empty_key.rs index c9400be0..b6f34ae8 100644 --- a/ruma-client-api/src/r0/state/get_state_events_for_empty_key.rs +++ b/ruma-client-api/src/r0/state/get_state_events_for_empty_key.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Get state events of a given type associated with the empty key.", method: GET, name: "get_state_events_for_empty_key", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to look up the state for. #[ruma_api(path)] pub room_id: RoomId, @@ -25,7 +25,7 @@ ruma_api! { pub event_type: EventType, } - response { + response: { /// The content of the state event. /// /// To create a `Box`, use `serde_json::value::to_raw_value`. diff --git a/ruma-client-api/src/r0/state/get_state_events_for_key.rs b/ruma-client-api/src/r0/state/get_state_events_for_key.rs index ad30024a..fe5feddd 100644 --- a/ruma-client-api/src/r0/state/get_state_events_for_key.rs +++ b/ruma-client-api/src/r0/state/get_state_events_for_key.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomId; use serde_json::value::RawValue as RawJsonValue; ruma_api! { - metadata { + metadata: { description: "Get state events associated with a given key.", method: GET, name: "get_state_events_for_key", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room to look up the state for. #[ruma_api(path)] pub room_id: RoomId, @@ -29,7 +29,7 @@ ruma_api! { pub state_key: String, } - response { + response: { /// The content of the state event. #[ruma_api(body)] pub content: Box, diff --git a/ruma-client-api/src/r0/sync/sync_events.rs b/ruma-client-api/src/r0/sync/sync_events.rs index aec9bfec..da5879b3 100644 --- a/ruma-client-api/src/r0/sync/sync_events.rs +++ b/ruma-client-api/src/r0/sync/sync_events.rs @@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize}; use crate::r0::{filter::FilterDefinition, keys::KeyAlgorithm}; ruma_api! { - metadata { + metadata: { description: "Get all new events from all rooms since the last sync or a given point of time.", method: GET, name: "sync", @@ -24,7 +24,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// A filter represented either as its full JSON definition or the ID of a saved filter. #[serde(skip_serializing_if = "Option::is_none")] #[ruma_api(query)] @@ -58,7 +58,7 @@ ruma_api! { pub timeout: Option, } - response { + response: { /// The batch token to supply in the `since` param of the next `/sync` request. pub next_batch: String, diff --git a/ruma-client-api/src/r0/tag/create_tag.rs b/ruma-client-api/src/r0/tag/create_tag.rs index 36e63af9..8d7b1357 100644 --- a/ruma-client-api/src/r0/tag/create_tag.rs +++ b/ruma-client-api/src/r0/tag/create_tag.rs @@ -5,7 +5,7 @@ use ruma_events::tag::TagInfo; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Add a new tag to a room.", method: PUT, name: "create_tag", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The ID of the user creating the tag. #[ruma_api(path)] pub user_id: UserId, @@ -32,7 +32,7 @@ ruma_api! { pub tag_info: TagInfo, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/tag/delete_tag.rs b/ruma-client-api/src/r0/tag/delete_tag.rs index 5d086ddc..d41766a3 100644 --- a/ruma-client-api/src/r0/tag/delete_tag.rs +++ b/ruma-client-api/src/r0/tag/delete_tag.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Remove a tag from a room.", method: DELETE, name: "delete_tag", @@ -13,7 +13,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user whose tag will be deleted. #[ruma_api(path)] pub user_id: UserId, @@ -27,7 +27,7 @@ ruma_api! { pub tag: String, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/tag/get_tags.rs b/ruma-client-api/src/r0/tag/get_tags.rs index e4e0d40d..aa960fdc 100644 --- a/ruma-client-api/src/r0/tag/get_tags.rs +++ b/ruma-client-api/src/r0/tag/get_tags.rs @@ -5,7 +5,7 @@ use ruma_events::{tag::TagEventContent, EventJson}; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Get the tags associated with a room.", method: GET, name: "get_tags", @@ -14,7 +14,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The user whose tags will be retrieved. #[ruma_api(path)] pub user_id: UserId, @@ -24,7 +24,7 @@ ruma_api! { pub room_id: RoomId, } - response { + response: { /// The user's tags for the room. pub tags: EventJson, } diff --git a/ruma-client-api/src/r0/thirdparty/get_location_for_protocol.rs b/ruma-client-api/src/r0/thirdparty/get_location_for_protocol.rs index d3aab76d..f624c140 100644 --- a/ruma-client-api/src/r0/thirdparty/get_location_for_protocol.rs +++ b/ruma-client-api/src/r0/thirdparty/get_location_for_protocol.rs @@ -7,7 +7,7 @@ use ruma_api::ruma_api; use super::Location; ruma_api! { - metadata { + metadata: { description: "Fetches third party locations for a protocol.", method: GET, name: "get_location_for_protocol", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The protocol used to communicate to the third party network. #[ruma_api(path)] pub protocol: String, @@ -27,7 +27,7 @@ ruma_api! { pub fields: BTreeMap, } - response { + response: { /// List of matched third party locations. #[ruma_api(body)] pub locations: Vec, diff --git a/ruma-client-api/src/r0/thirdparty/get_location_for_room_alias.rs b/ruma-client-api/src/r0/thirdparty/get_location_for_room_alias.rs index b1038afc..7b88a7d6 100644 --- a/ruma-client-api/src/r0/thirdparty/get_location_for_room_alias.rs +++ b/ruma-client-api/src/r0/thirdparty/get_location_for_room_alias.rs @@ -6,7 +6,7 @@ use ruma_identifiers::RoomAliasId; use super::Location; ruma_api! { - metadata { + metadata: { description: "Retrieve an array of third party network locations from a Matrix room alias.", method: GET, name: "get_location_for_room_alias", @@ -15,13 +15,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The Matrix room alias to look up. #[ruma_api(query)] pub alias: RoomAliasId, } - response { + response: { /// List of matched third party locations. #[ruma_api(body)] pub locations: Vec, diff --git a/ruma-client-api/src/r0/thirdparty/get_protocol.rs b/ruma-client-api/src/r0/thirdparty/get_protocol.rs index 61cf67fb..3b3ee33d 100644 --- a/ruma-client-api/src/r0/thirdparty/get_protocol.rs +++ b/ruma-client-api/src/r0/thirdparty/get_protocol.rs @@ -5,7 +5,7 @@ use ruma_api::ruma_api; use super::Protocol; ruma_api! { - metadata { + metadata: { description: "Fetches the metadata from the homeserver about a particular third party protocol.", method: GET, name: "get_protocol", @@ -14,13 +14,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The name of the protocol. #[ruma_api(path)] pub protocol: String, } - response { + response: { /// Metadata about the protocol. #[ruma_api(body)] pub protocol: Protocol, diff --git a/ruma-client-api/src/r0/thirdparty/get_protocols.rs b/ruma-client-api/src/r0/thirdparty/get_protocols.rs index aad510f1..b006cc38 100644 --- a/ruma-client-api/src/r0/thirdparty/get_protocols.rs +++ b/ruma-client-api/src/r0/thirdparty/get_protocols.rs @@ -7,7 +7,7 @@ use ruma_api::ruma_api; use super::Protocol; ruma_api! { - metadata { + metadata: { description: "Fetches the overall metadata about protocols supported by the homeserver.", method: GET, name: "get_protocols", @@ -16,9 +16,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// Metadata about protocols supported by the homeserver. #[ruma_api(body)] pub protocols: BTreeMap, diff --git a/ruma-client-api/src/r0/thirdparty/get_user_for_protocol.rs b/ruma-client-api/src/r0/thirdparty/get_user_for_protocol.rs index 424c4c82..02e125c9 100644 --- a/ruma-client-api/src/r0/thirdparty/get_user_for_protocol.rs +++ b/ruma-client-api/src/r0/thirdparty/get_user_for_protocol.rs @@ -7,7 +7,7 @@ use ruma_api::ruma_api; use super::User; ruma_api! { - metadata { + metadata: { description: "Fetches third party users for a protocol.", method: GET, name: "get_user_for_protocol", @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The protocol used to communicate to the third party network. #[ruma_api(path)] pub protocol: String, @@ -27,7 +27,7 @@ ruma_api! { pub fields: BTreeMap, } - response { + response: { /// List of matched third party users. #[ruma_api(body)] pub users: Vec, diff --git a/ruma-client-api/src/r0/thirdparty/get_user_for_user_id.rs b/ruma-client-api/src/r0/thirdparty/get_user_for_user_id.rs index 476f69c3..52aeca2d 100644 --- a/ruma-client-api/src/r0/thirdparty/get_user_for_user_id.rs +++ b/ruma-client-api/src/r0/thirdparty/get_user_for_user_id.rs @@ -6,7 +6,7 @@ use ruma_identifiers::UserId; use super::User; ruma_api! { - metadata { + metadata: { description: "Retrieve an array of third party users from a Matrix User ID.", method: GET, name: "get_user_for_user_id", @@ -15,13 +15,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The Matrix User ID to look up. #[ruma_api(query)] pub userid: UserId, } - response { + response: { /// List of matched third party users. #[ruma_api(body)] pub users: Vec, diff --git a/ruma-client-api/src/r0/to_device/send_event_to_device.rs b/ruma-client-api/src/r0/to_device/send_event_to_device.rs index f84a33ab..24207bae 100644 --- a/ruma-client-api/src/r0/to_device/send_event_to_device.rs +++ b/ruma-client-api/src/r0/to_device/send_event_to_device.rs @@ -10,7 +10,7 @@ use serde_json::value::RawValue as RawJsonValue; use super::DeviceIdOrAllDevices; ruma_api! { - metadata { + metadata: { description: "Send an event to a device or devices.", method: PUT, name: "send_event_to_device", @@ -19,7 +19,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Type of event being sent to each device. #[ruma_api(path)] pub event_type: EventType, @@ -37,7 +37,7 @@ ruma_api! { pub messages: BTreeMap>> } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/typing/create_typing_event.rs b/ruma-client-api/src/r0/typing/create_typing_event.rs index 23f245ff..b1e60f94 100644 --- a/ruma-client-api/src/r0/typing/create_typing_event.rs +++ b/ruma-client-api/src/r0/typing/create_typing_event.rs @@ -6,7 +6,7 @@ use ruma_api::ruma_api; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { method: PUT, path: "/_matrix/client/r0/rooms/:room_id/typing/:user_id", name: "create_typing_event", @@ -15,7 +15,7 @@ ruma_api! { rate_limited: true, } - request { + request: { /// The user who has started to type. #[ruma_api(path)] pub user_id: UserId, @@ -38,7 +38,7 @@ ruma_api! { pub timeout: Option, } - response {} + response: {} error: crate::Error } diff --git a/ruma-client-api/src/r0/user_directory/search_users.rs b/ruma-client-api/src/r0/user_directory/search_users.rs index 96842259..71f763c8 100644 --- a/ruma-client-api/src/r0/user_directory/search_users.rs +++ b/ruma-client-api/src/r0/user_directory/search_users.rs @@ -6,7 +6,7 @@ use ruma_identifiers::UserId; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Performs a search for users.", method: POST, name: "search_users", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The term to search for. pub search_term: String, @@ -26,7 +26,7 @@ ruma_api! { pub limit: Option, } - response { + response: { /// Ordered by rank and then whether or not profile info is available. pub results: Vec, diff --git a/ruma-client-api/src/r0/voip/get_turn_server_info.rs b/ruma-client-api/src/r0/voip/get_turn_server_info.rs index dd056ea6..f2e9cb49 100644 --- a/ruma-client-api/src/r0/voip/get_turn_server_info.rs +++ b/ruma-client-api/src/r0/voip/get_turn_server_info.rs @@ -5,7 +5,7 @@ use std::time::Duration; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Get credentials for the client to use when initiating VoIP calls.", method: GET, name: "turn_server_info", @@ -14,9 +14,9 @@ ruma_api! { requires_authentication: true, } - request {} + request: {} - response { + response: { /// The username to use. pub username: String, diff --git a/ruma-client-api/src/unversioned/discover_homeserver.rs b/ruma-client-api/src/unversioned/discover_homeserver.rs index dee2c267..c184c561 100644 --- a/ruma-client-api/src/unversioned/discover_homeserver.rs +++ b/ruma-client-api/src/unversioned/discover_homeserver.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Get discovery information about the domain.", method: GET, name: "discover_homeserver", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: false, } - request {} + request: {} - response { + response: { /// Information about the homeserver to connect to. #[serde(rename = "m.homeserver")] pub homeserver: HomeserverInfo, diff --git a/ruma-client-api/src/unversioned/get_supported_versions.rs b/ruma-client-api/src/unversioned/get_supported_versions.rs index 9f9f692b..55888634 100644 --- a/ruma-client-api/src/unversioned/get_supported_versions.rs +++ b/ruma-client-api/src/unversioned/get_supported_versions.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Get the versions of the client-server API supported by this homeserver.", method: GET, name: "api_versions", @@ -14,9 +14,9 @@ ruma_api! { requires_authentication: false, } - request {} + request: {} - response { + response: { /// A list of Matrix client API protocol versions supported by the homeserver. pub versions: Vec, diff --git a/ruma-federation-api/src/directory/get_public_rooms/v1.rs b/ruma-federation-api/src/directory/get_public_rooms/v1.rs index c989d008..daf94a2b 100644 --- a/ruma-federation-api/src/directory/get_public_rooms/v1.rs +++ b/ruma-federation-api/src/directory/get_public_rooms/v1.rs @@ -12,7 +12,7 @@ use serde::{ }; ruma_api! { - metadata { + metadata: { description: "Gets all the public rooms for the homeserver.", method: GET, name: "get_public_rooms", @@ -21,7 +21,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The maximum number of rooms to return. Default is no limit. #[serde(skip_serializing_if = "Option::is_none")] #[ruma_api(query)] @@ -36,7 +36,7 @@ ruma_api! { pub room_network: RoomNetwork, } - response { + response: { /// A paginated chunk of public rooms. pub chunk: Vec, /// A pagination token for the response. diff --git a/ruma-federation-api/src/discovery/discover_homeserver.rs b/ruma-federation-api/src/discovery/discover_homeserver.rs index 2d6f386d..3c79d57e 100644 --- a/ruma-federation-api/src/discovery/discover_homeserver.rs +++ b/ruma-federation-api/src/discovery/discover_homeserver.rs @@ -3,7 +3,7 @@ use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Get discovery information about the domain.", method: GET, name: "discover_homeserver", @@ -12,9 +12,9 @@ ruma_api! { requires_authentication: false, } - request {} + request: {} - response { + response: { /// The server name to delegate server-server communciations to, with optional port. #[serde(rename = "m.homeserver")] pub homeserver: String, diff --git a/ruma-federation-api/src/discovery/get_remote_server_keys/v2.rs b/ruma-federation-api/src/discovery/get_remote_server_keys/v2.rs index 3da6f328..00fa1629 100644 --- a/ruma-federation-api/src/discovery/get_remote_server_keys/v2.rs +++ b/ruma-federation-api/src/discovery/get_remote_server_keys/v2.rs @@ -6,7 +6,7 @@ use crate::discovery::ServerKey; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Query for another server's keys.", method: GET, name: "get_remote_server_keys", @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The server's DNS name to query #[ruma_api(path)] pub server_name: String, @@ -31,7 +31,7 @@ ruma_api! { pub minimum_valid_until_ts: SystemTime, } - response { + response: { /// The queried server's keys, signed by the notary server. pub server_keys: Vec, } diff --git a/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs b/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs index 6ec318b1..9c5bbad4 100644 --- a/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs +++ b/ruma-federation-api/src/discovery/get_remote_server_keys_batch/v2.rs @@ -8,7 +8,7 @@ use ruma_identifiers::ServerKeyId; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Query for keys from multiple servers in a batch format.", method: POST, name: "get_remote_server_keys_batch", @@ -17,7 +17,7 @@ ruma_api! { requires_authentication: false, } - request { + request: { /// The query criteria. The outer string key on the object is the server /// name (eg: matrix.org). The inner string key is the Key ID to query /// for the particular server. If no key IDs are given to be queried, @@ -41,7 +41,7 @@ ruma_api! { pub minimum_valid_until_ts: SystemTime, } - response { + response: { /// The queried server's keys, signed by the notary server. pub server_keys: Vec, } diff --git a/ruma-federation-api/src/discovery/get_server_keys/v2.rs b/ruma-federation-api/src/discovery/get_server_keys/v2.rs index ca59ec67..fb4675c6 100644 --- a/ruma-federation-api/src/discovery/get_server_keys/v2.rs +++ b/ruma-federation-api/src/discovery/get_server_keys/v2.rs @@ -4,7 +4,7 @@ use crate::discovery::ServerKey; use ruma_api::ruma_api; ruma_api! { - metadata { + metadata: { description: "Gets the homeserver's published signing keys.", method: GET, name: "get_server_keys", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: false, } - request {} + request: {} - response { + response: { /// Queried server key, signed by the notary server. #[ruma_api(body)] pub server_key: ServerKey, diff --git a/ruma-federation-api/src/discovery/get_server_version/v1.rs b/ruma-federation-api/src/discovery/get_server_version/v1.rs index ea8f2704..96f8b529 100644 --- a/ruma-federation-api/src/discovery/get_server_version/v1.rs +++ b/ruma-federation-api/src/discovery/get_server_version/v1.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use serde::{Deserialize, Serialize}; ruma_api! { - metadata { + metadata: { description: "Get the implementation name and version of this homeserver.", method: GET, name: "discover_homeserver", @@ -13,9 +13,9 @@ ruma_api! { requires_authentication: false, } - request {} + request: {} - response { + response: { /// Information about the homeserver implementation #[serde(skip_serializing_if = "Option::is_none")] pub server: Option, diff --git a/ruma-federation-api/src/membership/create_join_event/v1.rs b/ruma-federation-api/src/membership/create_join_event/v1.rs index 499ce3e9..f60af334 100644 --- a/ruma-federation-api/src/membership/create_join_event/v1.rs +++ b/ruma-federation-api/src/membership/create_join_event/v1.rs @@ -7,7 +7,7 @@ use ruma_identifiers::{EventId, RoomId}; use super::RoomState; ruma_api! { - metadata { + metadata: { description: "Send a join event to a resident server.", name: "create_join_event", method: PUT, @@ -16,7 +16,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room ID that is about to be joined. #[ruma_api(path)] pub room_id: RoomId, @@ -29,7 +29,7 @@ ruma_api! { pub pdu_stub: PduStub, } - response { + response: { /// Full state of the room. #[ruma_api(body)] #[serde(with = "crate::serde::room_state")] diff --git a/ruma-federation-api/src/membership/create_join_event_template/v1.rs b/ruma-federation-api/src/membership/create_join_event_template/v1.rs index d1364928..3642e330 100644 --- a/ruma-federation-api/src/membership/create_join_event_template/v1.rs +++ b/ruma-federation-api/src/membership/create_join_event_template/v1.rs @@ -6,7 +6,7 @@ use ruma_events::{pdu::Pdu, EventJson}; use ruma_identifiers::{RoomId, UserId}; ruma_api! { - metadata { + metadata: { description: "Send a request for a join event template to a resident server.", name: "create_join_event_template", method: GET, @@ -15,7 +15,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// The room ID that is about to be joined. #[ruma_api(path)] pub room_id: RoomId, @@ -28,7 +28,7 @@ ruma_api! { pub ver: Vec, } - response { + response: { /// The version of the room where the server is trying to join. pub room_version: Option, /// An unsigned template event. diff --git a/ruma-federation-api/src/query/get_room_information/v1.rs b/ruma-federation-api/src/query/get_room_information/v1.rs index 77c7219a..2d447a4b 100644 --- a/ruma-federation-api/src/query/get_room_information/v1.rs +++ b/ruma-federation-api/src/query/get_room_information/v1.rs @@ -4,7 +4,7 @@ use ruma_api::ruma_api; use ruma_identifiers::RoomId; ruma_api! { - metadata { + metadata: { description: "Get mapped room ID and resident homeservers for a given room alias.", name: "get_room_information", method: GET, @@ -13,13 +13,13 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// Room alias to query. #[ruma_api(query)] pub room_alias: String, } - response { + response: { /// Room ID mapped to queried alias. pub room_id: RoomId, /// An array of server names that are likely to hold the given room. diff --git a/ruma-federation-api/src/transactions/send_transaction_message/v1.rs b/ruma-federation-api/src/transactions/send_transaction_message/v1.rs index 0bc8f805..11f8273b 100644 --- a/ruma-federation-api/src/transactions/send_transaction_message/v1.rs +++ b/ruma-federation-api/src/transactions/send_transaction_message/v1.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; ruma_api! { - metadata { + metadata: { description: "Send transaction messages to another server", name: "send_transaction_message", method: PUT, @@ -18,7 +18,7 @@ ruma_api! { requires_authentication: true, } - request { + request: { /// A transaction ID unique between sending and receiving homeservers. #[ruma_api(path)] pub transaction_id: String, @@ -42,7 +42,7 @@ ruma_api! { pub edus: Vec, } - response { + response: { /// Map of event IDs and response for each PDU given in the request. #[serde(with = "crate::serde::pdu_process_response")] pub pdus: BTreeMap>,