Skip to content

Commit

Permalink
Added missing 'machine-man-preview' accept headers
Browse files Browse the repository at this point in the history
  • Loading branch information
vovayatsyuk committed Jun 23, 2020
1 parent 0ce1f09 commit 63ab967
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Github/Api/CurrentUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
class CurrentUser extends AbstractApi
{
use AcceptHeaderTrait;

public function show()
{
return $this->get('/user');
Expand Down Expand Up @@ -185,23 +187,27 @@ public function subscriptions()
}

/**
* @link https://developer.github.com/v3/integrations/#list-installations-for-user
* @link https://developer.github.com/v3/apps/installations/#list-app-installations-accessible-to-the-user-access-token
*
* @param array $params
*/
public function installations(array $params = [])
{
$this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json';

return $this->get('/user/installations', array_merge(['page' => 1], $params));
}

/**
* @link https://developer.github.com/v3/integrations/installations/#list-repositories-accessible-to-the-user-for-an-installation
* @link https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-access-token
*
* @param string $installationId the ID of the Installation
* @param array $params
*/
public function repositoriesByInstallation($installationId, array $params = [])
{
$this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json';

return $this->get(sprintf('/user/installations/%s/repositories', $installationId), array_merge(['page' => 1], $params));
}
}

0 comments on commit 63ab967

Please sign in to comment.