git-subtree-dir: ruma-appservice-api git-subtree-mainline: b76327f5220e96822889878d5fce1d03db0b55d2 git-subtree-split: 890cf1397304892fd690e74205c1055d6f49455a
29 lines
921 B
Rust
29 lines
921 B
Rust
//! [PUT /_matrix/app/v1/transactions/{txnId}](https://matrix.org/docs/spec/application_service/r0.1.2#put-matrix-app-v1-transactions-txnid)
|
|
|
|
use ruma_api::ruma_api;
|
|
use ruma_events::{collections::all, EventJson};
|
|
|
|
ruma_api! {
|
|
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",
|
|
path: "/_matrix/app/v1/transactions/:txn_id",
|
|
rate_limited: false,
|
|
requires_authentication: true,
|
|
}
|
|
|
|
request {
|
|
/// The transaction ID for this set of events.
|
|
///
|
|
/// Homeservers generate these IDs and they are used to ensure idempotency of results.
|
|
#[ruma_api(path)]
|
|
pub txn_id: String,
|
|
/// A list of events.
|
|
#[ruma_api(body)]
|
|
pub events: Vec<EventJson<all::Event>>,
|
|
}
|
|
|
|
response {}
|
|
}
|