ruma_appservice_api/ping/send_ping.rs
1//! `PUT /_matrix/app/*/ping`
2//!
3//! Endpoint to ping the application service.
4
5pub mod v1 {
6 //! `/v1/` ([spec])
7 //!
8 //! [spec]: https://spec.matrix.org/latest/application-service-api/#post_matrixappv1ping
9
10 use ruma_common::{
11 api::{request, response, Metadata},
12 metadata, OwnedTransactionId,
13 };
14
15 const METADATA: Metadata = metadata! {
16 method: POST,
17 rate_limited: false,
18 authentication: AccessToken,
19 history: {
20 unstable => "/_matrix/app/unstable/fi.mau.msc2659/ping",
21 1.7 => "/_matrix/app/v1/ping",
22 }
23 };
24
25 /// Request type for the `send_ping` endpoint.
26 #[request]
27 #[derive(Default)]
28 pub struct Request {
29 /// A transaction ID for the ping, copied directly from the `POST
30 /// /_matrix/client/v1/appservice/{appserviceId}/ping` call.
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub transaction_id: Option<OwnedTransactionId>,
33 }
34
35 /// Response type for the `send_ping` endpoint.
36 #[response]
37 #[derive(Default)]
38 pub struct Response {}
39
40 impl Request {
41 /// Creates a new empty `Request`.
42 pub fn new() -> Self {
43 Self::default()
44 }
45 }
46
47 impl Response {
48 /// Creates a new empty `Response`.
49 pub fn new() -> Self {
50 Self::default()
51 }
52 }
53}