/****************************************************************************** * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN */ #pragma once #include "jobs/basejob.h" #include namespace Quotient { // Operations /// Send a message event to the given room. /*! * This endpoint is used to send a message event to a room. Message events * allow access to historical events and pagination, making them suited * for "once-off" activity in a room. * * The body of the request should be the content object of the event; the * fields in this object will vary depending on the type of event. See * `Room Events`_ for the m. event specification. */ class SendMessageJob : public BaseJob { public: /*! Send a message event to the given room. * \param roomId * The room to send the event to. * \param eventType * The type of event to send. * \param txnId * The transaction ID for this event. Clients should generate an * ID unique across requests with the same access token; it will be * used by the server to ensure idempotency of requests. * \param body * This endpoint is used to send a message event to a room. Message events * allow access to historical events and pagination, making them suited * for "once-off" activity in a room. * * The body of the request should be the content object of the event; the * fields in this object will vary depending on the type of event. See * `Room Events`_ for the m. event specification. */ explicit SendMessageJob(const QString& roomId, const QString& eventType, const QString& txnId, const QJsonObject& body = {}); ~SendMessageJob() override; // Result properties /// A unique identifier for the event. const QString& eventId() const; protected: Status parseJson(const QJsonDocument& data) override; private: class Private; QScopedPointer d; }; } // namespace Quotient openid_token.h'>
blob: 3c447321702511c1c5a51e63ea02c44ec30627c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "converters.h"

namespace Quotient {

struct OpenidToken {
    /// An access token the consumer may use to verify the identity of
    /// the person who generated the token. This is given to the federation
    /// API `GET /openid/userinfo` to verify the user's identity.
    QString accessToken;

    /// The string `Bearer`.
    QString tokenType;

    /// The homeserver domain the consumer should use when attempting to
    /// verify the user's identity.
    QString matrixServerName;

    /// The number of seconds before this token expires and a new one must
    /// be generated.
    int expiresIn;
};

template <>
struct JsonObjectConverter<OpenidToken> {
    static void dumpTo(QJsonObject& jo, const OpenidToken& pod)
    {
        addParam<>(jo, QStringLiteral("access_token"), pod.accessToken);
        addParam<>(jo, QStringLiteral("token_type"), pod.tokenType);
        addParam<>(jo, QStringLiteral("matrix_server_name"),
                   pod.matrixServerName);
        addParam<>(jo, QStringLiteral("expires_in"), pod.expiresIn);
    }
    static void fillFrom(const QJsonObject& jo, OpenidToken& pod)
    {
        fromJson(jo.value("access_token"_ls), pod.accessToken);
        fromJson(jo.value("token_type"_ls), pod.tokenType);
        fromJson(jo.value("matrix_server_name"_ls), pod.matrixServerName);
        fromJson(jo.value("expires_in"_ls), pod.expiresIn);
    }
};

} // namespace Quotient