diff options
| author | Chris Bessent <lost.dragonist@gmail.com> | 2020-01-06 05:17:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-06 05:17:01 -0700 |
| commit | dfa600996c49c1b23dca884c963dc917bd9cfc0a (patch) | |
| tree | c6def4277cc962822d0dcde71fa9148e050f693f /src/apiuseraccount.h | |
| parent | e69078e2399a88bda7bb9ffae7a3d57db9a4e9cf (diff) | |
| parent | d1a788dfad341b32235abc25c2ba1645f8be1ace (diff) | |
Merge pull request #954 from ModOrganizer2/Develop
Stage for release 2.2.2
Diffstat (limited to 'src/apiuseraccount.h')
| -rw-r--r-- | src/apiuseraccount.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/apiuseraccount.h b/src/apiuseraccount.h index 8a238d71..ac8931cf 100644 --- a/src/apiuseraccount.h +++ b/src/apiuseraccount.h @@ -18,6 +18,8 @@ enum class APIUserAccountTypes Premium }; +QString localizedUserAccountType(APIUserAccountTypes t); + /** * current limits imposed on the user account @@ -49,17 +51,28 @@ struct APIStats /** -* represents a user account on the mod provier website +* represents a user account on the mod provider website */ class APIUserAccount { public: - // when the number of remanining requests is under this number, further + // when the number of remaining requests is under this number, further // requests will be throttled by avoiding non-critical ones static const int ThrottleThreshold = 200; APIUserAccount(); + + /** + * whether the user is logged in + */ + bool isValid() const; + + /** + * api key + */ + const QString& apiKey() const; + /** * user id */ @@ -82,6 +95,11 @@ public: /** + * sets the api key + */ + APIUserAccount& apiKey(const QString& key); + + /** * sets the user id */ APIUserAccount& id(const QString& id); @@ -92,7 +110,7 @@ public: APIUserAccount& name(const QString& name); /** - * sets the acount type + * sets the account type */ APIUserAccount& type(APIUserAccountTypes type); @@ -120,10 +138,9 @@ public: bool exhausted() const; private: - QString m_id, m_name; + QString m_key, m_id, m_name; APIUserAccountTypes m_type; APILimits m_limits; - APIStats m_stats; }; #endif // APIUSERACCOUNT_H |
