aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/request_token_response.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-06-07 19:46:40 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-06-07 19:46:40 +0200
commit32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 (patch)
tree9a966d7dc0bf628f610d5de1ad64c8d29b6b26f8 /lib/csapi/definitions/request_token_response.h
parenta0430b1fb722a77ad7cbd28f181727d46d92b3a2 (diff)
downloadlibquotient-32729d9a7519cd2c4cddb0174b8329c6fd4a4a83.tar.gz
libquotient-32729d9a7519cd2c4cddb0174b8329c6fd4a4a83.zip
Update generated files according to gtad/* changes
Diffstat (limited to 'lib/csapi/definitions/request_token_response.h')
-rw-r--r--lib/csapi/definitions/request_token_response.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/csapi/definitions/request_token_response.h b/lib/csapi/definitions/request_token_response.h
new file mode 100644
index 00000000..00222839
--- /dev/null
+++ b/lib/csapi/definitions/request_token_response.h
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "converters.h"
+
+namespace Quotient {
+
+struct RequestTokenResponse {
+ /// The session ID. Session IDs are opaque strings that must consist
+ /// entirely of the characters ``[0-9a-zA-Z.=_-]``. Their length must not
+ /// exceed 255 characters and they must not be empty.
+ QString sid;
+
+ /// An optional field containing a URL where the client must submit the
+ /// validation token to, with identical parameters to the Identity Service
+ /// API's ``POST /validate/email/submitToken`` endpoint (without the
+ /// requirement for an access token). The homeserver must send this token to
+ /// the user (if applicable), who should then be prompted to provide it to
+ /// the client.
+ ///
+ /// If this field is not present, the client can assume that verification
+ /// will happen without the client's involvement provided the homeserver
+ /// advertises this specification version in the ``/versions`` response
+ /// (ie: r0.5.0).
+ QString submitUrl;
+};
+
+template <>
+struct JsonObjectConverter<RequestTokenResponse> {
+ static void dumpTo(QJsonObject& jo, const RequestTokenResponse& pod)
+ {
+ addParam<>(jo, QStringLiteral("sid"), pod.sid);
+ addParam<IfNotEmpty>(jo, QStringLiteral("submit_url"), pod.submitUrl);
+ }
+ static void fillFrom(const QJsonObject& jo, RequestTokenResponse& pod)
+ {
+ fromJson(jo.value("sid"_ls), pod.sid);
+ fromJson(jo.value("submit_url"_ls), pod.submitUrl);
+ }
+};
+
+} // namespace Quotient