5 #include <Quotient/csapi/definitions/auth_data.h>
6 #include <Quotient/csapi/definitions/request_email_validation.h>
7 #include <Quotient/csapi/definitions/request_msisdn_validation.h>
8 #include <Quotient/csapi/definitions/request_token_response.h>
10 #include <Quotient/jobs/basejob.h>
46 explicit GetAccount3PIDsJob();
52 static QUrl makeRequestUrl(
const HomeserverData& hsData);
56 QVector<ThirdPartyIdentifier> threepids()
const
58 return loadFromJson<QVector<ThirdPartyIdentifier>>(
"threepids"_L1);
62 inline auto collectResponse(
const GetAccount3PIDsJob* job) {
return job->threepids(); }
65 struct QUOTIENT_API JsonObjectConverter<GetAccount3PIDsJob::ThirdPartyIdentifier> {
66 static void fillFrom(
const QJsonObject& jo, GetAccount3PIDsJob::ThirdPartyIdentifier& result)
68 fillFromJson(jo.value(
"medium"_L1), result.medium);
69 fillFromJson(jo.value(
"address"_L1), result.address);
70 fillFromJson(jo.value(
"validated_at"_L1), result.validatedAt);
71 fillFromJson(jo.value(
"added_at"_L1), result.addedAt);
87 class [[deprecated(
"Check the documentation for details")]]
QUOTIENT_API Post3PIDsJob
103 QString idAccessToken;
113 explicit Post3PIDsJob(
const ThreePidCredentials& threePidCreds);
129 QUrl submitUrl()
const {
return loadFromJson<QUrl>(
"submit_url"_L1); }
133 QT_WARNING_DISABLE_DEPRECATED
134 inline auto collectResponse(
const Post3PIDsJob* job) {
return job->submitUrl(); }
138 QT_WARNING_DISABLE_DEPRECATED
140 struct QUOTIENT_API JsonObjectConverter<Post3PIDsJob::ThreePidCredentials> {
141 static void dumpTo(QJsonObject& jo,
const Post3PIDsJob::ThreePidCredentials& pod)
143 addParam<>(jo,
"client_secret"_L1, pod.clientSecret);
144 addParam<>(jo,
"id_server"_L1, pod.idServer);
145 addParam<>(jo,
"id_access_token"_L1, pod.idAccessToken);
146 addParam<>(jo,
"sid"_L1, pod.sid);
172 explicit Add3PIDJob(
const QString& clientSecret,
const QString& sid,
173 const std::optional<AuthenticationData>& auth = std::nullopt);
198 explicit Bind3PIDJob(
const QString& clientSecret,
const QString& idServer,
199 const QString& idAccessToken,
const QString& sid);
223 explicit Delete3pidFromAccountJob(
const QString& medium,
const QString& address,
224 const QString& idServer = {});
234 QString idServerUnbindResult()
const
236 return loadFromJson<QString>(
"id_server_unbind_result"_L1);
240 inline auto collectResponse(
const Delete3pidFromAccountJob* job)
242 return job->idServerUnbindResult();
266 explicit Unbind3pidFromAccountJob(
const QString& medium,
const QString& address,
267 const QString& idServer = {});
276 QString idServerUnbindResult()
const
278 return loadFromJson<QString>(
"id_server_unbind_result"_L1);
282 inline auto collectResponse(
const Unbind3pidFromAccountJob* job)
284 return job->idServerUnbindResult();
301 explicit RequestTokenTo3PIDEmailJob(
const EmailValidationData& data);
308 RequestTokenResponse response()
const {
return fromJson<RequestTokenResponse>(jsonData()); }
311 inline auto collectResponse(
const RequestTokenTo3PIDEmailJob* job) {
return job->response(); }
326 explicit RequestTokenTo3PIDMSISDNJob(
const MsisdnValidationData& data);
331 RequestTokenResponse response()
const {
return fromJson<RequestTokenResponse>(jsonData()); }
334 inline auto collectResponse(
const RequestTokenTo3PIDMSISDNJob* job) {
return job->response(); }