mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-28 11:09:54 +09:00
Update to laravel 7
This commit is contained in:
@@ -32,12 +32,18 @@ class Teams extends AbstractApi
|
||||
return $this->post('/orgs/'.rawurlencode($organization).'/teams', $params);
|
||||
}
|
||||
|
||||
public function show($team)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/#list-teams
|
||||
*/
|
||||
public function show($team, $organization)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team));
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team));
|
||||
}
|
||||
|
||||
public function update($team, array $params)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/#edit-team
|
||||
*/
|
||||
public function update($team, array $params, $organization)
|
||||
{
|
||||
if (!isset($params['name'])) {
|
||||
throw new MissingArgumentException('name');
|
||||
@@ -46,32 +52,47 @@ class Teams extends AbstractApi
|
||||
$params['permission'] = 'pull';
|
||||
}
|
||||
|
||||
return $this->patch('/teams/'.rawurlencode($team), $params);
|
||||
return $this->patch('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team), $params);
|
||||
}
|
||||
|
||||
public function remove($team)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/#delete-team
|
||||
*/
|
||||
public function remove($team, $organization)
|
||||
{
|
||||
return $this->delete('/teams/'.rawurlencode($team));
|
||||
return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team));
|
||||
}
|
||||
|
||||
public function members($team)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/members/#list-team-members
|
||||
*/
|
||||
public function members($team, $organization)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team).'/members');
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/members');
|
||||
}
|
||||
|
||||
public function check($team, $username)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/members/#get-team-membership
|
||||
*/
|
||||
public function check($team, $username, $organization)
|
||||
{
|
||||
return $this->get('/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function addMember($team, $username)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/members/#add-or-update-team-membership
|
||||
*/
|
||||
public function addMember($team, $username, $organization)
|
||||
{
|
||||
return $this->put('/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function removeMember($team, $username)
|
||||
/**
|
||||
* @link https://developer.github.com/v3/teams/members/#remove-team-membership
|
||||
*/
|
||||
public function removeMember($team, $username, $organization)
|
||||
{
|
||||
return $this->delete('/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username));
|
||||
}
|
||||
|
||||
public function repositories($team)
|
||||
@@ -86,15 +107,15 @@ class Teams extends AbstractApi
|
||||
|
||||
public function addRepository($team, $organization, $repository, $params = [])
|
||||
{
|
||||
if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) {
|
||||
if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin', 'maintain', 'triage'])) {
|
||||
$params['permission'] = 'pull';
|
||||
}
|
||||
|
||||
return $this->put('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params);
|
||||
return $this->put('/orgs/'.rawurlencode($organization).'/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));
|
||||
return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user