| 1 | /****************************************************************************** |
| 2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
| 3 | */ |
| 4 | |
| 5 | #pragma once |
| 6 | |
| 7 | #include <Quotient/jobs/basejob.h> |
| 8 | |
| 9 | namespace Quotient { |
| 10 | |
| 11 | /*! \brief List the tags for a room. |
| 12 | * |
| 13 | * List the tags set by a user on a room. |
| 14 | */ |
| 15 | class QUOTIENT_API GetRoomTagsJob : public BaseJob { |
| 16 | public: |
| 17 | // Inner data structures |
| 18 | |
| 19 | /// List the tags set by a user on a room. |
| 20 | struct Tag { |
| 21 | /// A number in a range `[0,1]` describing a relative |
| 22 | /// position of the room under the given tag. |
| 23 | Omittable<float> order{}; |
| 24 | /// List the tags set by a user on a room. |
| 25 | QVariantHash additionalProperties{}; |
| 26 | }; |
| 27 | |
| 28 | // Construction/destruction |
| 29 | |
| 30 | /*! \brief List the tags for a room. |
| 31 | * |
| 32 | * \param userId |
| 33 | * The id of the user to get tags for. The access token must be |
| 34 | * authorized to make requests for this user ID. |
| 35 | * |
| 36 | * \param roomId |
| 37 | * The ID of the room to get tags for. |
| 38 | */ |
| 39 | explicit GetRoomTagsJob(const QString& userId, const QString& roomId); |
| 40 | |
| 41 | /*! \brief Construct a URL without creating a full-fledged job object |
| 42 | * |
| 43 | * This function can be used when a URL for GetRoomTagsJob |
| 44 | * is necessary but the job itself isn't. |
| 45 | */ |
| 46 | static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, |
| 47 | const QString& roomId); |
| 48 | |
| 49 | // Result properties |
| 50 | |
| 51 | /// List the tags set by a user on a room. |
| 52 | QHash<QString, Tag> tags() const |
| 53 | { |
| 54 | return loadFromJson<QHash<QString, Tag>>(keyName: "tags"_ls ); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | template <> |
| 59 | struct JsonObjectConverter<GetRoomTagsJob::Tag> { |
| 60 | static void fillFrom(QJsonObject jo, GetRoomTagsJob::Tag& result) |
| 61 | { |
| 62 | fillFromJson(jv: jo.take(key: "order"_ls ), pod&: result.order); |
| 63 | fromJson(json: jo, pod&: result.additionalProperties); |
| 64 | } |
| 65 | }; |
| 66 | |
| 67 | /*! \brief Add a tag to a room. |
| 68 | * |
| 69 | * Add a tag to the room. |
| 70 | */ |
| 71 | class QUOTIENT_API SetRoomTagJob : public BaseJob { |
| 72 | public: |
| 73 | /*! \brief Add a tag to a room. |
| 74 | * |
| 75 | * \param userId |
| 76 | * The id of the user to add a tag for. The access token must be |
| 77 | * authorized to make requests for this user ID. |
| 78 | * |
| 79 | * \param roomId |
| 80 | * The ID of the room to add a tag to. |
| 81 | * |
| 82 | * \param tag |
| 83 | * The tag to add. |
| 84 | * |
| 85 | * \param order |
| 86 | * A number in a range `[0,1]` describing a relative |
| 87 | * position of the room under the given tag. |
| 88 | * |
| 89 | * \param additionalProperties |
| 90 | * Add a tag to the room. |
| 91 | */ |
| 92 | explicit SetRoomTagJob(const QString& userId, const QString& roomId, |
| 93 | const QString& tag, Omittable<float> order = none, |
| 94 | const QVariantHash& additionalProperties = {}); |
| 95 | }; |
| 96 | |
| 97 | /*! \brief Remove a tag from the room. |
| 98 | * |
| 99 | * Remove a tag from the room. |
| 100 | */ |
| 101 | class QUOTIENT_API DeleteRoomTagJob : public BaseJob { |
| 102 | public: |
| 103 | /*! \brief Remove a tag from the room. |
| 104 | * |
| 105 | * \param userId |
| 106 | * The id of the user to remove a tag for. The access token must be |
| 107 | * authorized to make requests for this user ID. |
| 108 | * |
| 109 | * \param roomId |
| 110 | * The ID of the room to remove a tag from. |
| 111 | * |
| 112 | * \param tag |
| 113 | * The tag to remove. |
| 114 | */ |
| 115 | explicit DeleteRoomTagJob(const QString& userId, const QString& roomId, |
| 116 | const QString& tag); |
| 117 | |
| 118 | /*! \brief Construct a URL without creating a full-fledged job object |
| 119 | * |
| 120 | * This function can be used when a URL for DeleteRoomTagJob |
| 121 | * is necessary but the job itself isn't. |
| 122 | */ |
| 123 | static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, |
| 124 | const QString& roomId, const QString& tag); |
| 125 | }; |
| 126 | |
| 127 | } // namespace Quotient |
| 128 | |