The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pithub::Orgs::Teams

VERSION

version 0.01000

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:

    $result = $p->orgs->teams->add_member(
        team_id => 1,
        user    => 'plu',
    );

add_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.

        PUT /teams/:id/repos/:repo

Examples:

    $result = $p->orgs->teams->add_repo(
        team_id => 1,
        repo    => 'some_repo',
    );

create

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

        POST /orgs/:org/teams

Examples:

    $result = $p->orgs->teams->create(
        org  => 'CPAN-API',
        data => {
            name       => 'new team',
            permission => 'push',
            repo_names => ['github/dotfiles']
        }
    );

delete

    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

Examples:

    $result = $p->orgs->teams->delete( team_id => 1 );

get

    Get team

        GET /teams/:id

Examples:

    $result = $p->orgs->teams->get( team_id => 1 );

get_repo

    Get team repo

        GET /teams/:id/repos/:repo

Examples:

    $result = $p->orgs->teams->get_repo(
        team_id => 1,
        repo    => 'some_repo',
    );

is_member

    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

Examples:

    $result = $p->orgs->teams->is_member(
        team_id => 1,
        user    => 'plu',
    );

list

    List teams

        GET /orgs/:org/teams

Examples:

    $result = $p->orgs->teams->list( org => 'CPAN-API' );

list_members

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

        GET /teams/:id/members

Examples:

    $result = $p->orgs->teams->list_members( team_id => 1 );

list_repos

    List team repos

        GET /teams/:id/repos

Examples:

    $result = $p->orgs->teams->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:

    $result = $p->orgs->teams->remove_member(
        team_id => 1,
        user    => 'plu',
    );

remove_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.

        DELETE /teams/:id/repos/:repo

Examples:

    $result = $p->orgs->teams->remove_repo(
        team_id => 1,
        repo    => 'some_repo',
    );

update

    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

Examples:

    $result = $p->orgs->teams->update(
        team_id => 1,
        data    => {
            name       => 'new team name',
            permission => 'push',
        }
    );