olp-cpp-sdk  1.22.0
SignInResult.h
1 /*
2  * Copyright (C) 2019-2021 HERE Europe B.V.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  * License-Filename: LICENSE
18  */
19 
20 #pragma once
21 
22 #include <chrono>
23 #include <ctime>
24 #include <memory>
25 #include <string>
26 
27 #include "AuthenticationApi.h"
28 #include "ErrorResponse.h"
29 
30 namespace olp {
31 namespace authentication {
32 class SignInResultImpl;
33 
37 class AUTHENTICATION_API SignInResult {
38  public:
42  virtual ~SignInResult();
43 
47  SignInResult() noexcept;
48 
56  int GetStatus() const;
57 
63  const ErrorResponse& GetErrorResponse() const;
64 
70  const ErrorFields& GetErrorFields() const;
71 
78  const std::string& GetFullMessage() const;
79 
86  const std::string& GetAccessToken() const;
87 
94  const std::string& GetTokenType() const;
95 
103  const std::string& GetRefreshToken() const;
104 
111  time_t GetExpiryTime() const;
112 
118  std::chrono::seconds GetExpiresIn() const;
119 
125  const std::string& GetUserIdentifier() const;
126 
132  const std::string& GetScope() const;
133 
134  private:
135  friend class SignInUserResult;
136  friend class AuthenticationClientImpl;
137  friend class TokenEndpointImpl;
138 
139  SignInResult(std::shared_ptr<SignInResultImpl> impl);
140 
141  private:
142  std::shared_ptr<SignInResultImpl> impl_;
143 };
144 } // namespace authentication
145 } // namespace olp
A response to a client or user sign-in operation.
Definition: SignInResult.h:37
SignInResult() noexcept
A default constructor.
virtual ~SignInResult()
A default destructor.
A response to your sign-in operation.
Definition: SignInUserResult.h:40
std::list< ErrorField > ErrorFields
The list of the ErrorField objects.
Definition: ErrorResponse.h:72
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24
Detailed descriptions of errors returned as a response to an authentication operation.
Definition: ErrorResponse.h:36