client-api: Update more endpoints to new API conventions
This commit is contained in:
parent
a674afe512
commit
157957ced6
@ -13,6 +13,7 @@ ruma_api! {
|
|||||||
requires_authentication: true,
|
requires_authentication: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
request: {
|
request: {
|
||||||
/// The room alias to set.
|
/// The room alias to set.
|
||||||
#[ruma_api(path)]
|
#[ruma_api(path)]
|
||||||
@ -22,7 +23,22 @@ ruma_api! {
|
|||||||
pub room_id: &'a RoomId,
|
pub room_id: &'a RoomId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
response: {}
|
response: {}
|
||||||
|
|
||||||
error: crate::Error
|
error: crate::Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> Request<'a> {
|
||||||
|
/// Creates a new `Request` with the given room alias and room id.
|
||||||
|
pub fn new(room_alias: &'a RoomAliasId, room_id: &'a RoomId) -> Self {
|
||||||
|
Self { room_alias, room_id }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates an empty `Response`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -13,13 +13,29 @@ ruma_api! {
|
|||||||
requires_authentication: true,
|
requires_authentication: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
request: {
|
request: {
|
||||||
/// The room alias to remove.
|
/// The room alias to remove.
|
||||||
#[ruma_api(path)]
|
#[ruma_api(path)]
|
||||||
pub room_alias: &'a RoomAliasId,
|
pub room_alias: &'a RoomAliasId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
response: {}
|
response: {}
|
||||||
|
|
||||||
error: crate::Error
|
error: crate::Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> Request<'a> {
|
||||||
|
/// Creates a new `Request` with the given room alias.
|
||||||
|
pub fn new(room_alias: &'a RoomAliasId) -> Self {
|
||||||
|
Self { room_alias }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates an empty `Response`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -13,12 +13,14 @@ ruma_api! {
|
|||||||
requires_authentication: true,
|
requires_authentication: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
request: {
|
request: {
|
||||||
/// The room alias.
|
/// The room alias.
|
||||||
#[ruma_api(path)]
|
#[ruma_api(path)]
|
||||||
pub room_alias: &'a RoomAliasId,
|
pub room_alias: &'a RoomAliasId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
response: {
|
response: {
|
||||||
/// The room ID for this room alias.
|
/// The room ID for this room alias.
|
||||||
pub room_id: RoomId,
|
pub room_id: RoomId,
|
||||||
|
@ -114,6 +114,13 @@ impl Request {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates a `Response` with the given room id.
|
||||||
|
pub fn new(room_id: RoomId) -> Self {
|
||||||
|
Self { room_id }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Extra options to be added to the `m.room.create` event.
|
/// Extra options to be added to the `m.room.create` event.
|
||||||
///
|
///
|
||||||
/// This is the same as the event content struct for `m.room.create`, but without some fields that
|
/// This is the same as the event content struct for `m.room.create`, but without some fields that
|
||||||
|
@ -13,8 +13,10 @@ ruma_api! {
|
|||||||
requires_authentication: false,
|
requires_authentication: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
request: {}
|
request: {}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
response: {
|
response: {
|
||||||
/// The homeserver's supported login types.
|
/// The homeserver's supported login types.
|
||||||
pub flows: Vec<LoginType>
|
pub flows: Vec<LoginType>
|
||||||
@ -23,6 +25,20 @@ ruma_api! {
|
|||||||
error: crate::Error
|
error: crate::Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Request {
|
||||||
|
/// Creates an empty `Request`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates a new `Response` with the given login types.
|
||||||
|
pub fn new(flows: Vec<LoginType>) -> Self {
|
||||||
|
Self { flows }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// An authentication mechanism.
|
/// An authentication mechanism.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
|
@ -12,9 +12,25 @@ ruma_api! {
|
|||||||
requires_authentication: true,
|
requires_authentication: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
request: {}
|
request: {}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
response: {}
|
response: {}
|
||||||
|
|
||||||
error: crate::Error
|
error: crate::Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Request {
|
||||||
|
/// Creates an empty `Request`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates an empty `Response`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -12,9 +12,25 @@ ruma_api! {
|
|||||||
requires_authentication: true,
|
requires_authentication: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
request: {}
|
request: {}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
response: {}
|
response: {}
|
||||||
|
|
||||||
error: crate::Error
|
error: crate::Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Request {
|
||||||
|
/// Creates an empty `Request`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Response {
|
||||||
|
/// Creates an empty `Response`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user