1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #pragma once |
6 | |
7 | #include <Quotient/jobs/basejob.h> |
8 | |
9 | namespace Quotient { |
10 | |
11 | /*! \brief Send a state event to the given room. |
12 | * |
13 | * State events can be sent using this endpoint. These events will be |
14 | * overwritten if `<room id>`, `<event type>` and `<state key>` all |
15 | * match. |
16 | * |
17 | * Requests to this endpoint **cannot use transaction IDs** |
18 | * like other `PUT` paths because they cannot be differentiated from the |
19 | * `state_key`. Furthermore, `POST` is unsupported on state paths. |
20 | * |
21 | * The body of the request should be the content object of the event; the |
22 | * fields in this object will vary depending on the type of event. See |
23 | * [Room Events](/client-server-api/#room-events) for the `m.` event |
24 | * specification. |
25 | * |
26 | * If the event type being sent is `m.room.canonical_alias` servers |
27 | * SHOULD ensure that any new aliases being listed in the event are valid |
28 | * per their grammar/syntax and that they point to the room ID where the |
29 | * state event is to be sent. Servers do not validate aliases which are |
30 | * being removed or are already present in the state event. |
31 | */ |
32 | class QUOTIENT_API SetRoomStateWithKeyJob : public BaseJob { |
33 | public: |
34 | /*! \brief Send a state event to the given room. |
35 | * |
36 | * \param roomId |
37 | * The room to set the state in |
38 | * |
39 | * \param eventType |
40 | * The type of event to send. |
41 | * |
42 | * \param stateKey |
43 | * The state_key for the state to send. Defaults to the empty string. When |
44 | * an empty string, the trailing slash on this endpoint is optional. |
45 | * |
46 | * \param body |
47 | * State events can be sent using this endpoint. These events will be |
48 | * overwritten if `<room id>`, `<event type>` and `<state key>` all |
49 | * match. |
50 | * |
51 | * Requests to this endpoint **cannot use transaction IDs** |
52 | * like other `PUT` paths because they cannot be differentiated from the |
53 | * `state_key`. Furthermore, `POST` is unsupported on state paths. |
54 | * |
55 | * The body of the request should be the content object of the event; the |
56 | * fields in this object will vary depending on the type of event. See |
57 | * [Room Events](/client-server-api/#room-events) for the `m.` event |
58 | * specification. |
59 | * |
60 | * If the event type being sent is `m.room.canonical_alias` servers |
61 | * SHOULD ensure that any new aliases being listed in the event are valid |
62 | * per their grammar/syntax and that they point to the room ID where the |
63 | * state event is to be sent. Servers do not validate aliases which are |
64 | * being removed or are already present in the state event. |
65 | */ |
66 | explicit SetRoomStateWithKeyJob(const QString& roomId, |
67 | const QString& eventType, |
68 | const QString& stateKey, |
69 | const QJsonObject& body = {}); |
70 | |
71 | // Result properties |
72 | |
73 | /// A unique identifier for the event. |
74 | QString eventId() const { return loadFromJson<QString>(keyName: "event_id"_ls ); } |
75 | }; |
76 | |
77 | } // namespace Quotient |
78 | |