1 | <?php |
||
4 | class AccessToken extends BaseModel |
||
5 | { |
||
6 | /** |
||
7 | * Access Token |
||
8 | * |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $token; |
||
12 | |||
13 | /** |
||
14 | * Token Type |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $tokenType; |
||
19 | |||
20 | /** |
||
21 | * Bearer |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $bearer; |
||
26 | |||
27 | /** |
||
28 | * User ID |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $uid; |
||
33 | |||
34 | /** |
||
35 | * Account ID |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $accountId; |
||
40 | |||
41 | /** |
||
42 | * Team ID |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $teamId; |
||
47 | |||
48 | /** |
||
49 | * Refresh token, received when token_access_type = offline |
||
50 | * |
||
51 | * @var string|null |
||
52 | */ |
||
53 | protected $refreshToken; |
||
54 | |||
55 | /** |
||
56 | * Indicate when the token is expired |
||
57 | * |
||
58 | * @var string|null |
||
59 | */ |
||
60 | protected $tokenExpiresIn; |
||
61 | |||
62 | /** |
||
63 | * Create a new AccessToken instance |
||
64 | * |
||
65 | * @param array $data |
||
66 | */ |
||
67 | public function __construct(array $data) |
||
80 | |||
81 | /** |
||
82 | * Get Access Token |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getToken() |
||
90 | |||
91 | /** |
||
92 | * Get Token Type |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getTokenType() |
||
100 | |||
101 | /** |
||
102 | * Get Bearer |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getBearer() |
||
110 | |||
111 | /** |
||
112 | * Get User ID |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getUid() |
||
120 | |||
121 | /** |
||
122 | * Get Account ID |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getAccountId() |
||
130 | |||
131 | /** |
||
132 | * Get Team ID |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | public function getTeamId() |
||
140 | |||
141 | /** |
||
142 | * if token_access_type was set to offline, then response will include a refresh token. |
||
143 | * This refresh token is long-lived and won't expire automatically. |
||
144 | * It can be stored and re-used multiple times. |
||
145 | * |
||
146 | * @return string|null |
||
147 | */ |
||
148 | public function getRefreshToken() |
||
152 | |||
153 | /** |
||
154 | * Get the length of time that the access token will be valid for |
||
155 | * |
||
156 | * @return string|null |
||
157 | */ |
||
158 | public function getExpiresIn() |
||
162 | |||
163 | } |
||
164 |