RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
UserInfo.h
1 /*
2  * ======================================================================
3  * Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4  * Licensed under the MIT License.
5  * See LICENSE.md in the project root for license information.
6  * ======================================================================
7 */
8 
9 #ifndef USERINFO
10 #define USERINFO
11 
12 #include "types.h"
13 #include "Entities.h"
14 #include "DateTime.h"
15 #include "Url.h"
16 
17 namespace rmsauth {
18 
19 class UserInfo;
20 using UserInfoPtr = ptr<UserInfo>;
21 
22 class UserInfo
23 {
24  String uniqueId_;
25  String displayableId_;
26  String givenName_;
27  String familyName_;
28  String identityProvider_;
29  String passwordChangeUrl_;
30  DateTimeOffset passwordExpiresOn_;
31  bool forcePrompt_;
32 
33 public:
34  const String& uniqueId() const { return uniqueId_; }
35  void uniqueId(const String& val) { uniqueId_ = val; }
36 
37  const String& displayableId() const { return displayableId_; }
38  void displayableId(const String& val) { displayableId_ = val; }
39 
40  const String& givenName() const { return givenName_; }
41  void givenName(const String& val) { givenName_ = val; }
42 
43  const String& familyName() const { return familyName_; }
44  void familyName(const String& val) { familyName_ = val; }
45 
46  const String& identityProvider() const { return identityProvider_; }
47  void identityProvider(const String& val) { identityProvider_ = val; }
48 
49  const String& passwordChangeUrl() const { return passwordChangeUrl_; }
50  void passwordChangeUrl(const String& val) { passwordChangeUrl_ = val; }
51 
52  const DateTimeOffset& passwordExpiresOn() const { return passwordExpiresOn_; }
53  void passwordExpiresOn(const DateTimeOffset& val) { passwordExpiresOn_ = val; }
54 
55  const bool& forcePrompt() const { return forcePrompt_; }
56  void forcePrompt(const bool& val) { forcePrompt_ = val; }
57 
58  String serialize();
59  static UserInfoPtr deserialize(const String& jsonString);
60 
61 private:
62  struct JsonNames {
63  const String uniqueId = "uniqueId";
64  const String displayableId = "displayableId";
65  const String givenName = "givenName";
66  const String familyName = "familyName";
67  const String identityProvider = "identityProvider";
68  const String passwordChangeUrl = "passwordChangeUrl";
69  const String passwordExpiresOn = "passwordExpiresOn";
70  const String forcePrompt = "forcePrompt";
71  };
72 
73  static const JsonNames& jsonNames()
74  {
75  static const JsonNames jsonNames{};
76  return jsonNames;
77  }
78 
79 };
80 
81 } // namespace rmsauth {
82 
83 #endif // USERINFO
Definition: UserInfo.h:22
Definition: AcquireTokenForClientHandler.h:14