mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-28 19:19:52 +09:00
changes
This commit is contained in:
111
vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php
vendored
Normal file
111
vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Api\Organization;
|
||||
|
||||
use Github\Api\AbstractApi;
|
||||
use Github\Exception\MissingArgumentException;
|
||||
|
||||
class Hooks extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* List hooks.
|
||||
*
|
||||
* @link https://developer.github.com/v3/orgs/hooks/#list-hooks
|
||||
*
|
||||
* @param string $organization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function all($organization)
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/hooks');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single hook.
|
||||
*
|
||||
* @link https://developer.github.com/v3/orgs/hooks/#get-single-hook
|
||||
*
|
||||
* @param string $organization
|
||||
* @param int $id
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function show($organization, $id)
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a hook.
|
||||
*
|
||||
* @link https://developer.github.com/v3/orgs/hooks/#create-a-hook
|
||||
*
|
||||
* @param string $organization
|
||||
* @param array $params
|
||||
*
|
||||
* @throws \Github\Exception\MissingArgumentException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function create($organization, array $params)
|
||||
{
|
||||
if (!isset($params['name'], $params['config'])) {
|
||||
throw new MissingArgumentException(['name', 'config']);
|
||||
}
|
||||
|
||||
return $this->post('/orgs/'.rawurlencode($organization).'/hooks', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a hook.
|
||||
*
|
||||
* @link https://developer.github.com/v3/orgs/hooks/#edit-a-hook
|
||||
*
|
||||
* @param string $organization
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @throws \Github\Exception\MissingArgumentException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function update($organization, $id, array $params)
|
||||
{
|
||||
if (!isset($params['config'])) {
|
||||
throw new MissingArgumentException(['config']);
|
||||
}
|
||||
|
||||
return $this->patch('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id), $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ping a hook.
|
||||
*
|
||||
* @link https://developer.github.com/v3/orgs/hooks/#ping-a-hook
|
||||
*
|
||||
* @param string $organization
|
||||
* @param int $id
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function ping($organization, $id)
|
||||
{
|
||||
return $this->post('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id).'/pings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a hook.
|
||||
*
|
||||
* @link https://developer.github.com/v3/orgs/hooks/#delete-a-hook
|
||||
*
|
||||
* @param string $organization
|
||||
* @param int $id
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function remove($organization, $id)
|
||||
{
|
||||
return $this->delete('/orgs/'.rawurlencode($organization).'/hooks/'.rawurlencode($id));
|
||||
}
|
||||
}
|
||||
75
vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php
vendored
Normal file
75
vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Api\Organization;
|
||||
|
||||
use Github\Api\AbstractApi;
|
||||
|
||||
/**
|
||||
* @link http://developer.github.com/v3/orgs/members/
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class Members extends AbstractApi
|
||||
{
|
||||
public function all($organization, $type = null, $filter = 'all', $role = null)
|
||||
{
|
||||
$parameters = [];
|
||||
$path = '/orgs/'.rawurlencode($organization).'/';
|
||||
if (null === $type) {
|
||||
$path .= 'members';
|
||||
if (null !== $filter) {
|
||||
$parameters['filter'] = $filter;
|
||||
}
|
||||
if (null !== $role) {
|
||||
$parameters['role'] = $role;
|
||||
}
|
||||
} else {
|
||||
$path .= 'public_members';
|
||||
}
|
||||
|
||||
return $this->get($path, $parameters);
|
||||
}
|
||||
|
||||
public function show($organization, $username)
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function member($organization, $username)
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function check($organization, $username)
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function publicize($organization, $username)
|
||||
{
|
||||
return $this->put('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function conceal($organization, $username)
|
||||
{
|
||||
return $this->delete('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
/*
|
||||
* Add user to organization
|
||||
*/
|
||||
public function add($organization, $username)
|
||||
{
|
||||
return $this->put('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function addMember($organization, $username)
|
||||
{
|
||||
return $this->add($organization, $username);
|
||||
}
|
||||
|
||||
public function remove($organization, $username)
|
||||
{
|
||||
return $this->delete('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username));
|
||||
}
|
||||
}
|
||||
23
vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php
vendored
Normal file
23
vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Api\Organization;
|
||||
|
||||
use Github\Api\Project\AbstractProjectApi;
|
||||
use Github\Exception\MissingArgumentException;
|
||||
|
||||
class Projects extends AbstractProjectApi
|
||||
{
|
||||
public function all($organization, array $params = [])
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/projects', array_merge(['page' => 1], $params));
|
||||
}
|
||||
|
||||
public function create($organization, array $params)
|
||||
{
|
||||
if (!isset($params['name'])) {
|
||||
throw new MissingArgumentException(['name']);
|
||||
}
|
||||
|
||||
return $this->post('/orgs/'.rawurlencode($organization).'/projects', $params);
|
||||
}
|
||||
}
|
||||
100
vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php
vendored
Normal file
100
vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Github\Api\Organization;
|
||||
|
||||
use Github\Api\AbstractApi;
|
||||
use Github\Exception\MissingArgumentException;
|
||||
|
||||
/**
|
||||
* @link http://developer.github.com/v3/orgs/teams/
|
||||
*
|
||||
* @author Joseph Bielawski <stloyd@gmail.com>
|
||||
*/
|
||||
class Teams extends AbstractApi
|
||||
{
|
||||
public function all($organization)
|
||||
{
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/teams');
|
||||
}
|
||||
|
||||
public function create($organization, array $params)
|
||||
{
|
||||
if (!isset($params['name'])) {
|
||||
throw new MissingArgumentException('name');
|
||||
}
|
||||
if (isset($params['repo_names']) && !is_array($params['repo_names'])) {
|
||||
$params['repo_names'] = [$params['repo_names']];
|
||||
}
|
||||
if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) {
|
||||
$params['permission'] = 'pull';
|
||||
}
|
||||
|
||||
return $this->post('/orgs/'.rawurlencode($organization).'/teams', $params);
|
||||
}
|
||||
|
||||
public function show($team)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team));
|
||||
}
|
||||
|
||||
public function update($team, array $params)
|
||||
{
|
||||
if (!isset($params['name'])) {
|
||||
throw new MissingArgumentException('name');
|
||||
}
|
||||
if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) {
|
||||
$params['permission'] = 'pull';
|
||||
}
|
||||
|
||||
return $this->patch('/teams/'.rawurlencode($team), $params);
|
||||
}
|
||||
|
||||
public function remove($team)
|
||||
{
|
||||
return $this->delete('/teams/'.rawurlencode($team));
|
||||
}
|
||||
|
||||
public function members($team)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team).'/members');
|
||||
}
|
||||
|
||||
public function check($team, $username)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function addMember($team, $username)
|
||||
{
|
||||
return $this->put('/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function removeMember($team, $username)
|
||||
{
|
||||
return $this->delete('/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function repositories($team)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team).'/repos');
|
||||
}
|
||||
|
||||
public function repository($team, $organization, $repository)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository));
|
||||
}
|
||||
|
||||
public function addRepository($team, $organization, $repository, $params = [])
|
||||
{
|
||||
if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) {
|
||||
$params['permission'] = 'pull';
|
||||
}
|
||||
|
||||
return $this->put('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params);
|
||||
}
|
||||
|
||||
public function removeRepository($team, $organization, $repository)
|
||||
{
|
||||
return $this->delete('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user