crunchbutton/include/library/Github/Api/Authorizations.php
Devin Smith 41e8600690 more deployment changes
partial #3787
added support for deployment to any repo path.
added tagging system
2014-11-18 16:08:23 -08:00

46 lines
1.0 KiB
PHP
Executable File

<?php
namespace Github\Api;
use Github\Api\AbstractApi;
/**
* Creating, deleting and listing authorizations
*
* @link http://developer.github.com/v3/oauth/
*/
class Authorizations extends AbstractApi
{
public function all()
{
return $this->get('authorizations');
}
public function show($number)
{
return $this->get('authorizations/'.rawurlencode($number));
}
public function create(array $params, $OTPCode = null)
{
$headers = null === $OTPCode ? array() : array('X-GitHub-OTP' => $OTPCode);
return $this->post('authorizations', $params, $headers);
}
public function update($id, array $params)
{
return $this->patch('authorizations/'.rawurlencode($id), $params);
}
public function remove($id)
{
return $this->delete('authorizations/'.rawurlencode($id));
}
public function check($id, $token)
{
return $this->get('authorizations/'.rawurlencode($id).'/tokens/'.rawurlencode($token));
}
}