Pithub::Orgs::Teams - Github v3 Org Teams API
version 0.01008
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.
PUT /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new; my $result = $t->add_member( team_id => 1, user => 'plu', );
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.
PUT /teams/:id/repos/:repo
my $t = Pithub::Orgs::Teams->new; my $result = $t->add_repo( team_id => 1, repo => 'some_repo', );
In order to create a team, the authenticated user must be an owner of the given organization.
POST /orgs/:org/teams
my $t = Pithub::Orgs::Teams->new; my $result = $t->create( org => 'CPAN-API', data => { name => 'new team', permission => 'push', repo_names => ['github/dotfiles'] } );
In order to delete a team, the authenticated user must be an owner of the org that the team is associated with.
DELETE /teams/:id
my $t = Pithub::Orgs::Teams->new; my $result = $t->delete( team_id => 1 );
Get team
GET /teams/:id
my $t = Pithub::Orgs::Teams->new; my $result = $t->get( team_id => 1 );
Get team repo
GET /teams/:id/repos/:repo
my $t = Pithub::Orgs::Teams->new; my $result = $t->has_repo( team_id => 1, repo => 'some_repo', );
In order to get if a user is a member of a team, the authenticated user must be a member of the team.
GET /teams/:id/members/:user
my $t = Pithub::Orgs::Teams->new; my $result = $t->is_member( team_id => 1, user => 'plu', );
List teams
GET /orgs/:org/teams
my $t = Pithub::Orgs::Teams->new; my $result = $t->list( org => 'CPAN-API' );
In order to list members in a team, the authenticated user must be a member of the team.
GET /teams/:id/members
my $t = Pithub::Orgs::Teams->new; my $result = $t->list_members( team_id => 1 );
List team repos
GET /teams/:id/repos
my $t = Pithub::Orgs::Teams->new; my $result = $t->list_repos( team_id => 1 );
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.
DELETE /teams/:id/members/:user
my $t = Pithub::Orgs::Teams->new; my $result = $t->remove_member( team_id => 1, user => 'plu', );
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.
DELETE /teams/:id/repos/:repo
my $t = Pithub::Orgs::Teams->new; my $result = $t->remove_repo( team_id => 1, repo => 'some_repo', );
In order to edit a team, the authenticated user must be an owner of the org that the team is associated with.
PATCH /teams/:id
my $t = Pithub::Orgs::Teams->new; my $result = $t->update( team_id => 1, data => { name => 'new team name', permission => 'push', } );
Johannes Plunien <plu@cpan.org>
This software is copyright (c) 2011 by Johannes Plunien.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Pithub, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pithub
CPAN shell
perl -MCPAN -e shell install Pithub
For more information on module installation, please visit the detailed CPAN module installation guide.