mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-17 21:32:39 +09:00
changes
This commit is contained in:
74
vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php
vendored
Normal file
74
vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Api\CurrentUser;
|
||||
|
||||
use Github\Api\AbstractApi;
|
||||
use Github\Exception\MissingArgumentException;
|
||||
|
||||
/**
|
||||
* @link http://developer.github.com/v3/users/keys/
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class PublicKeys extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* List deploy keys for the authenticated user.
|
||||
*
|
||||
* @link https://developer.github.com/v3/users/keys/
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return $this->get('/user/keys');
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows deploy key for the authenticated user.
|
||||
*
|
||||
* @link https://developer.github.com/v3/users/keys/
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return $this->get('/user/keys/'.rawurlencode($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds deploy key for the authenticated user.
|
||||
*
|
||||
* @link https://developer.github.com/v3/users/keys/
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @throws \Github\Exception\MissingArgumentException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function create(array $params)
|
||||
{
|
||||
if (!isset($params['title'], $params['key'])) {
|
||||
throw new MissingArgumentException(['title', 'key']);
|
||||
}
|
||||
|
||||
return $this->post('/user/keys', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes deploy key for the authenticated user.
|
||||
*
|
||||
* @link https://developer.github.com/v3/users/keys/
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function remove($id)
|
||||
{
|
||||
return $this->delete('/user/keys/'.rawurlencode($id));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user