class JGithubPackageOrgsTeams extends JGithubPackage

GitHub API Orgs Teams class for the Joomla Platform.

All actions against teams require at a minimum an authenticated user who is a member of the owner’s team in the :org being managed. Additionally, OAuth users require “user” scope.

Methods

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

__get( string $name)

Magic method to lazily create API objects

object
getList( string $org)

List teams.

object
get( integer $id)

Get team.

object
create( string $org, string $name, array $repoNames = array(), string $permission = '')

Create team.

object
edit( integer $id, string $name, string $permission = '')

Edit team.

object
delete( integer $id)

Delete team.

object
getListMembers( integer $id)

List team members.

object
isMember( integer $id, string $user)

Get team member.

object
addMember( integer $id, string $user)

Add team member.

object
removeMember( integer $id, string $user)

Remove team member.

object
getListRepos( integer $id)

List team repos.

object
checkRepo( integer $id, string $repo)

Check if the repo is managed by this team.

object
addRepo( integer $id, string $owner, string $repo)

Add team repo.

object
removeRepo( integer $id, string $owner, string $repo)

Remove team repo.

Details

__construct( Registry $options = null, JGithubHttp $client = null)

Constructor.

Parameters

Registry $options GitHub options object.
JGithubHttp $client The HTTP client object.

JGithubPackage __get( string $name)

Magic method to lazily create API objects

Parameters

string $name Name of property to retrieve

Return Value

JGithubPackage GitHub API package object.

Exceptions

RuntimeException

object getList( string $org)

List teams.

Parameters

string $org The name of the organization.

Return Value

object

object get( integer $id)

Get team.

Parameters

integer $id The team id.

Return Value

object

object create( string $org, string $name, array $repoNames = array(), string $permission = '')

Create team.

In order to create a team, the authenticated user must be an owner of the organization.

Parameters

string $org The name of the organization.
string $name The name of the team.
array $repoNames Repository names.
string $permission The permission. pull - team members can pull, but not push to or administer these repositories. Default push - team members can pull and push, but not administer these repositories. admin - team members can pull, push and administer these repositories.

Return Value

object

Exceptions

UnexpectedValueException

object edit( integer $id, string $name, string $permission = '')

Edit team.

In order to edit a team, the authenticated user must be an owner of the org that the team is associated with.

Parameters

integer $id The team id.
string $name The name of the team.
string $permission The permission. pull - team members can pull, but not push to or administer these repositories. Default push - team members can pull and push, but not administer these repositories. admin - team members can pull, push and administer these repositories.

Return Value

object

Exceptions

UnexpectedValueException

object delete( integer $id)

Delete team.

In order to delete a team, the authenticated user must be an owner of the org that the team is associated with.

Parameters

integer $id The team id.

Return Value

object

object getListMembers( integer $id)

List team members.

In order to list members in a team, the authenticated user must be a member of the team.

Parameters

integer $id The team id.

Return Value

object

object isMember( integer $id, string $user)

Get team member.

In order to get if a user is a member of a team, the authenticated user must be a member of the team.

Parameters

integer $id The team id.
string $user The name of the user.

Return Value

object

Exceptions

UnexpectedValueException

object addMember( integer $id, string $user)

Add team member.

In order to add a user to a team, the authenticated user must have ‘admin’ permissions to the team or be an owner of the org that the team is associated with.

Parameters

integer $id The team id.
string $user The name of the user.

Return Value

object

object removeMember( integer $id, string $user)

Remove team member.

In order to remove a user from a team, the authenticated user must have ‘admin’ permissions to the team or be an owner of the org that the team is associated with. NOTE: This does not delete the user, it just remove them from the team.

Parameters

integer $id The team id.
string $user The name of the user.

Return Value

object

object getListRepos( integer $id)

List team repos.

Parameters

integer $id The team id.

Return Value

object

object checkRepo( integer $id, string $repo)

Check if the repo is managed by this team.

Parameters

integer $id The team id.
string $repo The name of the GitHub repository.

Return Value

object

Exceptions

UnexpectedValueException

object addRepo( integer $id, string $owner, string $repo)

Add team repo.

In order to add a repo to a team, the authenticated user must be an owner of the org that the team is associated with. Also, the repo must be owned by the organization, or a direct form of a repo owned by the organization.

If you attempt to add a repo to a team that is not owned by the organization, you get: Status: 422 Unprocessable Entity

Parameters

integer $id The team id.
string $owner The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.

Return Value

object

object removeRepo( integer $id, string $owner, string $repo)

Remove team repo.

In order to remove a repo from a team, the authenticated user must be an owner of the org that the team is associated with. NOTE: This does not delete the repo, it just removes it from the team.

Parameters

integer $id The team id.
string $owner The name of the owner of the GitHub repository.
string $repo The name of the GitHub repository.

Return Value

object