iFun Engine API  1.0.0-b6053
Great Technology for Great Games
line_authentication.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_SERVICE_LINE_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_LINE_AUTHENTICATION_H_
11 
12 #include <funapi/types.h>
13 
14 
15 namespace fun {
16 
17 struct FUNAPI_DLL_VISIBILITY LineAuthenticationRequest {
18  explicit LineAuthenticationRequest(const string &access_token);
19 
20  string access_token;
21 };
22 
23 
24 struct FUNAPI_DLL_VISIBILITY LineAuthenticationResponse {
26  LineAuthenticationResponse(const string &scope,
27  const string &client_id,
28  int64_t expires_in);
29 
30  bool success;
31  string error;
32  string error_description;
33 
34  string scope;
35  string client_id; // Channel ID for which the access token is issued.
36  int64_t expires_in;
37 };
38 
39 
40 struct FUNAPI_DLL_VISIBILITY LinePersonalInfoRequest {
41  explicit LinePersonalInfoRequest(const string &access_token);
42 
43  string access_token;
44 };
45 
46 
47 struct FUNAPI_DLL_VISIBILITY LinePersonalInfoResponse {
49  LinePersonalInfoResponse(const string &display_name,
50  const string &user_id,
51  const string &picture_url,
52  const string &status_message);
53  bool success;
54  string error_message;
55 
56  string display_name;
57  string user_id;
58  string picture_url;
59  string status_message;
60 };
61 
62 
63 typedef function<void(const LineAuthenticationRequest &request,
64  const LineAuthenticationResponse &response,
65  bool error)> LineAuthenticationResponseHandler;
66 
67 typedef function<void(const LinePersonalInfoRequest &request,
68  const LinePersonalInfoResponse &response,
69  bool error)> LinePersonalInfoResponseHandler;
70 
71 
72 FUNAPI_DLL_VISIBILITY
73 void Authenticate(const LineAuthenticationRequest &request,
74  const LineAuthenticationResponseHandler &handler,
75  size_t timeout_in_ms = 0);
76 
77 FUNAPI_DLL_VISIBILITY
78 bool AuthenticateSync(const LineAuthenticationRequest &request,
79  LineAuthenticationResponse *response);
80 
81 FUNAPI_DLL_VISIBILITY
82 void GetPersonalInfo(const LinePersonalInfoRequest &request,
83  const LinePersonalInfoResponseHandler &handler,
84  size_t timeout_in_ms = 0);
85 
86 FUNAPI_DLL_VISIBILITY
87 bool GetPersonalInfoSync(const LinePersonalInfoRequest &request,
88  LinePersonalInfoResponse *response);
89 
90 } // namespace fun
91 
92 #endif // INCLUDE_FUNAPI_SERVICE_LINE_AUTHENTICATION_H_
Definition: line_authentication.h:47
Definition: line_authentication.h:17
Definition: json.h:18
Definition: line_authentication.h:24
Definition: line_authentication.h:40