table of contents
| Pithub::Orgs::Teams(3pm) | User Contributed Perl Documentation | Pithub::Orgs::Teams(3pm) |
NAME¶
Pithub::Orgs::Teams - Github v3 Org Teams API
VERSION¶
version 0.01043
METHODS¶
add_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.
PUT /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->add_member(
team_id => 1,
user => 'plu',
);
add_membership¶
PUT /teams/:id/memberships/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->add_membership(
team_id => 1,
user => 'plu',
data => {
role => 'member',
}
);
add_repo¶
PUT /teams/:id/repos/:repo
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->add_repo(
team_id => 1,
repo => 'some_repo',
org => 'our_organization',
);
create¶
POST /orgs/:org/teams
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->create(
org => 'CPAN-API',
data => {
name => 'new team',
permission => 'push',
repo_names => ['github/dotfiles']
}
);
delete¶
DELETE /teams/:id
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->delete( team_id => 1 );
get¶
GET /teams/:id
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->get( team_id => 1 );
has_repo¶
GET /teams/:id/repos/:repo
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->has_repo(
team_id => 1,
repo => 'some_repo',
);
is_member¶
GET /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->is_member(
team_id => 1,
user => 'plu',
);
list¶
GET /orgs/:org/teams
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->list( org => 'CPAN-API' );
list_members¶
GET /teams/:id/members
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->list_members( team_id => 1 );
list_repos¶
GET /teams/:id/repos
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->list_repos( team_id => 1 );
remove_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.
DELETE /teams/:id/members/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->remove_member(
team_id => 1,
user => 'plu',
);
remove_membership¶
DELETE /teams/:id/memberships/:user
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->remove_membership(
team_id => 1,
user => 'plu',
);
remove_repo¶
DELETE /teams/:id/repos/:repo
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->remove_repo(
team_id => 1,
repo => 'some_repo',
);
update¶
PATCH /teams/:id
Examples:
my $t = Pithub::Orgs::Teams->new;
my $result = $t->update(
team_id => 1,
data => {
name => 'new team name',
permission => 'push',
}
);
AUTHOR¶
Johannes Plunien <plu@cpan.org>
COPYRIGHT AND LICENSE¶
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.
| 2025-06-08 | perl v5.40.1 |