aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/to_device.h
blob: 1444543972f624f7fdef7523de7a0d477d8fc695 (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
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "jobs/basejob.h"

#include <QtCore/QHash>
#include <QtCore/QJsonObject>

namespace Quotient
{

// Operations

/// Send an event to a given set of devices.
/*!
 * This endpoint is used to send send-to-device events to a set of
 * client devices.
 */
class SendToDeviceJob : public BaseJob
{
public:
    /*! Send an event to a given set of devices.
     * \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 messages
     *   The messages to send. A map from user ID, to a map from
     *   device ID to message body. The device ID may also be `*`,
     *   meaning all known devices for the user.
     */
    explicit SendToDeviceJob(
        const QString& eventType, const QString& txnId,
        const QHash<QString, QHash<QString, QJsonObject>>& messages = {});
};

} // namespace Quotient