RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
AuthorizationResult.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 AUTHORIZATIONRESULT_H
10 #define AUTHORIZATIONRESULT_H
11 
12 #include "types.h"
13 
14 namespace rmsauth {
15 
16 enum class AuthorizationStatus
17 {
18  Failed = -1,
19  Success = 1,
20 };
21 
23 {
24  static const String& Tag() {static const String tag="AuthorizationResult"; return tag;}
25 
26  AuthorizationStatus status_;
27  String code_;
28  String error_;
29  String errorDescription_;
30 
31 public:
32 // AuthorizationResult(const String& code);
33 // AuthorizationResult(const String& error, const String& errorDescription);
34  AuthorizationResult(const String& code)
35  : status_(AuthorizationStatus::Success)
36  , code_(code)
37  {
38  }
39  AuthorizationResult(const String& error, const String& errorDescription)
40  : status_(AuthorizationStatus::Failed)
41  , error_(error)
42  , errorDescription_(errorDescription)
43  {
44  }
45 
46  const AuthorizationStatus& status() const { return status_; }
47  const String& code() const { return code_; }
48  const String& error() const { return error_; }
49  const String& errorDescription() const { return errorDescription_; }
50 };
51 
52 using AuthorizationResultPtr = ptr<AuthorizationResult>;
53 
54 } // namespace rmsauth {
55 
56 #endif // AUTHORIZATIONRESULT_H
Definition: AcquireTokenForClientHandler.h:14
Definition: AuthorizationResult.h:22