Update create_message_event, create_state_event_*
This commit is contained in:
parent
bc9b43e03f
commit
b809db81f4
@ -1,8 +1,9 @@
|
||||
//! [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid)
|
||||
//! [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_events::{room::message::MessageEventContent, EventJson, EventType};
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -18,9 +19,11 @@ ruma_api! {
|
||||
/// The room to send the event to.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The type of event to send.
|
||||
#[ruma_api(path)]
|
||||
pub event_type: EventType,
|
||||
|
||||
/// The transaction ID for this event.
|
||||
///
|
||||
/// Clients should generate an ID unique across requests with the
|
||||
@ -28,14 +31,17 @@ ruma_api! {
|
||||
/// idempotency of requests.
|
||||
#[ruma_api(path)]
|
||||
pub txn_id: String,
|
||||
/// The event's content.
|
||||
|
||||
/// The event's content. The type for this field will be updated in a
|
||||
/// future release, until then you can create a value using
|
||||
/// `serde_json::value::to_raw_value`.
|
||||
#[ruma_api(body)]
|
||||
pub data: EventJson<MessageEventContent>,
|
||||
pub data: Box<RawJsonValue>,
|
||||
}
|
||||
|
||||
response {
|
||||
/// A unique identifier for the event.
|
||||
pub event_id: EventId,
|
||||
pub event_id: Option<EventId>,
|
||||
}
|
||||
|
||||
error: crate::Error
|
||||
|
@ -1,9 +1,9 @@
|
||||
//! [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype)
|
||||
//! [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-rooms-roomid-state-eventtype)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_json::Value as JsonValue;
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -19,17 +19,21 @@ ruma_api! {
|
||||
/// The room to set the state in.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The type of event to send.
|
||||
#[ruma_api(path)]
|
||||
pub event_type: EventType,
|
||||
/// The event's content.
|
||||
|
||||
/// The event's content. The type for this field will be updated in a
|
||||
/// future release, until then you can create a value using
|
||||
/// `serde_json::value::to_raw_value`.
|
||||
#[ruma_api(body)]
|
||||
pub data: JsonValue,
|
||||
pub data: Box<RawJsonValue>,
|
||||
}
|
||||
|
||||
response {
|
||||
/// A unique identifier for the event.
|
||||
pub event_id: EventId,
|
||||
pub event_id: Option<EventId>,
|
||||
}
|
||||
|
||||
error: crate::Error
|
||||
|
@ -1,9 +1,9 @@
|
||||
//! [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}](https://matrix.org/docs/spec/client_server/r0.4.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey)
|
||||
//! [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey)
|
||||
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_events::EventType;
|
||||
use ruma_identifiers::{EventId, RoomId};
|
||||
use serde_json::Value as JsonValue;
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
@ -19,20 +19,25 @@ ruma_api! {
|
||||
/// The room to set the state in.
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
|
||||
/// The type of event to send.
|
||||
#[ruma_api(path)]
|
||||
pub event_type: EventType,
|
||||
|
||||
/// The state_key for the state to send. Defaults to the empty string.
|
||||
#[ruma_api(path)]
|
||||
pub state_key: String,
|
||||
/// The event's content.
|
||||
|
||||
/// The event's content. The type for this field will be updated in a
|
||||
/// future release, until then you can create a value using
|
||||
/// `serde_json::value::to_raw_value`.
|
||||
#[ruma_api(body)]
|
||||
pub data: JsonValue,
|
||||
pub data: Box<RawJsonValue>,
|
||||
}
|
||||
|
||||
response {
|
||||
/// A unique identifier for the event.
|
||||
pub event_id: EventId,
|
||||
pub event_id: Option<EventId>,
|
||||
}
|
||||
|
||||
error: crate::Error
|
||||
|
Loading…
x
Reference in New Issue
Block a user