aboutsummaryrefslogtreecommitdiff
path: root/jobs/generated/administrative_contact.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-05 19:46:41 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-05 19:57:52 +0900
commitccf2b4dd9d41b39167379669f035b45d656e3633 (patch)
treea6afb913b58409335809f8ea6a33dd7a16c3f2ca /jobs/generated/administrative_contact.cpp
parentea5cd86a9deacc9a6b57f1c432ad6e51e92de428 (diff)
downloadlibquotient-ccf2b4dd9d41b39167379669f035b45d656e3633.tar.gz
libquotient-ccf2b4dd9d41b39167379669f035b45d656e3633.zip
jobs: expect application/json by default; set query in constructor body; properly convert numbers to strings in query
The query should be set in constructor body because there's no reason to pass non-required parameters into the query. As for numbers to strings conversion - there was an attempt to use QJsonValue(a).toString() for that. That doesn't work; QJsonValue does not turn numbers to strings.
Diffstat (limited to 'jobs/generated/administrative_contact.cpp')
-rw-r--r--jobs/generated/administrative_contact.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/jobs/generated/administrative_contact.cpp b/jobs/generated/administrative_contact.cpp
index 584c447f..479bee52 100644
--- a/jobs/generated/administrative_contact.cpp
+++ b/jobs/generated/administrative_contact.cpp
@@ -44,10 +44,10 @@ class GetAccount3PIDsJob::Private
GetAccount3PIDsJob::GetAccount3PIDsJob()
: BaseJob(HttpVerb::Get, "GetAccount3PIDsJob",
- basePath % "/account/3pid",
- Query { }
- ), d(new Private)
-{ }
+ basePath % "/account/3pid")
+ , d(new Private)
+{
+}
GetAccount3PIDsJob::~GetAccount3PIDsJob() = default;
@@ -94,22 +94,17 @@ namespace QMatrixClient
Post3PIDsJob::Post3PIDsJob(const ThreePidCredentials& threePidCreds, bool bind)
: BaseJob(HttpVerb::Post, "Post3PIDsJob",
- basePath % "/account/3pid",
- Query { }
- )
+ basePath % "/account/3pid")
{
QJsonObject _data;
_data.insert("three_pid_creds", toJson(threePidCreds));
_data.insert("bind", toJson(bind));
setRequestData(_data);
-
- addExpectedContentType("application/json");
}
RequestTokenTo3PIDJob::RequestTokenTo3PIDJob()
: BaseJob(HttpVerb::Post, "RequestTokenTo3PIDJob",
- basePath % "/account/3pid/email/requestToken",
- Query { }, Data { }, false
- )
-{ }
+ basePath % "/account/3pid/email/requestToken", false)
+{
+}