ImagingTools Core SDK
CPersonalAccessToken.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QDateTime>
7
8// ImtCore includes
9#include <imtauth/IPersonalAccessToken.h>
10
11
12namespace imtauth
13{
14
15
16class CPersonalAccessToken: virtual public imtauth::IPersonalAccessToken
17{
18public:
19 // reimplemented (imtauth::IPersonalAccessToken)
20 virtual QByteArray GetId() const override;
21 virtual void SetId(const QByteArray& id) override;
22 virtual QByteArray GetUserId() const override;
23 virtual void SetUserId(const QByteArray& userId) override;
24 virtual QString GetName() const override;
25 virtual void SetName(const QString& name) override;
26 virtual QString GetDescription() const override;
27 virtual void SetDescription(const QString& description) override;
28 virtual QByteArray GetTokenHash() const override;
29 virtual void SetTokenHash(const QByteArray& tokenHash) override;
30 virtual QByteArrayList GetScopes() const override;
31 virtual void SetScopes(const QByteArrayList& scopes) override;
32 virtual QDateTime GetCreatedAt() const override;
33 virtual void SetCreatedAt(const QDateTime& createdAt) override;
34 virtual QDateTime GetLastUsedAt() const override;
35 virtual void SetLastUsedAt(const QDateTime& lastUsedAt) override;
36 virtual QDateTime GetExpiresAt() const override;
37 virtual void SetExpiresAt(const QDateTime& expiresAt) override;
38 virtual bool IsRevoked() const override;
39 virtual void SetRevoked(bool revoked) override;
40 virtual bool IsExpired() const override;
41 virtual bool IsValid() const override;
42
43 // reimplemented (iser::ISerializable)
44 virtual bool Serialize(iser::IArchive& archive) override;
45
46 // reimplemented (iser::IChangeable)
47 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
48 virtual bool IsEqual(const IChangeable& object) const override;
49 virtual istd::IChangeableUniquePtr CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const override;
50 virtual bool ResetData(CompatibilityMode mode = CM_WITHOUT_REFS) override;
51
52private:
53 QByteArray m_id;
54 QByteArray m_userId;
55 QString m_name;
56 QString m_description;
57 QByteArray m_tokenHash;
58 QByteArrayList m_scopes;
59 QDateTime m_createdAt;
60 QDateTime m_lastUsedAt;
61 QDateTime m_expiresAt;
62 bool m_revoked;
63};
64
65
66} // namespace imtauth
67
68