Whitespace and comment wrapping adjustments
This commit is contained in:
parent
3db0abe4cc
commit
fc626d0869
32
src/error.rs
32
src/error.rs
@ -16,118 +16,147 @@ pub enum ErrorKind {
|
||||
#[serde(rename = "M_FORBIDDEN")]
|
||||
#[strum(to_string = "M_FORBIDDEN")]
|
||||
Forbidden,
|
||||
|
||||
/// M_UNKNOWN_TOKEN
|
||||
#[serde(rename = "M_UNKNOWN_TOKEN")]
|
||||
#[strum(to_string = "M_UNKNOWN_TOKEN")]
|
||||
UnknownToken,
|
||||
|
||||
/// M_MISSING_TOKEN
|
||||
#[serde(rename = "M_MISSING_TOKEN")]
|
||||
#[strum(to_string = "M_MISSING_TOKEN")]
|
||||
MissingToken,
|
||||
|
||||
/// M_BAD_JSON
|
||||
#[serde(rename = "M_BAD_JSON")]
|
||||
#[strum(to_string = "M_BAD_JSON")]
|
||||
BadJson,
|
||||
|
||||
/// M_NOT_JSON
|
||||
#[serde(rename = "M_NOT_JSON")]
|
||||
#[strum(to_string = "M_NOT_JSON")]
|
||||
NotJson,
|
||||
|
||||
/// M_NOT_FOUND
|
||||
#[serde(rename = "M_NOT_FOUND")]
|
||||
#[strum(to_string = "M_NOT_FOUND")]
|
||||
NotFound,
|
||||
|
||||
/// M_LIMIT_EXCEEDED
|
||||
#[serde(rename = "M_LIMIT_EXCEEDED")]
|
||||
#[strum(to_string = "M_LIMIT_EXCEEDED")]
|
||||
LimitExceeded,
|
||||
|
||||
/// M_UNKNOWN
|
||||
#[serde(rename = "M_UNKNOWN")]
|
||||
#[strum(to_string = "M_UNKNOWN")]
|
||||
Unknown,
|
||||
|
||||
/// M_UNRECOGNIZED
|
||||
#[serde(rename = "M_UNRECOGNIZED")]
|
||||
#[strum(to_string = "M_UNRECOGNIZED")]
|
||||
Unrecognized,
|
||||
|
||||
/// M_UNAUTHORIZED
|
||||
#[serde(rename = "M_UNAUTHORIZED")]
|
||||
#[strum(to_string = "M_UNAUTHORIZED")]
|
||||
Unauthorized,
|
||||
|
||||
/// M_USER_DEACTIVATED
|
||||
#[serde(rename = "M_USER_DEACTIVATED")]
|
||||
#[strum(to_string = "M_USER_DEACTIVATED")]
|
||||
UserDeactivated,
|
||||
|
||||
/// M_USER_IN_USE
|
||||
#[serde(rename = "M_USER_IN_USE")]
|
||||
#[strum(to_string = "M_USER_IN_USE")]
|
||||
UserInUse,
|
||||
|
||||
/// M_INVALID_USERNAME
|
||||
#[serde(rename = "M_INVALID_USERNAME")]
|
||||
#[strum(to_string = "M_INVALID_USERNAME")]
|
||||
InvalidUsername,
|
||||
|
||||
/// M_ROOM_IN_USE
|
||||
#[serde(rename = "M_ROOM_IN_USE")]
|
||||
#[strum(to_string = "M_ROOM_IN_USE")]
|
||||
RoomInUse,
|
||||
|
||||
/// M_INVALID_ROOM_STATE
|
||||
#[serde(rename = "M_INVALID_ROOM_STATE")]
|
||||
#[strum(to_string = "M_INVALID_ROOM_STATE")]
|
||||
InvalidRoomState,
|
||||
|
||||
/// M_THREEPID_IN_USE
|
||||
#[serde(rename = "M_THREEPID_IN_USE")]
|
||||
#[strum(to_string = "M_THREEPID_IN_USE")]
|
||||
ThreepidInUse,
|
||||
|
||||
/// M_THREEPID_NOT_FOUND
|
||||
#[serde(rename = "M_THREEPID_NOT_FOUND")]
|
||||
#[strum(to_string = "M_THREEPID_NOT_FOUND")]
|
||||
ThreepidNotFound,
|
||||
|
||||
/// M_THREEPID_AUTH_FAILED
|
||||
#[serde(rename = "M_THREEPID_AUTH_FAILED")]
|
||||
#[strum(to_string = "M_THREEPID_AUTH_FAILED")]
|
||||
ThreepidAuthFailed,
|
||||
|
||||
/// M_THREEPID_DENIED
|
||||
#[serde(rename = "M_THREEPID_DENIED")]
|
||||
#[strum(to_string = "M_THREEPID_DENIED")]
|
||||
ThreepidDenied,
|
||||
|
||||
/// M_SERVER_NOT_TRUSTED
|
||||
#[serde(rename = "M_SERVER_NOT_TRUSTED")]
|
||||
#[strum(to_string = "M_SERVER_NOT_TRUSTED")]
|
||||
ServerNotTrusted,
|
||||
|
||||
/// M_UNSUPPORTED_ROOM_VERSION
|
||||
#[serde(rename = "M_UNSUPPORTED_ROOM_VERSION")]
|
||||
#[strum(to_string = "M_UNSUPPORTED_ROOM_VERSION")]
|
||||
UnsupportedRoomVersion,
|
||||
|
||||
/// M_INCOMPATIBLE_ROOM_VERSION
|
||||
#[serde(rename = "M_INCOMPATIBLE_ROOM_VERSION")]
|
||||
#[strum(to_string = "M_INCOMPATIBLE_ROOM_VERSION")]
|
||||
IncompatibleRoomVersion,
|
||||
|
||||
/// M_BAD_STATE
|
||||
#[serde(rename = "M_BAD_STATE")]
|
||||
#[strum(to_string = "M_BAD_STATE")]
|
||||
BadState,
|
||||
|
||||
/// M_GUEST_ACCESS_FORBIDDEN
|
||||
#[serde(rename = "M_GUEST_ACCESS_FORBIDDEN")]
|
||||
#[strum(to_string = "M_GUEST_ACCESS_FORBIDDEN")]
|
||||
GuestAccessForbidden,
|
||||
|
||||
/// M_CAPTCHA_NEEDED
|
||||
#[serde(rename = "M_CAPTCHA_NEEDED")]
|
||||
#[strum(to_string = "M_CAPTCHA_NEEDED")]
|
||||
CaptchaNeeded,
|
||||
|
||||
/// M_CAPTCHA_INVALID
|
||||
#[serde(rename = "M_CAPTCHA_INVALID")]
|
||||
#[strum(to_string = "M_CAPTCHA_INVALID")]
|
||||
CaptchaInvalid,
|
||||
|
||||
/// M_MISSING_PARAM
|
||||
#[serde(rename = "M_MISSING_PARAM")]
|
||||
#[strum(to_string = "M_MISSING_PARAM")]
|
||||
MissingParam,
|
||||
|
||||
/// M_INVALID_PARAM
|
||||
#[serde(rename = "M_INVALID_PARAM")]
|
||||
#[strum(to_string = "M_INVALID_PARAM")]
|
||||
InvalidParam,
|
||||
|
||||
/// M_TOO_LARGE
|
||||
#[serde(rename = "M_TOO_LARGE")]
|
||||
#[strum(to_string = "M_TOO_LARGE")]
|
||||
TooLarge,
|
||||
|
||||
/// M_EXCLUSIVE
|
||||
#[serde(rename = "M_EXCLUSIVE")]
|
||||
#[strum(to_string = "M_EXCLUSIVE")]
|
||||
@ -141,6 +170,7 @@ pub struct ErrorBody {
|
||||
/// A value which can be used to handle an error message
|
||||
#[serde(flatten)]
|
||||
pub kind: ErrorKind,
|
||||
|
||||
/// A human-readable error message, usually a sentence explaining what went wrong.
|
||||
#[serde(rename = "error")]
|
||||
pub message: String,
|
||||
@ -151,8 +181,10 @@ pub struct ErrorBody {
|
||||
pub struct Error {
|
||||
/// A value which can be used to handle an error message
|
||||
pub kind: ErrorKind,
|
||||
|
||||
/// A human-readable error message, usually a sentence explaining what went wrong.
|
||||
pub message: String,
|
||||
|
||||
/// The http status code
|
||||
pub status_code: http::StatusCode,
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ pub struct IdentityServerInfo {
|
||||
/// The ID server to send the onward request to as a hostname with an
|
||||
/// appended colon and port number if the port is not the default.
|
||||
pub id_server: String,
|
||||
|
||||
/// Access token previously registered with identity server.
|
||||
pub id_access_token: String,
|
||||
}
|
||||
@ -36,6 +37,7 @@ pub enum ThirdPartyIdRemovalStatus {
|
||||
/// Either the homeserver couldn't determine the right identity server to contact, or the
|
||||
/// identity server refused the operation.
|
||||
NoSupport,
|
||||
|
||||
/// Success.
|
||||
Success,
|
||||
}
|
||||
|
@ -18,8 +18,10 @@ ruma_api! {
|
||||
/// Additional information for the User-Interactive Authentication API.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub auth: Option<AuthData>,
|
||||
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
}
|
||||
@ -28,4 +30,3 @@ ruma_api! {
|
||||
|
||||
error: UiaaResponse
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,12 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// The ID server to send the onward request to as a hostname with an
|
||||
/// appended colon and port number if the port is not the default.
|
||||
#[serde(flatten)]
|
||||
pub identity_server_info: IdentityServerInfo,
|
||||
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ ruma_api! {
|
||||
request {
|
||||
/// The new password for the account.
|
||||
pub new_password: String,
|
||||
|
||||
/// Additional authentication information for the user-interactive authentication API.
|
||||
pub auth: Option<AuthData>,
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ ruma_api! {
|
||||
/// Additional authentication information for the user-interactive authentication API.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub auth: Option<AuthData>,
|
||||
|
||||
/// Identity server from which to unbind the user's third party
|
||||
/// identifier.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -19,8 +19,10 @@ ruma_api! {
|
||||
/// Identity server to delete from.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub id_server: Option<String>,
|
||||
|
||||
/// Medium of the 3PID to be removed.
|
||||
pub medium: Medium,
|
||||
|
||||
/// Third-party address being removed.
|
||||
pub address: String,
|
||||
}
|
||||
|
@ -23,22 +23,26 @@ ruma_api! {
|
||||
/// with a password, e.g., for guest or application service accounts.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub password: Option<String>,
|
||||
|
||||
/// local part of the desired Matrix ID.
|
||||
///
|
||||
/// If omitted, the homeserver MUST generate a Matrix ID local part.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub username: Option<String>,
|
||||
|
||||
/// ID of the client device.
|
||||
///
|
||||
/// If this does not correspond to a known client device, a new device will be created.
|
||||
/// The server will auto-generate a device_id if this is not specified.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub device_id: Option<DeviceId>,
|
||||
|
||||
/// A display name to assign to the newly-created device.
|
||||
///
|
||||
/// Ignored if `device_id` corresponds to a known device.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub initial_device_display_name: Option<String>,
|
||||
|
||||
/// Additional authentication information for the user-interactive authentication API.
|
||||
///
|
||||
/// Note that this information is not used to define how the registered user should be
|
||||
@ -47,12 +51,14 @@ ruma_api! {
|
||||
/// with status code 401.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub auth: Option<AuthData>,
|
||||
|
||||
/// Kind of account to register
|
||||
///
|
||||
/// Defaults to `User` if omitted.
|
||||
#[ruma_api(query)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub kind: Option<RegistrationKind>,
|
||||
|
||||
/// If `true`, an `access_token` and `device_id` should not be returned
|
||||
/// from this call, therefore preventing an automatic login.
|
||||
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
||||
@ -65,8 +71,10 @@ ruma_api! {
|
||||
/// This access token can then be used to authorize other requests.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub access_token: Option<String>,
|
||||
|
||||
/// The fully-qualified Matrix ID that has been registered.
|
||||
pub user_id: UserId,
|
||||
|
||||
/// ID of the registered device.
|
||||
///
|
||||
/// Will be the same as the corresponding parameter in the request, if one was specified.
|
||||
@ -84,6 +92,7 @@ pub enum RegistrationKind {
|
||||
///
|
||||
/// These accounts may have limited permissions and may not be supported by all servers.
|
||||
Guest,
|
||||
|
||||
/// A regular user account
|
||||
User,
|
||||
}
|
||||
|
@ -18,13 +18,17 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// The email address.
|
||||
pub email: String,
|
||||
|
||||
/// Used to distinguish protocol level retries from requests to re-send the email.
|
||||
pub send_attempt: UInt,
|
||||
|
||||
/// Return URL for identity server to redirect the client back to.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_link: Option<String>,
|
||||
|
||||
/// Optional identity server hostname and access token. Deprecated since r0.6.0.
|
||||
#[serde(flatten)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -34,6 +38,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
|
||||
/// URL to submit validation token to. If omitted, verification happens without client.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub submit_url: Option<String>
|
||||
|
@ -18,15 +18,20 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// Two-letter ISO 3166 country code for the phone number.
|
||||
pub country: String,
|
||||
|
||||
/// Phone number to validate.
|
||||
pub phone_number: String,
|
||||
|
||||
/// Used to distinguish protocol level retries from requests to re-send the SMS.
|
||||
pub send_attempt: UInt,
|
||||
|
||||
/// Return URL for identity server to redirect the client back to.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_link: Option<String>,
|
||||
|
||||
/// Optional identity server hostname and access token. Deprecated since r0.6.0.
|
||||
#[serde(flatten)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -36,6 +41,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
|
||||
/// URL to submit validation token to. If omitted, verification happens without client.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub submit_url: Option<String>
|
||||
|
@ -25,10 +25,13 @@ ruma_api! {
|
||||
response {
|
||||
/// Access token for verifying user's identity.
|
||||
pub access_token: String,
|
||||
|
||||
/// Access token type.
|
||||
pub token_type: TokenType,
|
||||
|
||||
/// Homeserver domain for verification of user's identity.
|
||||
pub matrix_server_name: String,
|
||||
|
||||
/// Seconds until token expiration.
|
||||
#[serde(with = "ruma_serde::duration::secs")]
|
||||
pub expires_in: Duration,
|
||||
|
@ -18,13 +18,17 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// The email address.
|
||||
pub email: String,
|
||||
|
||||
/// Used to distinguish protocol level retries from requests to re-send the email.
|
||||
pub send_attempt: UInt,
|
||||
|
||||
/// Return URL for identity server to redirect the client back to.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_link: Option<String>,
|
||||
|
||||
/// Optional identity server hostname and access token. Deprecated since r0.6.0.
|
||||
#[serde(flatten)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -34,6 +38,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
|
||||
/// URL to submit validation token to. If omitted, verification happens without client.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub submit_url: Option<String>
|
||||
|
@ -16,12 +16,16 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// Two-letter ISO 3166 country code for the phone number.
|
||||
pub country: String,
|
||||
|
||||
/// Phone number to validate.
|
||||
pub phone_number: String,
|
||||
|
||||
/// Used to distinguish protocol level retries from requests to re-send the SMS.
|
||||
pub send_attempt: UInt,
|
||||
|
||||
/// Return URL for identity server to redirect the client back to.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_link: Option<String>,
|
||||
@ -30,6 +34,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
|
||||
/// URL to submit validation token to. If omitted, verification happens without client.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub submit_url: Option<String>
|
||||
|
@ -18,13 +18,17 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// The email address.
|
||||
pub email: String,
|
||||
|
||||
/// Used to distinguish protocol level retries from requests to re-send the email.
|
||||
pub send_attempt: UInt,
|
||||
|
||||
/// Return URL for identity server to redirect the client back to.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_link: Option<String>,
|
||||
|
||||
/// Optional identity server hostname and access token. Deprecated since r0.6.0.
|
||||
#[serde(flatten)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -34,6 +38,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
|
||||
/// URL to submit validation token to. If omitted, verification happens without client.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub submit_url: Option<String>
|
||||
|
@ -18,15 +18,20 @@ ruma_api! {
|
||||
request {
|
||||
/// Client-generated secret string used to protect this session.
|
||||
pub client_secret: String,
|
||||
|
||||
/// Two-letter ISO 3166 country code for the phone number.
|
||||
pub country: String,
|
||||
|
||||
/// Phone number to validate.
|
||||
pub phone_number: String,
|
||||
|
||||
/// Return URL for identity server to redirect the client back to.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_link: Option<String>,
|
||||
|
||||
/// Used to distinguish protocol level retries from requests to re-send the SMS.
|
||||
pub send_attempt: UInt,
|
||||
|
||||
/// Optional identity server hostname and access token. Deprecated since r0.6.0.
|
||||
#[serde(flatten)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -36,6 +41,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The session identifier given by the identity server.
|
||||
pub sid: String,
|
||||
|
||||
/// URL to submit validation token to. If omitted, verification happens without client.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub submit_url: Option<String>
|
||||
|
@ -19,8 +19,10 @@ ruma_api! {
|
||||
/// Identity server to unbind from.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub id_server: Option<String>,
|
||||
|
||||
/// Medium of the 3PID to be removed.
|
||||
pub medium: Medium,
|
||||
|
||||
/// Third-party address being removed.
|
||||
pub address: String,
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ ruma_api! {
|
||||
/// The room alias to set.
|
||||
#[ruma_api(path)]
|
||||
pub room_alias: RoomAliasId,
|
||||
|
||||
/// The room ID to set.
|
||||
pub room_id: RoomId,
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ ruma_api! {
|
||||
response {
|
||||
/// The room ID for this room alias.
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// A list of servers that are aware of this room ID.
|
||||
pub servers: Vec<String>,
|
||||
}
|
||||
|
@ -19,9 +19,11 @@ ruma_api! {
|
||||
/// The protocol (network) ID to update the room list for.
|
||||
#[ruma_api(path)]
|
||||
pub network_id: String,
|
||||
|
||||
/// The room ID to add to the directory.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// Whether the room should be visible (public) in the directory or not (private).
|
||||
pub visibility: Visibility,
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ ruma_api! {
|
||||
/// User ID of user for whom to retrieve data.
|
||||
#[ruma_api(path)]
|
||||
pub user_id: UserId,
|
||||
|
||||
/// Type of data to retrieve.
|
||||
#[ruma_api(path)]
|
||||
pub event_type: String,
|
||||
|
@ -18,9 +18,11 @@ ruma_api! {
|
||||
/// User ID of user for whom to retrieve data.
|
||||
#[ruma_api(path)]
|
||||
pub user_id: UserId,
|
||||
|
||||
/// Room ID for which to retrieve data.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// Type of data to retrieve.
|
||||
#[ruma_api(path)]
|
||||
pub event_type: String,
|
||||
|
@ -35,11 +35,14 @@ ruma_api! {
|
||||
pub struct ThirdPartyIdentifier {
|
||||
/// The third party identifier address.
|
||||
pub address: String,
|
||||
|
||||
/// The medium of third party identifier.
|
||||
pub medium: Medium,
|
||||
|
||||
/// The time when the identifier was validated by the identity server.
|
||||
#[serde(with = "ruma_serde::time::ms_since_unix_epoch")]
|
||||
pub validated_at: SystemTime,
|
||||
|
||||
/// The time when the homeserver associated the third party identifier with the user.
|
||||
#[serde(with = "ruma_serde::time::ms_since_unix_epoch")]
|
||||
pub added_at: SystemTime,
|
||||
|
@ -16,10 +16,13 @@ pub mod update_device;
|
||||
pub struct Device {
|
||||
/// Device ID
|
||||
pub device_id: DeviceId,
|
||||
|
||||
/// Public display name of the device.
|
||||
pub display_name: Option<String>,
|
||||
|
||||
/// Most recently seen IP address of the session.
|
||||
pub ip: Option<String>,
|
||||
|
||||
/// Unix timestamp that the session was last active.
|
||||
#[serde(
|
||||
with = "ruma_serde::time::opt_ms_since_unix_epoch",
|
||||
|
@ -19,6 +19,7 @@ ruma_api! {
|
||||
/// The device to delete.
|
||||
#[ruma_api(path)]
|
||||
pub device_id: DeviceId,
|
||||
|
||||
/// Additional authentication information for the user-interactive authentication API.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub auth: Option<AuthData>,
|
||||
|
@ -17,6 +17,7 @@ ruma_api! {
|
||||
/// The device to update.
|
||||
#[ruma_api(path)]
|
||||
pub device_id: DeviceId,
|
||||
|
||||
/// The new display name for this device. If this is `None`, the display name won't be
|
||||
/// changed.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -13,25 +13,33 @@ pub struct PublicRoomsChunk {
|
||||
/// Aliases of the room.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub aliases: Vec<RoomAliasId>,
|
||||
|
||||
/// The canonical alias of the room, if any.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub canonical_alias: Option<String>,
|
||||
|
||||
/// The name of the room, if any.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
|
||||
/// The number of members joined to the room.
|
||||
pub num_joined_members: UInt,
|
||||
|
||||
/// The ID of the room.
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The topic of the room, if any.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub topic: Option<String>,
|
||||
|
||||
/// Whether the room may be viewed by guest users without joining.
|
||||
pub world_readable: bool,
|
||||
|
||||
/// Whether guest users may join the room and participate in it.
|
||||
///
|
||||
/// If they can, they will be subject to ordinary power level rules like any other user.
|
||||
pub guest_can_join: bool,
|
||||
|
||||
/// The URL for the room's avatar, if one is set.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub avatar_url: Option<String>,
|
||||
|
@ -20,10 +20,12 @@ ruma_api! {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub limit: Option<UInt>,
|
||||
|
||||
/// Pagination token from a previous request.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub since: Option<String>,
|
||||
|
||||
/// The server to fetch the public room lists from.
|
||||
///
|
||||
/// `None` means the server this request is sent to.
|
||||
@ -35,10 +37,13 @@ ruma_api! {
|
||||
response {
|
||||
/// A paginated chunk of public rooms.
|
||||
pub chunk: Vec<PublicRoomsChunk>,
|
||||
|
||||
/// A pagination token for the response.
|
||||
pub next_batch: Option<String>,
|
||||
|
||||
/// A pagination token that allows fetching previous results.
|
||||
pub prev_batch: Option<String>,
|
||||
|
||||
/// An estimate on the total number of public rooms, if the server has an estimate.
|
||||
pub total_room_count_estimate: Option<UInt>,
|
||||
}
|
||||
|
@ -31,15 +31,19 @@ ruma_api! {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub server: Option<String>,
|
||||
|
||||
/// Limit for the number of results to return.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub limit: Option<UInt>,
|
||||
|
||||
/// Pagination token from a previous request.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub since: Option<String>,
|
||||
|
||||
/// Filter to apply to the results.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub filter: Option<Filter>,
|
||||
|
||||
/// Network to fetch the public room lists from.
|
||||
#[serde(flatten, skip_serializing_if = "ruma_serde::is_default")]
|
||||
pub room_network: RoomNetwork,
|
||||
@ -48,10 +52,13 @@ ruma_api! {
|
||||
response {
|
||||
/// A paginated chunk of public rooms.
|
||||
pub chunk: Vec<PublicRoomsChunk>,
|
||||
|
||||
/// A pagination token for the response.
|
||||
pub next_batch: Option<String>,
|
||||
|
||||
/// A pagination token that allows fetching previous results.
|
||||
pub prev_batch: Option<String>,
|
||||
|
||||
/// An estimate on the total number of public rooms, if the server has an estimate.
|
||||
pub total_room_count_estimate: Option<UInt>,
|
||||
}
|
||||
@ -73,8 +80,10 @@ pub struct Filter {
|
||||
pub enum RoomNetwork {
|
||||
/// Return rooms from the Matrix network.
|
||||
Matrix,
|
||||
|
||||
/// Return rooms from all the networks/protocols the homeserver knows about.
|
||||
All,
|
||||
|
||||
/// Return rooms from a specific third party network/protocol.
|
||||
ThirdParty(String),
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ use serde::{
|
||||
pub enum EventFormat {
|
||||
/// Client format, as described in the Client API.
|
||||
Client,
|
||||
|
||||
/// Raw events from federation.
|
||||
Federation,
|
||||
}
|
||||
@ -33,43 +34,51 @@ pub struct RoomEventFilter {
|
||||
/// sequence of characters.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub not_types: Vec<String>,
|
||||
|
||||
/// A list of room IDs to exclude.
|
||||
///
|
||||
/// If this list is absent then no rooms are excluded. A matching room will be excluded even if
|
||||
/// it is listed in the 'rooms' filter.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub not_rooms: Vec<String>,
|
||||
|
||||
/// The maximum number of events to return.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub limit: Option<UInt>,
|
||||
|
||||
/// A list of room IDs to include.
|
||||
///
|
||||
/// If this list is absent then all rooms are included.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub rooms: Option<Vec<RoomId>>,
|
||||
|
||||
/// A list of sender IDs to exclude.
|
||||
///
|
||||
/// If this list is absent then no senders are excluded. A matching sender will be excluded even
|
||||
/// if it is listed in the 'senders' filter.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub not_senders: Vec<UserId>,
|
||||
|
||||
/// A list of senders IDs to include.
|
||||
///
|
||||
/// If this list is absent then all senders are included.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub senders: Option<Vec<UserId>>,
|
||||
|
||||
/// A list of event types to include.
|
||||
///
|
||||
/// If this list is absent then all event types are included. A '*' can be used as a wildcard to
|
||||
/// match any sequence of characters.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub types: Option<Vec<String>>,
|
||||
|
||||
/// If `true` include only events with a URL key in their content.
|
||||
/// If `false`, exclude such events.
|
||||
///
|
||||
/// If this item is absent then all event types are included.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub contains_url: Option<bool>,
|
||||
|
||||
/// Options to control lazy-loading of membership events.
|
||||
#[serde(flatten)]
|
||||
pub lazy_load_options: LazyLoadOptions,
|
||||
@ -93,19 +102,24 @@ pub struct RoomFilter {
|
||||
/// Defaults to false if not included.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub include_leave: Option<bool>,
|
||||
|
||||
/// The per user account data to include for rooms.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub account_data: Option<RoomEventFilter>,
|
||||
|
||||
/// The message and state update events to include for rooms.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub timeline: Option<RoomEventFilter>,
|
||||
|
||||
/// The events that aren't recorded in the room history, e.g. typing and receipts, to include
|
||||
/// for rooms.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub ephemeral: Option<RoomEventFilter>,
|
||||
|
||||
/// The state events to include for rooms.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<RoomEventFilter>,
|
||||
|
||||
/// A list of room IDs to exclude.
|
||||
///
|
||||
/// If this list is absent then no rooms are excluded. A matching room will be excluded even if
|
||||
@ -113,6 +127,7 @@ pub struct RoomFilter {
|
||||
/// `ephemeral`, `state`, `timeline` or `account_data`.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub not_rooms: Vec<RoomId>,
|
||||
|
||||
/// A list of room IDs to include.
|
||||
///
|
||||
/// If this list is absent then all rooms are included. This filter is applied before the
|
||||
@ -141,20 +156,24 @@ pub struct Filter {
|
||||
/// sequence of characters.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub not_types: Vec<String>,
|
||||
|
||||
/// The maximum number of events to return.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub limit: Option<UInt>,
|
||||
|
||||
/// A list of senders IDs to include.
|
||||
///
|
||||
/// If this list is absent then all senders are included.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub senders: Option<Vec<UserId>>,
|
||||
|
||||
/// A list of event types to include.
|
||||
///
|
||||
/// If this list is absent then all event types are included. A '*' can be used as a wildcard to
|
||||
/// match any sequence of characters.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub types: Option<Vec<String>>,
|
||||
|
||||
/// A list of sender IDs to exclude.
|
||||
///
|
||||
/// If this list is absent then no senders are excluded. A matching sender will be excluded even
|
||||
@ -225,6 +244,7 @@ impl FilterDefinition {
|
||||
pub enum LazyLoadOptions {
|
||||
/// Disables lazy-loading of membership events.
|
||||
Disabled,
|
||||
|
||||
/// Enables lazy-loading of events.
|
||||
Enabled {
|
||||
/// If `true`, sends all membership events for all events, even if they have
|
||||
|
@ -111,14 +111,19 @@ impl<'de> Deserialize<'de> for AlgorithmAndDeviceId {
|
||||
pub struct DeviceKeys {
|
||||
/// The ID of the user the device belongs to. Must match the user ID used when logging in.
|
||||
pub user_id: UserId,
|
||||
|
||||
/// The ID of the device these keys belong to. Must match the device ID used when logging in.
|
||||
pub device_id: DeviceId,
|
||||
|
||||
/// The encryption algorithms supported by this device.
|
||||
pub algorithms: Vec<Algorithm>,
|
||||
|
||||
/// Public identity keys.
|
||||
pub keys: BTreeMap<AlgorithmAndDeviceId, String>,
|
||||
|
||||
/// Signatures for the device key object.
|
||||
pub signatures: BTreeMap<UserId, BTreeMap<AlgorithmAndDeviceId, String>>,
|
||||
|
||||
/// Additional data added to the device key information by intermediate servers, and
|
||||
/// not covered by the signatures.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -137,6 +142,7 @@ pub struct UnsignedDeviceInfo {
|
||||
pub struct SignedKey {
|
||||
/// Base64-encoded 32-byte Curve25519 public key.
|
||||
pub key: String,
|
||||
|
||||
/// Signatures for the key object.
|
||||
pub signatures: BTreeMap<UserId, BTreeMap<AlgorithmAndDeviceId, String>>,
|
||||
}
|
||||
@ -147,6 +153,7 @@ pub struct SignedKey {
|
||||
pub enum OneTimeKey {
|
||||
/// A key containing signatures, for the SignedCurve25519 algorithm.
|
||||
SignedKey(SignedKey),
|
||||
|
||||
/// A string-valued key, for the Ed25519 and Curve25519 algorithms.
|
||||
Key(String),
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ ruma_api! {
|
||||
}
|
||||
|
||||
request {
|
||||
/// The time (in milliseconds) to wait when downloading keys from remote servers.
|
||||
/// 10 seconds is the recommended default.
|
||||
/// The time (in milliseconds) to wait when downloading keys from remote
|
||||
/// servers. 10 seconds is the recommended default.
|
||||
#[serde(
|
||||
with = "ruma_serde::duration::opt_ms",
|
||||
default,
|
||||
@ -28,19 +28,23 @@ ruma_api! {
|
||||
)]
|
||||
pub timeout: Option<Duration>,
|
||||
|
||||
/// The keys to be downloaded. An empty list indicates all devices for the corresponding user.
|
||||
/// The keys to be downloaded. An empty list indicates all devices for
|
||||
/// the corresponding user.
|
||||
pub device_keys: BTreeMap<UserId, Vec<DeviceId>>,
|
||||
|
||||
/// If the client is fetching keys as a result of a device update received in a sync request,
|
||||
/// this should be the 'since' token of that sync request, or any later sync token.
|
||||
/// This allows the server to ensure its response contains the keys advertised by the notification in that sync.
|
||||
/// If the client is fetching keys as a result of a device update
|
||||
/// received in a sync request, this should be the 'since' token of that
|
||||
/// sync request, or any later sync token. This allows the server to
|
||||
/// ensure its response contains the keys advertised by the notification
|
||||
/// in that sync.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub token: Option<String>,
|
||||
}
|
||||
|
||||
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.
|
||||
/// 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<String, JsonValue>,
|
||||
|
||||
/// Information on the queried devices.
|
||||
|
@ -16,9 +16,11 @@ ruma_api! {
|
||||
/// The media ID from the mxc:// URI (the path component).
|
||||
#[ruma_api(path)]
|
||||
pub media_id: String,
|
||||
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
#[ruma_api(path)]
|
||||
pub server_name: String,
|
||||
|
||||
/// Whether to fetch media deemed remote.
|
||||
/// Used to prevent routing loops. Defaults to `true`.
|
||||
#[ruma_api(query)]
|
||||
@ -29,9 +31,11 @@ ruma_api! {
|
||||
/// The content that was previously uploaded.
|
||||
#[ruma_api(raw_body)]
|
||||
pub file: Vec<u8>,
|
||||
|
||||
/// The content type of the file that was previously uploaded.
|
||||
#[ruma_api(header = CONTENT_TYPE)]
|
||||
pub content_type: String,
|
||||
|
||||
/// The name of the file that was previously uploaded, if set.
|
||||
#[ruma_api(header = CONTENT_DISPOSITION)]
|
||||
pub content_disposition: String,
|
||||
|
@ -16,12 +16,15 @@ ruma_api! {
|
||||
/// The media ID from the mxc:// URI (the path component).
|
||||
#[ruma_api(path)]
|
||||
pub media_id: String,
|
||||
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
#[ruma_api(path)]
|
||||
pub server_name: String,
|
||||
|
||||
/// The filename to return in the `Content-Disposition` header.
|
||||
#[ruma_api(path)]
|
||||
pub filename: String,
|
||||
|
||||
/// Whether to fetch media deemed remote.
|
||||
/// Used to prevent routing loops. Defaults to `true`.
|
||||
#[ruma_api(query)]
|
||||
@ -32,9 +35,11 @@ ruma_api! {
|
||||
/// The content that was previously uploaded.
|
||||
#[ruma_api(raw_body)]
|
||||
pub file: Vec<u8>,
|
||||
|
||||
/// The content type of the file that was previously uploaded.
|
||||
#[ruma_api(header = CONTENT_TYPE)]
|
||||
pub content_type: String,
|
||||
|
||||
/// The name of the file that was previously uploaded, if set.
|
||||
#[ruma_api(header = CONTENT_DISPOSITION)]
|
||||
pub content_disposition: String,
|
||||
|
@ -10,6 +10,7 @@ use serde::{Deserialize, Serialize};
|
||||
pub enum Method {
|
||||
/// Crop the original to produce the requested image dimensions.
|
||||
Crop,
|
||||
|
||||
/// Maintain the original aspect ratio of the source image.
|
||||
Scale,
|
||||
}
|
||||
@ -31,20 +32,25 @@ ruma_api! {
|
||||
#[ruma_api(query)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub allow_remote: Option<bool>,
|
||||
|
||||
/// The media ID from the mxc:// URI (the path component).
|
||||
#[ruma_api(path)]
|
||||
pub media_id: String,
|
||||
|
||||
/// The server name from the mxc:// URI (the authoritory component).
|
||||
#[ruma_api(path)]
|
||||
pub server_name: String,
|
||||
|
||||
/// The *desired* height of the thumbnail. The actual thumbnail may not match the size
|
||||
/// specified.
|
||||
#[ruma_api(query)]
|
||||
pub height: UInt,
|
||||
|
||||
/// The desired resizing method.
|
||||
#[ruma_api(query)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub method: Option<Method>,
|
||||
|
||||
/// The *desired* width of the thumbnail. The actual thumbnail may not match the size
|
||||
/// specified.
|
||||
#[ruma_api(query)]
|
||||
@ -55,6 +61,7 @@ ruma_api! {
|
||||
/// The content type of the thumbnail.
|
||||
#[ruma_api(header = CONTENT_TYPE)]
|
||||
pub content_type: String,
|
||||
|
||||
/// A thumbnail of the requested content.
|
||||
#[ruma_api(body)]
|
||||
pub file: Vec<u8>,
|
||||
|
@ -19,6 +19,7 @@ ruma_api! {
|
||||
/// URL to get a preview of.
|
||||
#[ruma_api(query)]
|
||||
pub url: String,
|
||||
|
||||
/// Preferred point in time (in milliseconds) to return a preview for.
|
||||
#[ruma_api(query)]
|
||||
#[serde(with = "ruma_serde::time::ms_since_unix_epoch")]
|
||||
|
@ -40,10 +40,13 @@ pub struct ThirdPartySigned {
|
||||
pub struct Invite3pid {
|
||||
/// Hostname and port of identity server to be used for account lookups.
|
||||
pub id_server: String,
|
||||
|
||||
/// An access token registered with the identity server.
|
||||
pub id_access_token: String,
|
||||
|
||||
/// Type of third party ID.
|
||||
pub medium: Medium,
|
||||
|
||||
/// Third party identifier.
|
||||
pub address: String,
|
||||
}
|
||||
|
@ -54,10 +54,13 @@ ruma_api! {
|
||||
pub enum MembershipEventFilter {
|
||||
/// The user has joined.
|
||||
Join,
|
||||
|
||||
/// The user has been invited.
|
||||
Invite,
|
||||
|
||||
/// The user has left.
|
||||
Leave,
|
||||
|
||||
/// The user has been banned.
|
||||
Ban,
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ ruma_api! {
|
||||
/// The room where the user should be invited.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The user to invite.
|
||||
#[ruma_api(body)]
|
||||
pub recipient: InvitationRecipient,
|
||||
@ -45,6 +46,7 @@ pub enum InvitationRecipient {
|
||||
/// Matrix identifier of user.
|
||||
user_id: UserId,
|
||||
},
|
||||
|
||||
/// Used to invite user by a third party identifer.
|
||||
ThirdPartyId(Invite3pid),
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ pub struct RoomMember {
|
||||
/// The display name of the user.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub display_name: Option<String>,
|
||||
|
||||
/// The mxc avatar url of the user.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub avatar_url: Option<String>,
|
||||
|
@ -25,6 +25,7 @@ ruma_api! {
|
||||
/// The room to get events from.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The token to start returning events from.
|
||||
///
|
||||
/// This token can be obtained from a
|
||||
@ -32,6 +33,7 @@ ruma_api! {
|
||||
/// returned by a previous request to this endpoint.
|
||||
#[ruma_api(query)]
|
||||
pub from: String,
|
||||
|
||||
/// The token to stop returning events at.
|
||||
///
|
||||
/// This token can be obtained from a prev_batch
|
||||
@ -40,15 +42,18 @@ ruma_api! {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub to: Option<String>,
|
||||
|
||||
/// The direction to return events from.
|
||||
#[ruma_api(query)]
|
||||
pub dir: Direction,
|
||||
|
||||
/// The maximum number of events to return.
|
||||
///
|
||||
/// Default: 10.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub limit: Option<UInt>,
|
||||
|
||||
/// A RoomEventFilter to filter returned events with.
|
||||
#[ruma_api(query)]
|
||||
#[serde(
|
||||
@ -63,12 +68,15 @@ ruma_api! {
|
||||
/// The token the pagination starts from.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub start: Option<String>,
|
||||
|
||||
/// The token the pagination ends at.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub end: Option<String>,
|
||||
|
||||
/// A list of room events.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub chunk: Vec<EventJson<RoomEvent>>,
|
||||
|
||||
/// A list of state events relevant to showing the `chunk`.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub state: Vec<EventJson<StateEvent>>,
|
||||
@ -83,6 +91,7 @@ pub enum Direction {
|
||||
/// Return events backwards in time from the requested `from` token.
|
||||
#[serde(rename = "b")]
|
||||
Backward,
|
||||
|
||||
/// Return events forwards in time from the requested `from` token.
|
||||
#[serde(rename = "f")]
|
||||
Forward,
|
||||
|
@ -26,9 +26,11 @@ ruma_api! {
|
||||
/// The state message for this user if one was set.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub status_msg: Option<String>,
|
||||
|
||||
/// Whether or not the user is currently active.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub currently_active: Option<bool>,
|
||||
|
||||
/// The length of time in milliseconds since an action was performed by the user.
|
||||
#[serde(
|
||||
with = "ruma_serde::duration::opt_ms",
|
||||
@ -36,6 +38,7 @@ ruma_api! {
|
||||
skip_serializing_if = "Option::is_none",
|
||||
)]
|
||||
pub last_active_ago: Option<Duration>,
|
||||
|
||||
/// The user's presence state.
|
||||
pub presence: PresenceState,
|
||||
}
|
||||
|
@ -84,6 +84,7 @@ pub enum PushCondition {
|
||||
EventMatch {
|
||||
/// The dot-separated field of the event to match, e.g. `content.body`
|
||||
key: String,
|
||||
|
||||
/// The glob-style pattern to match against.
|
||||
pattern: String,
|
||||
},
|
||||
|
@ -13,6 +13,7 @@ use serde::{Deserialize, Serialize};
|
||||
pub enum Visibility {
|
||||
/// Indicates that the room will be shown in the published room list.
|
||||
Public,
|
||||
|
||||
/// Indicates that the room will not be shown in the published room list.
|
||||
Private,
|
||||
}
|
||||
|
@ -23,43 +23,54 @@ ruma_api! {
|
||||
/// Extra keys to be added to the content of the `m.room.create`.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub creation_content: Option<CreationContent>,
|
||||
|
||||
/// List of state events to send to the new room.
|
||||
///
|
||||
/// Takes precedence over events set by preset, but gets overriden by
|
||||
/// name and topic keys.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub initial_state: Vec<InitialStateEvent>,
|
||||
|
||||
/// A list of user IDs to invite to the room.
|
||||
///
|
||||
/// This will tell the server to invite everyone in the list to the newly created room.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub invite: Vec<UserId>,
|
||||
|
||||
/// List of third party IDs of users to invite.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub invite_3pid: Vec<Invite3pid>,
|
||||
|
||||
/// If set, this sets the `is_direct` flag on room invites.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub is_direct: Option<bool>,
|
||||
|
||||
/// If this is included, an `m.room.name` event will be sent into the room to indicate
|
||||
/// the name of the room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
|
||||
/// Power level content to override in the default power level event.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub power_level_content_override: Option<EventJson<PowerLevelsEventContent>>,
|
||||
|
||||
/// Convenience parameter for setting various default state events based on a preset.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub preset: Option<RoomPreset>,
|
||||
|
||||
/// The desired room alias local part.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub room_alias_name: Option<String>,
|
||||
|
||||
/// Room version to set for the room. Defaults to homeserver's default if not specified.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub room_version: Option<String>,
|
||||
|
||||
/// If this is included, an `m.room.topic` event will be sent into the room to indicate
|
||||
/// the topic for the room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub topic: Option<String>,
|
||||
|
||||
/// A public visibility indicates that the room will be shown in the published room
|
||||
/// list. A private visibility will hide the room from the published room list. Rooms
|
||||
/// default to private visibility if this key is not included.
|
||||
@ -91,8 +102,10 @@ pub struct CreationContent {
|
||||
pub enum RoomPreset {
|
||||
/// `join_rules` is set to `invite` and `history_visibility` is set to `shared`.
|
||||
PrivateChat,
|
||||
|
||||
/// `join_rules` is set to `public` and `history_visibility` is set to `shared`.
|
||||
PublicChat,
|
||||
|
||||
/// Same as `PrivateChat`, but all initial invitees get the same power level as the creator.
|
||||
TrustedPrivateChat,
|
||||
}
|
||||
@ -103,8 +116,10 @@ pub struct InitialStateEvent {
|
||||
/// State event type.
|
||||
#[serde(rename = "type")]
|
||||
pub event_type: String,
|
||||
|
||||
/// `state_key` of the event to be sent.
|
||||
pub state_key: Option<String>,
|
||||
|
||||
/// JSON content of the state event.
|
||||
pub content: JsonValue,
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ ruma_api! {
|
||||
/// The ID of the room the event is in.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The ID of the event.
|
||||
#[ruma_api(path)]
|
||||
pub event_id: EventId,
|
||||
|
@ -18,11 +18,14 @@ ruma_api! {
|
||||
/// Room in which the event to be reported is located.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// Event to report.
|
||||
#[ruma_api(path)]
|
||||
pub event_id: EventId,
|
||||
|
||||
/// Integer between -100 and 0 rating offensivness.
|
||||
pub score: Int,
|
||||
|
||||
/// Reason to report content. May be blank.
|
||||
pub reason: String,
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ ruma_api! {
|
||||
/// ID of the room to be upgraded.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// New version for the room.
|
||||
pub new_version: String,
|
||||
}
|
||||
|
@ -204,18 +204,23 @@ pub struct ResultCategories {
|
||||
pub struct RoomEventJsons {
|
||||
/// An approximate count of the total number of results found.
|
||||
pub count: UInt,
|
||||
|
||||
/// Any groups that were requested.
|
||||
pub groups: BTreeMap<GroupingKey, BTreeMap<RoomIdOrUserId, ResultGroup>>,
|
||||
|
||||
/// Token that can be used to get the next batch of results, by passing as the `next_batch`
|
||||
/// parameter to the next call. If this field is absent, there are no more results.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_batch: Option<String>,
|
||||
|
||||
/// List of results in the requested order.
|
||||
pub results: Vec<SearchResult>,
|
||||
|
||||
/// The current state for every room in the results. This is included if the request had the
|
||||
/// `include_state` key set with a value of `true`.
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub state: BTreeMap<RoomId, Vec<EventJson<StateEvent>>>,
|
||||
|
||||
/// List of words which should be highlighted, useful for stemming which may
|
||||
/// change the query terms.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
@ -230,8 +235,10 @@ pub struct ResultGroup {
|
||||
/// results in this group.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub next_batch: Option<String>,
|
||||
|
||||
/// Key that can be used to order different groups.
|
||||
pub order: UInt,
|
||||
|
||||
/// Which results are in this group.
|
||||
pub results: Vec<EventId>,
|
||||
}
|
||||
@ -242,9 +249,11 @@ pub struct SearchResult {
|
||||
/// Context for result, if requested.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub context: Option<EventContextResult>,
|
||||
|
||||
/// A number that describes how closely this result matches the search. Higher is closer.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rank: Option<UInt>,
|
||||
|
||||
/// The event that matched.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub result: Option<EventJson<Event>>,
|
||||
@ -256,6 +265,7 @@ pub struct UserProfile {
|
||||
/// The user's avatar URL, if set.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub avatar_url: Option<String>,
|
||||
|
||||
/// The user's display name, if set.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub displayname: Option<String>,
|
||||
@ -266,6 +276,7 @@ pub struct UserProfile {
|
||||
pub enum RoomIdOrUserId {
|
||||
/// Represents a room ID.
|
||||
RoomId(RoomId),
|
||||
|
||||
/// Represents a user ID.
|
||||
UserId(UserId),
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ pub enum LoginType {
|
||||
/// A password is supplied to authenticate.
|
||||
#[serde(rename = "m.login.password")]
|
||||
Password,
|
||||
|
||||
/// Token-based login.
|
||||
#[serde(rename = "m.login.token")]
|
||||
Token,
|
||||
|
@ -20,12 +20,15 @@ ruma_api! {
|
||||
/// Identification information for the user.
|
||||
#[serde(flatten)]
|
||||
pub user: UserInfo,
|
||||
|
||||
/// The authentication mechanism.
|
||||
#[serde(flatten)]
|
||||
pub login_info: LoginInfo,
|
||||
|
||||
/// ID of the client device
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub device_id: Option<DeviceId>,
|
||||
|
||||
/// A display name to assign to the newly-created device. Ignored if device_id corresponds
|
||||
/// to a known device.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@ -35,19 +38,23 @@ ruma_api! {
|
||||
response {
|
||||
/// The fully-qualified Matrix ID that has been registered.
|
||||
pub user_id: UserId,
|
||||
|
||||
/// An access token for the account.
|
||||
pub access_token: String,
|
||||
|
||||
/// The hostname of the homeserver on which the account has been registered.
|
||||
///
|
||||
/// Deprecated: Clients should extract the server_name from user_id (by splitting at the
|
||||
/// first colon) if they require it.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub home_server: Option<String>,
|
||||
|
||||
/// ID of the logged-in device.
|
||||
///
|
||||
/// Will be the same as the corresponging parameter in the request, if one was
|
||||
/// specified.
|
||||
pub device_id: String,
|
||||
|
||||
/// Client configuration provided by the server.
|
||||
///
|
||||
/// If present, clients SHOULD use the provided object to reconfigure themselves.
|
||||
@ -64,18 +71,22 @@ pub enum UserInfo {
|
||||
/// Either a fully qualified Matrix user ID, or just the localpart (as part of the 'identifier'
|
||||
/// field).
|
||||
MatrixId(String),
|
||||
|
||||
/// Third party identifier (as part of the 'identifier' field).
|
||||
ThirdPartyId {
|
||||
/// Third party identifier for the user.
|
||||
address: String,
|
||||
|
||||
/// The medium of the identifier.
|
||||
medium: Medium,
|
||||
},
|
||||
|
||||
/// Same as third-party identification with medium == msisdn, but with a non-canonicalised
|
||||
/// phone number.
|
||||
PhoneNumber {
|
||||
/// The country that the phone number is from.
|
||||
country: String,
|
||||
|
||||
/// The phone number.
|
||||
phone: String,
|
||||
},
|
||||
@ -91,6 +102,7 @@ pub enum LoginInfo {
|
||||
/// The password.
|
||||
password: String,
|
||||
},
|
||||
|
||||
/// Token-based login.
|
||||
#[serde(rename = "m.login.token")]
|
||||
Token {
|
||||
@ -105,6 +117,7 @@ pub struct DiscoveryInfo {
|
||||
/// Information about the homeserver to connect to.
|
||||
#[serde(rename = "m.homeserver")]
|
||||
pub homeserver: HomeserverInfo,
|
||||
|
||||
/// Information about the identity server to connect to.
|
||||
#[serde(rename = "m.identity_server")]
|
||||
pub identity_server: Option<IdentityServerInfo>,
|
||||
|
@ -34,6 +34,7 @@ ruma_api! {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub filter: Option<Filter>,
|
||||
|
||||
/// A point in time to continue a sync from.
|
||||
///
|
||||
/// Should be a token from the `next_batch` field of a previous `/sync`
|
||||
@ -41,14 +42,17 @@ ruma_api! {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ruma_api(query)]
|
||||
pub since: Option<String>,
|
||||
|
||||
/// Controls whether to include the full state for all rooms the user is a member of.
|
||||
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
||||
#[ruma_api(query)]
|
||||
pub full_state: bool,
|
||||
|
||||
/// Controls whether the client is automatically marked as online by polling this API.
|
||||
#[serde(default, skip_serializing_if = "ruma_serde::is_default")]
|
||||
#[ruma_api(query)]
|
||||
pub set_presence: SetPresence,
|
||||
|
||||
/// The maximum time to poll in milliseconds before returning this request.
|
||||
#[serde(
|
||||
with = "ruma_serde::duration::opt_ms",
|
||||
@ -62,20 +66,26 @@ ruma_api! {
|
||||
response {
|
||||
/// The batch token to supply in the `since` param of the next `/sync` request.
|
||||
pub next_batch: String,
|
||||
|
||||
/// Updates to rooms.
|
||||
pub rooms: Rooms,
|
||||
|
||||
/// Updates to the presence status of other users.
|
||||
pub presence: Presence,
|
||||
|
||||
/// The global private data created by this user.
|
||||
pub account_data: AccountData,
|
||||
|
||||
/// Messages sent dirrectly between devices.
|
||||
#[serde(default, skip_serializing_if = "ToDevice::is_empty")]
|
||||
pub to_device: ToDevice,
|
||||
|
||||
/// Information on E2E device updates.
|
||||
///
|
||||
/// Only present on an incremental sync.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub device_lists: Option<DeviceLists>,
|
||||
|
||||
/// For each key algorithm, the number of unclaimed one-time keys
|
||||
/// currently held on the server for a device.
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
@ -91,8 +101,10 @@ ruma_api! {
|
||||
pub enum SetPresence {
|
||||
/// Do not set the presence of the user calling this API.
|
||||
Offline,
|
||||
|
||||
/// Mark client as online explicitly. Assumed by default.
|
||||
Online,
|
||||
|
||||
/// Mark client as being idle.
|
||||
Unavailable,
|
||||
}
|
||||
@ -121,6 +133,7 @@ pub enum Filter {
|
||||
#[serde(with = "ruma_serde::json_string")]
|
||||
/// A complete filter definition serialized to JSON.
|
||||
FilterDefinition(FilterDefinition),
|
||||
|
||||
/// The ID of a filter saved on the server.
|
||||
FilterId(String),
|
||||
}
|
||||
@ -130,8 +143,10 @@ pub enum Filter {
|
||||
pub struct Rooms {
|
||||
/// The rooms that the user has left or been banned from.
|
||||
pub leave: BTreeMap<RoomId, LeftRoom>,
|
||||
|
||||
/// The rooms that the user has joined.
|
||||
pub join: BTreeMap<RoomId, JoinedRoom>,
|
||||
|
||||
/// The rooms that the user has been invited to.
|
||||
pub invite: BTreeMap<RoomId, InvitedRoom>,
|
||||
}
|
||||
@ -142,8 +157,10 @@ pub struct LeftRoom {
|
||||
/// The timeline of messages and state changes in the room up to the point when the user
|
||||
/// left.
|
||||
pub timeline: Timeline,
|
||||
|
||||
/// The state updates for the room up to the start of the timeline.
|
||||
pub state: State,
|
||||
|
||||
/// The private data that this user has attached to this room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub account_data: Option<AccountData>,
|
||||
@ -155,17 +172,22 @@ pub struct JoinedRoom {
|
||||
/// Information about the room which clients may need to correctly render it
|
||||
/// to users.
|
||||
pub summary: RoomSummary,
|
||||
|
||||
/// Counts of unread notifications for this room.
|
||||
pub unread_notifications: UnreadNotificationsCount,
|
||||
|
||||
/// The timeline of messages and state changes in the room.
|
||||
pub timeline: Timeline,
|
||||
|
||||
/// Updates to the state, between the time indicated by the `since` parameter, and the start
|
||||
/// of the `timeline` (or all state up to the start of the `timeline`, if `since` is not
|
||||
/// given, or `full_state` is true).
|
||||
pub state: State,
|
||||
|
||||
/// The private data that this user has attached to this room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub account_data: Option<AccountData>,
|
||||
|
||||
/// The ephemeral events in the room that aren't recorded in the timeline or state of the
|
||||
/// room. e.g. typing.
|
||||
pub ephemeral: Ephemeral,
|
||||
@ -177,6 +199,7 @@ pub struct UnreadNotificationsCount {
|
||||
/// The number of unread notifications for this room with the highlight flag set.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub highlight_count: Option<UInt>,
|
||||
|
||||
/// The total number of unread notifications for this room.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub notification_count: Option<UInt>,
|
||||
@ -188,10 +211,12 @@ pub struct Timeline {
|
||||
/// True if the number of events returned was limited by the `limit` on the filter.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub limited: Option<bool>,
|
||||
|
||||
/// A token that can be supplied to to the `from` parameter of the
|
||||
/// `/rooms/{roomId}/messages` endpoint.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub prev_batch: Option<String>,
|
||||
|
||||
/// A list of events.
|
||||
pub events: Vec<EventJson<RoomEvent>>,
|
||||
}
|
||||
@ -224,6 +249,7 @@ pub struct RoomSummary {
|
||||
/// one. Required if room name or canonical aliases are not set or empty.
|
||||
#[serde(rename = "m.heroes", default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub heroes: Vec<String>,
|
||||
|
||||
/// Number of users whose membership status is `join`.
|
||||
/// Required if field has changed since last sync; otherwise, it may be
|
||||
/// omitted.
|
||||
@ -232,6 +258,7 @@ pub struct RoomSummary {
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub joined_member_count: Option<UInt>,
|
||||
|
||||
/// Number of users whose membership status is `invite`.
|
||||
/// Required if field has changed since last sync; otherwise, it may be
|
||||
/// omitted.
|
||||
@ -289,6 +316,7 @@ pub struct DeviceLists {
|
||||
/// share an encrypted room with the client since the previous sync
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub changed: Vec<String>,
|
||||
|
||||
/// List of users who no longer share encrypted rooms since the previous sync
|
||||
/// response.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
|
@ -18,12 +18,16 @@ use serde::{Deserialize, Serialize};
|
||||
pub struct Protocol {
|
||||
/// Fields which may be used to identify a third party user.
|
||||
pub user_fields: Vec<String>,
|
||||
|
||||
/// Fields which may be used to identify a third party location.
|
||||
pub location_fields: Vec<String>,
|
||||
|
||||
/// A content URI representing an icon for the third party protocol.
|
||||
pub icon: String,
|
||||
|
||||
/// The type definitions for the fields defined in `user_fields` and `location_fields`.
|
||||
pub field_types: BTreeMap<String, FieldType>,
|
||||
|
||||
/// A list of objects representing independent instances of configuration.
|
||||
pub instances: Vec<ProtocolInstance>,
|
||||
}
|
||||
@ -33,11 +37,14 @@ pub struct Protocol {
|
||||
pub struct ProtocolInstance {
|
||||
/// A human-readable description for the protocol, such as the name.
|
||||
pub desc: String,
|
||||
|
||||
/// An optional content URI representing the protocol.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub icon: Option<String>,
|
||||
|
||||
/// Preset values for `fields` the client may use to search by.
|
||||
pub fields: BTreeMap<String, String>,
|
||||
|
||||
/// A unique identifier across all instances.
|
||||
pub network_id: String,
|
||||
}
|
||||
@ -47,6 +54,7 @@ pub struct ProtocolInstance {
|
||||
pub struct FieldType {
|
||||
/// A regular expression for validation of a field's value.
|
||||
pub regexp: String,
|
||||
|
||||
/// A placeholder serving as a valid example of the field value.
|
||||
pub placeholder: String,
|
||||
}
|
||||
@ -56,8 +64,10 @@ pub struct FieldType {
|
||||
pub struct Location {
|
||||
/// An alias for a matrix room.
|
||||
pub alias: RoomAliasId,
|
||||
|
||||
/// The protocol ID that the third party location is a part of.
|
||||
pub protocol: String,
|
||||
|
||||
/// Information used to identify this third party location.
|
||||
pub fields: BTreeMap<String, String>,
|
||||
}
|
||||
@ -67,8 +77,10 @@ pub struct Location {
|
||||
pub struct User {
|
||||
/// A matrix user ID representing a third party user.
|
||||
pub userid: UserId,
|
||||
|
||||
/// The protocol ID that the third party user is a part of.
|
||||
pub protocol: String,
|
||||
|
||||
/// Information used to identify this third party user.
|
||||
pub fields: BTreeMap<String, String>,
|
||||
}
|
||||
@ -79,6 +91,7 @@ pub struct User {
|
||||
pub enum Medium {
|
||||
/// Email address identifier
|
||||
Email,
|
||||
|
||||
/// Phone number identifier
|
||||
MSISDN,
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ ruma_api! {
|
||||
/// The protocol used to communicate to the third party network.
|
||||
#[ruma_api(path)]
|
||||
pub protocol: String,
|
||||
|
||||
/// One or more custom fields to help identify the third party location.
|
||||
// The specification is incorrect for this parameter. See matrix-org/matrix-doc#2352.
|
||||
#[ruma_api(query_map)]
|
||||
|
1
src/r0/thirdparty/get_user_for_protocol.rs
vendored
1
src/r0/thirdparty/get_user_for_protocol.rs
vendored
@ -20,6 +20,7 @@ ruma_api! {
|
||||
/// The protocol used to communicate to the third party network.
|
||||
#[ruma_api(path)]
|
||||
pub protocol: String,
|
||||
|
||||
/// One or more custom fields that are passed to the AS to help identify the user.
|
||||
// The specification is incorrect for this parameter. See matrix-org/matrix-doc#2352.
|
||||
#[ruma_api(query_map)]
|
||||
|
@ -18,6 +18,7 @@ pub mod send_event_to_device;
|
||||
pub enum DeviceIdOrAllDevices {
|
||||
/// Represents a device Id for one of a user's devices.
|
||||
DeviceId(DeviceId),
|
||||
|
||||
/// Represents all devices for a user.
|
||||
AllDevices,
|
||||
}
|
||||
|
@ -22,9 +22,11 @@ ruma_api! {
|
||||
/// Type of event being sent to each device.
|
||||
#[ruma_api(path)]
|
||||
pub event_type: EventType,
|
||||
|
||||
/// A request identifier unique to the access token used to send the request.
|
||||
#[ruma_api(path)]
|
||||
pub txn_id: String,
|
||||
|
||||
/// A map of users to devices to a message event to be sent to the user's
|
||||
/// device. Individual message events can be sent to devices, but all
|
||||
/// events must be of the same type.
|
||||
|
@ -22,13 +22,16 @@ pub enum AuthData {
|
||||
/// The login type that the client is attempting to complete.
|
||||
#[serde(rename = "type")]
|
||||
kind: String,
|
||||
|
||||
/// The value of the session key given by the homeserver.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
session: Option<String>,
|
||||
|
||||
/// Parameters submitted for a particular authentication stage.
|
||||
#[serde(flatten)]
|
||||
auth_parameters: BTreeMap<String, JsonValue>,
|
||||
},
|
||||
|
||||
/// Used by the client to acknowledge that the user has completed a UIAA
|
||||
/// stage through the fallback method.
|
||||
FallbackAcknowledgement {
|
||||
@ -44,14 +47,18 @@ pub enum AuthData {
|
||||
pub struct UiaaInfo {
|
||||
/// List of authentication flows available for this endpoint.
|
||||
pub flows: Vec<AuthFlow>,
|
||||
|
||||
/// List of stages in the current flow completed by the client.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub completed: Vec<String>,
|
||||
|
||||
/// Authentication parameters required for the client to complete authentication.
|
||||
pub params: JsonValue,
|
||||
|
||||
/// Session key for client to use to complete authentication.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub session: Option<String>,
|
||||
|
||||
/// Authentication-related errors for previous request returned by homeserver.
|
||||
#[serde(flatten, skip_serializing_if = "Option::is_none")]
|
||||
pub auth_error: Option<ErrorBody>,
|
||||
@ -73,6 +80,7 @@ pub struct AuthFlow {
|
||||
pub enum UiaaResponse {
|
||||
/// User-Interactive Authentication API response
|
||||
AuthResponse(UiaaInfo),
|
||||
|
||||
/// Matrix error response
|
||||
MatrixError(MatrixError),
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ ruma_api! {
|
||||
request {
|
||||
/// The term to search for.
|
||||
pub search_term: String,
|
||||
|
||||
/// The maximum number of results to return.
|
||||
///
|
||||
/// Defaults to 10.
|
||||
@ -28,6 +29,7 @@ ruma_api! {
|
||||
response {
|
||||
/// Ordered by rank and then whether or not profile info is available.
|
||||
pub results: Vec<User>,
|
||||
|
||||
/// Indicates if the result list has been truncated by the limit.
|
||||
pub limited: bool,
|
||||
}
|
||||
@ -40,9 +42,11 @@ ruma_api! {
|
||||
pub struct User {
|
||||
/// The user's matrix user ID.
|
||||
pub user_id: UserId,
|
||||
|
||||
/// The display name of the user, if one exists.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub display_name: Option<String>,
|
||||
|
||||
/// The avatar url, as an MXC, if one exists.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub avatar_url: Option<String>,
|
||||
|
@ -19,6 +19,7 @@ ruma_api! {
|
||||
response {
|
||||
/// A list of Matrix client API protocol versions supported by the homeserver.
|
||||
pub versions: Vec<String>,
|
||||
|
||||
/// Experimental features supported by the server.
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub unstable_features: BTreeMap<String, bool>
|
||||
|
Loading…
x
Reference in New Issue
Block a user