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

#include "cross_signing.h"

using namespace Quotient;

UploadCrossSigningKeysJob::UploadCrossSigningKeysJob(
    const Omittable<CrossSigningKey>& masterKey,
    const Omittable<CrossSigningKey>& selfSigningKey,
    const Omittable<CrossSigningKey>& userSigningKey,
    const Omittable<AuthenticationData>& auth)
    : BaseJob(HttpVerb::Post, QStringLiteral("UploadCrossSigningKeysJob"),
              makePath("/_matrix/client/v3", "/keys/device_signing/upload"))
{
    QJsonObject _data;
    addParam<IfNotEmpty>(_data, QStringLiteral("master_key"), masterKey);
    addParam<IfNotEmpty>(_data, QStringLiteral("self_signing_key"),
                         selfSigningKey);
    addParam<IfNotEmpty>(_data, QStringLiteral("user_signing_key"),
                         userSigningKey);
    addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth);
    setRequestData(std::move(_data));
}

UploadCrossSigningSignaturesJob::UploadCrossSigningSignaturesJob(
    const QHash<QString, QHash<QString, QJsonObject>>& signatures)
    : BaseJob(HttpVerb::Post, QStringLiteral("UploadCrossSigningSignaturesJob"),
              makePath("/_matrix/client/v3", "/keys/signatures/upload"))
{
    setRequestData(RequestData(toJson(signatures)));
}