You are here

public function Github_Api_Organization::addTeam in Bibliography Module 7.2

Add a team to that organization http://develop.github.com/p/orgs.html

Parameters

string $name the organization name:

string $team name of the new team:

string $permission its permission [PULL|PUSH|ADMIN]:

array $name (optionnal) its repositories names:

Return value

array the teams

File

modules/CiteProc/Github/Api/Organization.php, line 104

Class

Github_Api_Organization
Searching organizations, getting organization information and managing authenticated organization account information.

Code

public function addTeam($organization, $team, $permission, array $repositories = array()) {
  if (!in_array($permission, self::$PERMISSIONS)) {
    throw new InvalidArgumentException("Invalid value for the permission variable");
  }
  $response = $this
    ->post('organizations/' . urlencode($organization) . '/teams', array(
    'team' => $team,
    'permission' => $permission,
    'repo_names' => $repositories,
  ));
  return $response['teams'];
}