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 Gets information about the owner of an access token. |
12 | * |
13 | * Gets information about the owner of a given access token. |
14 | * |
15 | * Note that, as with the rest of the Client-Server API, |
16 | * Application Services may masquerade as users within their |
17 | * namespace by giving a `user_id` query parameter. In this |
18 | * situation, the server should verify that the given `user_id` |
19 | * is registered by the appservice, and return it in the response |
20 | * body. |
21 | */ |
22 | class QUOTIENT_API GetTokenOwnerJob : public BaseJob { |
23 | public: |
24 | /// Gets information about the owner of an access token. |
25 | explicit GetTokenOwnerJob(); |
26 | |
27 | /*! \brief Construct a URL without creating a full-fledged job object |
28 | * |
29 | * This function can be used when a URL for GetTokenOwnerJob |
30 | * is necessary but the job itself isn't. |
31 | */ |
32 | static QUrl makeRequestUrl(QUrl baseUrl); |
33 | |
34 | // Result properties |
35 | |
36 | /// The user ID that owns the access token. |
37 | QString userId() const { return loadFromJson<QString>(keyName: "user_id"_ls ); } |
38 | |
39 | /// Device ID associated with the access token. If no device |
40 | /// is associated with the access token (such as in the case |
41 | /// of application services) then this field can be omitted. |
42 | /// Otherwise this is required. |
43 | QString deviceId() const { return loadFromJson<QString>(keyName: "device_id"_ls ); } |
44 | |
45 | /// When `true`, the user is a [Guest User](#guest-access). When |
46 | /// not present or `false`, the user is presumed to be a non-guest |
47 | /// user. |
48 | Omittable<bool> isGuest() const |
49 | { |
50 | return loadFromJson<Omittable<bool>>(keyName: "is_guest"_ls ); |
51 | } |
52 | }; |
53 | |
54 | } // namespace Quotient |
55 | |