/****************************************************************************** * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN */ #pragma once #include "jobs/basejob.h" namespace Quotient { /*! \brief Create a new room * * Create a new room with various configuration options. * * The server MUST apply the normal state resolution rules when creating * the new room, including checking power levels for each event. It MUST * apply the events implied by the request in the following order: * * 1. The ``m.room.create`` event itself. Must be the first event in the * room. * * 2. An ``m.room.member`` event for the creator to join the room. This is * needed so the remaining events can be sent. * * 3. A default ``m.room.power_levels`` event, giving the room creator * (and not other members) permission to send state events. Overridden * by the ``power_level_content_override`` parameter. * * 4. Events set by the ``preset``. Currently these are the * ``m.room.join_rules``, * ``m.room.history_visibility``, and ``m.room.guest_access`` state events. * * 5. Events listed in ``initial_state``, in the order that they are * listed. * * 6. Events implied by ``name`` and ``topic`` (``m.room.name`` and * ``m.room.topic`` state events). * * 7. Invite events implied by ``invite`` and ``invite_3pid`` (``m.room.member`` * with * ``membership: invite`` and ``m.room.third_party_invite``). * * The available presets do the following with respect to room state: * * ======================== ============== ====================== * ================ ========= Preset ``join_rules`` * ``history_visibility`` ``guest_access`` Other * ======================== ============== ====================== * ================ ========= * ``private_chat`` ``invite`` ``shared`` ``can_join`` * ``trusted_private_chat`` ``invite`` ``shared`` ``can_join`` All * invitees are given the same power level as the room creator. * ``public_chat`` ``public`` ``shared`` ``forbidden`` * ======================== ============== ====================== * ================ ========= * * The server will create a ``m.room.create`` event in the room with the * requesting user as the creator, alongside other keys provided in the * ``creation_content``. */ class CreateRoomJob : public BaseJob { public: // Inner data structures /// Create a new room with various configuration options. /// /// The server MUST apply the normal state resolution rules when creating /// the new room, including checking power levels for each event. It MUST /// apply the events implied by the request in the following order: /// /// 1. The ``m.room.create`` event itself. Must be the first event in the /// room. /// /// 2. An ``m.room.member`` event for the creator to join the room. This is /// needed so the remaining events can be sent. /// /// 3. A default ``m.room.power_levels`` event, giving the room creator /// (and not other members) permission to send state events. Overridden /// by the ``power_level_content_override`` parameter. /// /// 4. Events set by the ``preset``. Currently these are the /// ``m.room.join_rules``, /// ``m.room.history_visibility``, and ``m.room.guest_access`` state /// events. /// /// 5. Events listed in ``initial_state``, in the order that they are /// listed. /// /// 6. Events implied by ``name`` and ``topic`` (``m.room.name`` and /// ``m.room.topic`` /// state events). /// /// 7. Invite events implied by ``invite`` and ``invite_3pid`` /// (``m.room.member`` with /// ``membership: invite`` and ``m.room.third_party_invite``). /// /// The available presets do the following with respect to room state: /// /// ======================== ============== ====================== /// ================ ========= /// Preset `
/******************************************************************************
 * 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)
    : BaseJob(HttpVerb::Post, QStringLiteral("UploadCrossSigningKeysJob"),
              makePath("/_matrix/client/r0", "/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);
    setRequestData(std::move(_data));
}

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