1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include <Quotient/csapi/definitions/auth_data.h>
8#include <Quotient/csapi/definitions/cross_signing_key.h>
9
10#include <Quotient/jobs/basejob.h>
11
12namespace Quotient {
13
14/*! \brief Upload cross-signing keys.
15 *
16 * Publishes cross-signing keys for the user.
17 *
18 * This API endpoint uses the [User-Interactive Authentication
19 * API](/client-server-api/#user-interactive-authentication-api).
20 */
21class QUOTIENT_API UploadCrossSigningKeysJob : public BaseJob {
22public:
23 /*! \brief Upload cross-signing keys.
24 *
25 * \param masterKey
26 * Optional. The user\'s master key.
27 *
28 * \param selfSigningKey
29 * Optional. The user\'s self-signing key. Must be signed by
30 * the accompanying master key, or by the user\'s most recently
31 * uploaded master key if no master key is included in the
32 * request.
33 *
34 * \param userSigningKey
35 * Optional. The user\'s user-signing key. Must be signed by
36 * the accompanying master key, or by the user\'s most recently
37 * uploaded master key if no master key is included in the
38 * request.
39 *
40 * \param auth
41 * Additional authentication information for the
42 * user-interactive authentication API.
43 */
44 explicit UploadCrossSigningKeysJob(
45 const Omittable<CrossSigningKey>& masterKey = none,
46 const Omittable<CrossSigningKey>& selfSigningKey = none,
47 const Omittable<CrossSigningKey>& userSigningKey = none,
48 const Omittable<AuthenticationData>& auth = none);
49};
50
51/*! \brief Upload cross-signing signatures.
52 *
53 * Publishes cross-signing signatures for the user.
54 *
55 * The request body is a map from user ID to key ID to signed JSON object.
56 * The signed JSON object must match the key previously uploaded or
57 * retrieved for the given key ID, with the exception of the `signatures`
58 * property, which contains the new signature(s) to add.
59 */
60class QUOTIENT_API UploadCrossSigningSignaturesJob : public BaseJob {
61public:
62 /*! \brief Upload cross-signing signatures.
63 *
64 * \param signatures
65 * A map from user ID to key ID to signed JSON objects containing the
66 * signatures to be published.
67 */
68 explicit UploadCrossSigningSignaturesJob(
69 const QHash<QString, QHash<QString, QJsonObject>>& signatures);
70
71 // Result properties
72
73 /// A map from user ID to key ID to an error for any signatures
74 /// that failed. If a signature was invalid, the `errcode` will
75 /// be set to `M_INVALID_SIGNATURE`.
76 QHash<QString, QHash<QString, QJsonObject>> failures() const
77 {
78 return loadFromJson<QHash<QString, QHash<QString, QJsonObject>>>(
79 keyName: "failures"_ls);
80 }
81};
82
83} // namespace Quotient
84