use ruma_api::ruma_api;
use ruma_common::push::Action;
use super::RuleKind;
ruma_api! {
metadata: {
description: "This endpoint get the actions for the specified push rule.",
method: GET,
name: "get_pushrule_actions",
path: "/_matrix/client/r0/pushrules/:scope/:kind/:rule_id/actions",
rate_limited: false,
authentication: AccessToken,
}
request: {
#[ruma_api(path)]
pub scope: &'a str,
#[ruma_api(path)]
pub kind: RuleKind,
#[ruma_api(path)]
pub rule_id: &'a str,
}
response: {
pub actions: Vec<Action>
}
error: crate::Error
}
impl<'a> Request<'a> {
pub fn new(scope: &'a str, kind: RuleKind, rule_id: &'a str) -> Self {
Self { scope, kind, rule_id }
}
}
impl Response {
pub fn new(actions: Vec<Action>) -> Self {
Self { actions }
}
}