olp-cpp-sdk  1.22.0
IntrospectAppResult.h
1 /*
2  * Copyright (C) 2020 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 <ctime>
23 #include <string>
24 #include <vector>
25 
26 #include <olp/authentication/AuthenticationApi.h>
27 
28 namespace olp {
29 namespace authentication {
33 class AUTHENTICATION_API IntrospectAppResult {
34  public:
40  const std::string& GetClientId() const { return client_id_; }
41 
47  void SetClientId(std::string client_id) { client_id_ = std::move(client_id); }
48 
54  const std::string& GetName() const { return name_; }
55 
61  void SetName(std::string name) { name_ = std::move(name); }
62 
68  const std::string& GetDescription() const { return description_; }
69 
75  void SetDescription(std::string description) {
76  description_ = std::move(description);
77  }
78 
88  const std::vector<std::string>& GetRedirectUris() const {
89  return redirect_uris_;
90  }
91 
97  void SetReditectUris(std::vector<std::string> uris) {
98  redirect_uris_ = std::move(uris);
99  }
100 
108  const std::vector<std::string>& GetAllowedScopes() const {
109  return allowed_scopes_;
110  }
111 
117  void SetAllowedScopes(std::vector<std::string> scopes) {
118  allowed_scopes_ = std::move(scopes);
119  }
120 
126  const std::string& GetTokenEndpointAuthMethod() const {
127  return token_endpoint_auth_method_;
128  }
129 
135  void SetTokenEndpointAuthMethod(std::string method) {
136  token_endpoint_auth_method_ = std::move(method);
137  }
138 
144  const std::string& GetTokenEndpointAuthMethodReason() const {
145  return token_endpoint_auth_method_reason_;
146  }
147 
153  void SetTokenEndpointAuthMethodReason(std::string reason) {
154  token_endpoint_auth_method_reason_ = std::move(reason);
155  }
156 
163  bool GetDobRequired() const { return dob_required_; }
164 
171  void SetDobRequired(bool is_required) { dob_required_ = is_required; }
172 
181  int GetTokenDuration() const { return token_duration_; }
182 
188  void SetTokenDuration(int duration) { token_duration_ = duration; }
189 
209  const std::vector<std::string>& GetReferrers() const { return referrers_; }
210 
217  void SetReferrers(std::vector<std::string> urls) { referrers_ = std::move(urls); }
218 
224  const std::string& GetStatus() const { return status_; }
225 
231  void SetStatus(std::string status) { status_ = std::move(status); }
232 
238  bool GetAppCodeEnabled() const { return app_code_enabled_; }
239 
245  void SetAppCodeEnabled(bool is_enabled) { app_code_enabled_ = is_enabled; }
246 
253  time_t GetCreatedTime() const { return created_time_; }
254 
261  void SetCreatedTime(time_t time) { created_time_ = time; }
262 
268  const std::string& GetRealm() const { return realm_; }
269 
275  void SetRealm(std::string realm) { realm_ = std::move(realm); }
276 
282  const std::string& GetType() const { return type_; }
283 
289  void SetType(std::string type) { type_ = std::move(type); }
290 
296  const std::vector<std::string>& GetResponseTypes() const {
297  return response_types_;
298  }
299 
305  void SetResponseTypes(std::vector<std::string> types) {
306  response_types_ = std::move(types);
307  }
308 
314  const std::string& GetTier() const { return tier_; }
315 
321  void SetTier(std::string tier) { tier_ = std::move(tier); }
322 
328  const std::string& GetHRN() const { return hrn_; }
329 
335  void SetHrn(std::string hrn) { hrn_ = std::move(hrn); }
336 
337  private:
338  std::string client_id_;
339  std::string name_;
340  std::string description_;
341  std::vector<std::string> redirect_uris_;
342  std::vector<std::string> allowed_scopes_;
343  std::string token_endpoint_auth_method_;
344  std::string token_endpoint_auth_method_reason_;
345  bool dob_required_;
346  int token_duration_;
347  std::vector<std::string> referrers_;
348  std::string status_;
349  bool app_code_enabled_;
350  time_t created_time_;
351  std::string realm_;
352  std::string type_;
353  std::vector<std::string> response_types_;
354  std::string tier_;
355  std::string hrn_;
356 };
357 } // namespace authentication
358 } // namespace olp
A response to a client or user introspect application operation.
Definition: IntrospectAppResult.h:33
const std::vector< std::string > & GetReferrers() const
Gets a list of referrer URLs to register or that were registered with the application.
Definition: IntrospectAppResult.h:209
void SetAppCodeEnabled(bool is_enabled)
Sets the application codes if they are enabled.
Definition: IntrospectAppResult.h:245
const std::string & GetStatus() const
Gets the status of the application.
Definition: IntrospectAppResult.h:224
void SetName(std::string name)
Sets the name of the client.
Definition: IntrospectAppResult.h:61
const std::string & GetDescription() const
Gets the prose description of the client.
Definition: IntrospectAppResult.h:68
void SetCreatedTime(time_t time)
Sets the timestamp (milliseconds since the Unix epoch) of when the application was created.
Definition: IntrospectAppResult.h:261
const std::vector< std::string > & GetRedirectUris() const
Gets a list of redirect URIs.
Definition: IntrospectAppResult.h:88
const std::string & GetTokenEndpointAuthMethodReason() const
Gets the token endpoint authentication method reason.
Definition: IntrospectAppResult.h:144
time_t GetCreatedTime() const
Gets the timestamp (milliseconds since the Unix epoch) of when the application was created.
Definition: IntrospectAppResult.h:253
void SetReferrers(std::vector< std::string > urls)
Sets the list of referrer URLs to register or that were registered with the application.
Definition: IntrospectAppResult.h:217
int GetTokenDuration() const
Gets the default duration in seconds for the token issued to this application.
Definition: IntrospectAppResult.h:181
void SetStatus(std::string status)
Sets the status of the application.
Definition: IntrospectAppResult.h:231
void SetAllowedScopes(std::vector< std::string > scopes)
Sets the list of the scopes.
Definition: IntrospectAppResult.h:117
const std::string & GetClientId() const
Gets the identifier for the client or application.
Definition: IntrospectAppResult.h:40
bool GetAppCodeEnabled() const
Checks if the application codes are enabled.
Definition: IntrospectAppResult.h:238
void SetResponseTypes(std::vector< std::string > types)
Sets the list of response types.
Definition: IntrospectAppResult.h:305
const std::vector< std::string > & GetAllowedScopes() const
Gets a list of strings that represent scopes.
Definition: IntrospectAppResult.h:108
void SetTier(std::string tier)
Sets the rate limit tier to configure the application.
Definition: IntrospectAppResult.h:321
void SetClientId(std::string client_id)
Sets the identifier for the client or application.
Definition: IntrospectAppResult.h:47
void SetType(std::string type)
Sets the application type.
Definition: IntrospectAppResult.h:289
const std::string & GetTier() const
Gets a rate limit tier to configure the application.
Definition: IntrospectAppResult.h:314
void SetTokenDuration(int duration)
Sets the default duration in seconds for the token.
Definition: IntrospectAppResult.h:188
void SetTokenEndpointAuthMethod(std::string method)
Sets the token endpoint authentication method.
Definition: IntrospectAppResult.h:135
void SetRealm(std::string realm)
Sets the realm to which the application belongs.
Definition: IntrospectAppResult.h:275
const std::string & GetRealm() const
Gets the realm to which the application belongs.
Definition: IntrospectAppResult.h:268
const std::vector< std::string > & GetResponseTypes() const
Gets a list of response types.
Definition: IntrospectAppResult.h:296
const std::string & GetHRN() const
Gets the HRN of the application.
Definition: IntrospectAppResult.h:328
void SetDobRequired(bool is_required)
Sets the DOB requirement.
Definition: IntrospectAppResult.h:171
const std::string & GetName() const
Gets the human-readable name of the client.
Definition: IntrospectAppResult.h:54
bool GetDobRequired() const
Gets the DOB requirement.
Definition: IntrospectAppResult.h:163
const std::string & GetTokenEndpointAuthMethod() const
Gets the token endpoint authentication method.
Definition: IntrospectAppResult.h:126
void SetReditectUris(std::vector< std::string > uris)
Sets the redirect URIs.
Definition: IntrospectAppResult.h:97
const std::string & GetType() const
Gets the application type.
Definition: IntrospectAppResult.h:282
void SetTokenEndpointAuthMethodReason(std::string reason)
Sets token endpoint authentication method reason.
Definition: IntrospectAppResult.h:153
void SetDescription(std::string description)
Sets the prose description of the client.
Definition: IntrospectAppResult.h:75
void SetHrn(std::string hrn)
Sets the HRN of the application.
Definition: IntrospectAppResult.h:335
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24