Skip to content

Commit

Permalink
Add list events for an authenticated user method
Browse files Browse the repository at this point in the history
  • Loading branch information
richard015ar committed Apr 21, 2021
1 parent 26a838b commit b565d6d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Github/Api/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,23 @@ public function publicEvents($username)
{
return $this->get('/users/'.rawurlencode($username).'/events/public');
}

/**
* List events performed by an authenticated user.
*
* @link https://docs.github.com/en/rest/reference/activity#list-events-for-the-authenticated-user
*
* @param string $username
* @param int $page the page number of the paginated result set
* @param int $perPage the number of results per page
*
* @return array
*/
public function events($username, $page = 1, $perPage = 30)
{
return $this->get('/users/'.rawurlencode($username).'/events', [
'page' => $page,
'per_page' => $perPage,
]);
}
}

0 comments on commit b565d6d

Please sign in to comment.