client-api: Split push::Pusher in two
The definitions for the get and set endpoint are different.
This commit is contained in:
parent
10adf0c0c0
commit
9f815facc5
@ -181,36 +181,6 @@ pub enum RuleKind {
|
|||||||
_Custom(String),
|
_Custom(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defines a pusher.
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
||||||
pub struct Pusher {
|
|
||||||
/// This is a unique identifier for this pusher. Max length, 512 bytes.
|
|
||||||
pub pushkey: String,
|
|
||||||
|
|
||||||
/// The kind of the pusher. If set to None in a call to set_pusher, this
|
|
||||||
/// will delete the pusher
|
|
||||||
pub kind: Option<PusherKind>,
|
|
||||||
|
|
||||||
/// This is a reverse-DNS style identifier for the application. Max length, 64 chars.
|
|
||||||
pub app_id: String,
|
|
||||||
|
|
||||||
/// A string that will allow the user to identify what application owns this pusher.
|
|
||||||
pub app_display_name: String,
|
|
||||||
|
|
||||||
/// A string that will allow the user to identify what device owns this pusher.
|
|
||||||
pub device_display_name: String,
|
|
||||||
|
|
||||||
/// This string determines which set of device specific rules this pusher executes.
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
|
||||||
pub profile_tag: Option<String>,
|
|
||||||
|
|
||||||
/// The preferred language for receiving notifications (e.g. 'en' or 'en-US')
|
|
||||||
pub lang: String,
|
|
||||||
|
|
||||||
/// Information for the pusher implementation itself.
|
|
||||||
pub data: PusherData,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Which kind a pusher is.
|
/// Which kind a pusher is.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
|
||||||
#[ruma_enum(rename_all = "snake_case")]
|
#[ruma_enum(rename_all = "snake_case")]
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
//! [GET /_matrix/client/r0/pushers](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-pushers)
|
//! [GET /_matrix/client/r0/pushers](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-pushers)
|
||||||
|
|
||||||
use ruma_api::ruma_api;
|
use ruma_api::ruma_api;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use super::Pusher;
|
use super::{PusherData, PusherKind};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata: {
|
metadata: {
|
||||||
@ -38,3 +39,32 @@ impl Response {
|
|||||||
Self { pushers }
|
Self { pushers }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Defines a pusher.
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct Pusher {
|
||||||
|
/// This is a unique identifier for this pusher. Max length, 512 bytes.
|
||||||
|
pub pushkey: String,
|
||||||
|
|
||||||
|
/// The kind of the pusher.
|
||||||
|
pub kind: PusherKind,
|
||||||
|
|
||||||
|
/// This is a reverse-DNS style identifier for the application. Max length, 64 chars.
|
||||||
|
pub app_id: String,
|
||||||
|
|
||||||
|
/// A string that will allow the user to identify what application owns this pusher.
|
||||||
|
pub app_display_name: String,
|
||||||
|
|
||||||
|
/// A string that will allow the user to identify what device owns this pusher.
|
||||||
|
pub device_display_name: String,
|
||||||
|
|
||||||
|
/// This string determines which set of device specific rules this pusher executes.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub profile_tag: Option<String>,
|
||||||
|
|
||||||
|
/// The preferred language for receiving notifications (e.g. 'en' or 'en-US')
|
||||||
|
pub lang: String,
|
||||||
|
|
||||||
|
/// Information for the pusher implementation itself.
|
||||||
|
pub data: PusherData,
|
||||||
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
//! [POST /_matrix/client/r0/pushers/set](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-pushers-set)
|
//! [POST /_matrix/client/r0/pushers/set](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-pushers-set)
|
||||||
|
|
||||||
use ruma_api::ruma_api;
|
use ruma_api::ruma_api;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use super::Pusher;
|
use super::{PusherData, PusherKind};
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata: {
|
metadata: {
|
||||||
@ -45,3 +46,32 @@ impl Response {
|
|||||||
Self
|
Self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Defines a pusher.
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct Pusher {
|
||||||
|
/// This is a unique identifier for this pusher. Max length, 512 bytes.
|
||||||
|
pub pushkey: String,
|
||||||
|
|
||||||
|
/// The kind of the pusher. `None` deletes the pusher.
|
||||||
|
pub kind: Option<PusherKind>,
|
||||||
|
|
||||||
|
/// This is a reverse-DNS style identifier for the application. Max length, 64 chars.
|
||||||
|
pub app_id: String,
|
||||||
|
|
||||||
|
/// A string that will allow the user to identify what application owns this pusher.
|
||||||
|
pub app_display_name: String,
|
||||||
|
|
||||||
|
/// A string that will allow the user to identify what device owns this pusher.
|
||||||
|
pub device_display_name: String,
|
||||||
|
|
||||||
|
/// This string determines which set of device specific rules this pusher executes.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub profile_tag: Option<String>,
|
||||||
|
|
||||||
|
/// The preferred language for receiving notifications (e.g. 'en' or 'en-US')
|
||||||
|
pub lang: String,
|
||||||
|
|
||||||
|
/// Information for the pusher implementation itself.
|
||||||
|
pub data: PusherData,
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user