iberbox  2.1.2
user.h
Go to the documentation of this file.
1 
10 #ifndef USER_H
11 #define USER_H
12 
13 #include "iberbox/config.h"
14 
15 #include <inttypes.h>
16 #include <vector>
17 #include <memory>
18 #include <string>
19 
20 #ifdef USE_SCAPIX
21 #include <scapix/bridge/object.h>
22 #endif
23 
24 namespace iberbox {
25 
29 typedef uint64_t UserId;
30 
31 #ifdef EMSCRIPTEN
32 typedef std::string UserHandle;
33 #else
34 typedef UserId UserHandle;
35 #endif
36 
41 #ifdef USE_SCAPIX
42  : public scapix::bridge::object<UserInfoData>
43 #endif
44 {
45 public:
49  UserInfoData();
50  virtual ~UserInfoData();
51 
56  UserId getId() const;
61  const UserHandle& getHandle() const;
66  uint64_t getCreationTime() const;
71  std::string getEmail();
76  std::string getFirstName();
81  std::string getLastName();
87  bool hasMultiFactorAuthEnabled() const;
88 
89  static const UserId INVALID_ID;
90  static const UserHandle INVALID_HANDLE;
91 
92 protected:
93  UserId mId;
94  std::string mHandle;
95  uint64_t mCreationTime;
96  std::string mEmail;
97  std::string mFirstName;
98  std::string mLastName;
99  bool mMultiFactorAuth;
100 };
101 
105 typedef std::shared_ptr<UserInfoData> UserInfo;
109 typedef std::shared_ptr<std::vector<UserInfo>> UserInfoList;
110 
111 }
112 
113 #endif // USER_H
std::shared_ptr< std::vector< UserInfo > > UserInfoList
The user info list type.
Definition: user.h:109
uint64_t UserId
The user identifier type.
Definition: user.h:29
UserInfoData()
Constructs a new User Info Data object.
const UserHandle & getHandle() const
Gets the user handle.
The iberbox namespace.
Definition: task.h:21
The user info data class.
Definition: user.h:40
std::string getEmail()
Gets the email of the user.
static const UserId INVALID_ID
Definition: user.h:89
UserId getId() const
Gets the user identifier.
std::shared_ptr< UserInfoData > UserInfo
The user info type.
Definition: user.h:105
std::string getLastName()
Gets the last name of the user.
bool hasMultiFactorAuthEnabled() const
Gets whether the account has multifactor authentication enabled.
std::string getFirstName()
Gets the first name of the user.
static const UserHandle INVALID_HANDLE
Definition: user.h:90
UserId UserHandle
Definition: user.h:34
uint64_t getCreationTime() const
Gets the user creation time.