1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #pragma once |
6 | |
7 | #include <Quotient/jobs/basejob.h> |
8 | |
9 | namespace Quotient { |
10 | |
11 | /*! \brief Query if a given registration token is still valid. |
12 | * |
13 | * Queries the server to determine if a given registration token is still |
14 | * valid at the time of request. This is a point-in-time check where the |
15 | * token might still expire by the time it is used. |
16 | * |
17 | * Servers should be sure to rate limit this endpoint to avoid brute force |
18 | * attacks. |
19 | */ |
20 | class QUOTIENT_API RegistrationTokenValidityJob : public BaseJob { |
21 | public: |
22 | /*! \brief Query if a given registration token is still valid. |
23 | * |
24 | * \param token |
25 | * The token to check validity of. |
26 | */ |
27 | explicit RegistrationTokenValidityJob(const QString& token); |
28 | |
29 | /*! \brief Construct a URL without creating a full-fledged job object |
30 | * |
31 | * This function can be used when a URL for RegistrationTokenValidityJob |
32 | * is necessary but the job itself isn't. |
33 | */ |
34 | static QUrl makeRequestUrl(QUrl baseUrl, const QString& token); |
35 | |
36 | // Result properties |
37 | |
38 | /// True if the token is still valid, false otherwise. This should |
39 | /// additionally be false if the token is not a recognised token by |
40 | /// the server. |
41 | bool valid() const { return loadFromJson<bool>(keyName: "valid"_ls ); } |
42 | }; |
43 | |
44 | } // namespace Quotient |
45 | |