1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#include "login.h"
6
7using namespace Quotient;
8
9QUrl GetLoginFlowsJob::makeRequestUrl(QUrl baseUrl)
10{
11 return BaseJob::makeRequestUrl(baseUrl: std::move(baseUrl),
12 encodedPath: makePath(parts: "/_matrix/client/v3", parts: "/login"));
13}
14
15GetLoginFlowsJob::GetLoginFlowsJob()
16 : BaseJob(HttpVerb::Get, QStringLiteral("GetLoginFlowsJob"),
17 makePath(parts: "/_matrix/client/v3", parts: "/login"), false)
18{}
19
20LoginJob::LoginJob(const QString& type,
21 const Omittable<UserIdentifier>& identifier,
22 const QString& password, const QString& token,
23 const QString& deviceId,
24 const QString& initialDeviceDisplayName,
25 Omittable<bool> refreshToken)
26 : BaseJob(HttpVerb::Post, QStringLiteral("LoginJob"),
27 makePath(parts: "/_matrix/client/v3", parts: "/login"), false)
28{
29 QJsonObject _dataJson;
30 addParam<>(container&: _dataJson, QStringLiteral("type"), value: type);
31 addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("identifier"), value: identifier);
32 addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("password"), value: password);
33 addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("token"), value: token);
34 addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("device_id"), value: deviceId);
35 addParam<IfNotEmpty>(container&: _dataJson,
36 QStringLiteral("initial_device_display_name"),
37 value: initialDeviceDisplayName);
38 addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("refresh_token"),
39 value&: refreshToken);
40 setRequestData({ _dataJson });
41 addExpectedKey(key: "user_id");
42 addExpectedKey(key: "access_token");
43 addExpectedKey(key: "device_id");
44}
45