File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -253,4 +253,49 @@ public function email($id)
253253 {
254254 return $ this ->get ('user/emails/ ' .$ this ->encodePath ($ id ));
255255 }
256+
257+ /**
258+ * @param int $user_id
259+ * @return mixed
260+ */
261+ public function userImpersonationTokens ($ user_id )
262+ {
263+ return $ this ->get ('users/ ' .$ this ->encodePath ($ user_id ).'/impersonation_tokens/ ' );
264+ }
265+
266+ /**
267+ * @param int $user_id
268+ * @param int $impersonation_token_id
269+ * @return mixed
270+ */
271+ public function userImpersonationToken ($ user_id , $ impersonation_token_id )
272+ {
273+ return $ this ->get ('users/ ' .$ this ->encodePath ($ user_id ).'/impersonation_tokens/ ' .$ this ->encodePath ($ impersonation_token_id ));
274+ }
275+
276+ /**
277+ * @param int $user_id
278+ * @param string $name
279+ * @param array $scopes
280+ * @param null $expires_at
281+ * @return mixed
282+ */
283+ public function createImpersonationToken ($ user_id , $ name , array $ scopes , $ expires_at = null )
284+ {
285+ return $ this ->post ('users/ ' .$ this ->encodePath ($ user_id ).'/impersonation_tokens ' , array (
286+ 'name ' => $ name ,
287+ 'scopes ' => $ scopes ,
288+ 'expires_at ' => $ expires_at
289+ ));
290+ }
291+
292+ /**
293+ * @param int $user_id
294+ * @param int $impersonation_token_id
295+ * @return mixed
296+ */
297+ public function removeImpersonationToken ($ user_id , $ impersonation_token_id )
298+ {
299+ return $ this ->delete ('users/ ' .$ this ->encodePath ($ user_id ).'/impersonation_tokens/ ' .$ this ->encodePath ($ impersonation_token_id ));
300+ }
256301}
You can’t perform that action at this time.
0 commit comments