| 1 | /****************************************************************************** |
| 2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
| 3 | */ |
| 4 | |
| 5 | #include "device_management.h" |
| 6 | |
| 7 | using namespace Quotient; |
| 8 | |
| 9 | QUrl GetDevicesJob::makeRequestUrl(QUrl baseUrl) |
| 10 | { |
| 11 | return BaseJob::makeRequestUrl(baseUrl: std::move(baseUrl), |
| 12 | encodedPath: makePath(parts: "/_matrix/client/v3" , parts: "/devices" )); |
| 13 | } |
| 14 | |
| 15 | GetDevicesJob::GetDevicesJob() |
| 16 | : BaseJob(HttpVerb::Get, QStringLiteral("GetDevicesJob" ), |
| 17 | makePath(parts: "/_matrix/client/v3" , parts: "/devices" )) |
| 18 | {} |
| 19 | |
| 20 | QUrl GetDeviceJob::makeRequestUrl(QUrl baseUrl, const QString& deviceId) |
| 21 | { |
| 22 | return BaseJob::makeRequestUrl(baseUrl: std::move(baseUrl), |
| 23 | encodedPath: makePath(parts: "/_matrix/client/v3" , parts: "/devices/" , |
| 24 | parts: deviceId)); |
| 25 | } |
| 26 | |
| 27 | GetDeviceJob::GetDeviceJob(const QString& deviceId) |
| 28 | : BaseJob(HttpVerb::Get, QStringLiteral("GetDeviceJob" ), |
| 29 | makePath(parts: "/_matrix/client/v3" , parts: "/devices/" , parts: deviceId)) |
| 30 | {} |
| 31 | |
| 32 | UpdateDeviceJob::UpdateDeviceJob(const QString& deviceId, |
| 33 | const QString& displayName) |
| 34 | : BaseJob(HttpVerb::Put, QStringLiteral("UpdateDeviceJob" ), |
| 35 | makePath(parts: "/_matrix/client/v3" , parts: "/devices/" , parts: deviceId)) |
| 36 | { |
| 37 | QJsonObject _dataJson; |
| 38 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("display_name" ), value: displayName); |
| 39 | setRequestData({ _dataJson }); |
| 40 | } |
| 41 | |
| 42 | DeleteDeviceJob::DeleteDeviceJob(const QString& deviceId, |
| 43 | const Omittable<AuthenticationData>& auth) |
| 44 | : BaseJob(HttpVerb::Delete, QStringLiteral("DeleteDeviceJob" ), |
| 45 | makePath(parts: "/_matrix/client/v3" , parts: "/devices/" , parts: deviceId)) |
| 46 | { |
| 47 | QJsonObject _dataJson; |
| 48 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("auth" ), value: auth); |
| 49 | setRequestData({ _dataJson }); |
| 50 | } |
| 51 | |
| 52 | DeleteDevicesJob::DeleteDevicesJob(const QStringList& devices, |
| 53 | const Omittable<AuthenticationData>& auth) |
| 54 | : BaseJob(HttpVerb::Post, QStringLiteral("DeleteDevicesJob" ), |
| 55 | makePath(parts: "/_matrix/client/v3" , parts: "/delete_devices" )) |
| 56 | { |
| 57 | QJsonObject _dataJson; |
| 58 | addParam<>(container&: _dataJson, QStringLiteral("devices" ), value: devices); |
| 59 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("auth" ), value: auth); |
| 60 | setRequestData({ _dataJson }); |
| 61 | } |
| 62 | |