Scroll to navigation

Net::GitHub::V3::Orgs(3pm) User Contributed Perl Documentation Net::GitHub::V3::Orgs(3pm)

NAME

Net::GitHub::V3::Orgs - GitHub Orgs API

SYNOPSIS

    use Net::GitHub::V3;
    my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
    my $org = $gh->org;

DESCRIPTION

METHODS

Orgs

<http://developer.github.com/v3/orgs/>

    my @orgs = $org->orgs(); # /user/org
    my @orgs = $org->orgs( 'nothingmuch' ); # /users/:user/org
    while (my $o = $org->next_org) { ...; }
    
    my $org  = $org->org('perlchina');
    
    my $org  = $org->update_org($org_name, { name => 'new org name' });
    

Members

<http://developer.github.com/v3/orgs/members/>

    my @members = $org->members('perlchina');
    while (my $m = $org->next_member) { ...; }
    my $is_member = $org->is_member('perlchina', 'fayland');
    my $st = $org->delete_member('perlchina', 'fayland');
    
    my @members = $org->public_members('perlchina');
    while (my $public_member = $org->next_public_member) { ...; }
    my $is_public_member = $org->is_public_member('perlchina', 'fayland');
    my $st = $org->publicize_member('perlchina', 'fayland');
    my $st = $org->conceal_member('perlchina', 'fayland');
    
    my @admins = $org->owner_members('perlchina');
    while (my $admin = $org->next_owner_member) { ...; }
    
    my @no_2fa_members = $org->no_2fa_members('perlchina');
    while (my $n2a_m = $org->next_no_2fa_member) { ...; }
    
    my @collaborators = $org->outside_collaborators('perlchina');
    while (my $helper = $org->next_outside_collaborator) { ...; }
    
List all repositories for an organization. (can use pagination)

    my $first_100_repos = $org->repos( $organization_name );
    

Iterate over all repositories for an organization.

    while (my $repo = $org->next_repos( 'Your-Org-Name' ) ) {
        # do something with $repo
        say $repo->{name};
        ...
    }
    $org->close_repos( 'Your-Org-Name' );
    
    my $membership = $org->membership( { org => 'perlchina', username => 'fayland' } );
    my $membership = $org->update_membership('perlchina', 'fayland', {
        role => 'admin',
    });
    my $st = $org->delete_membership('perlchina', 'fayland');
    

Org Teams API

<http://developer.github.com/v3/orgs/teams/>

    my @teams = $org->teams('perlchina');
    while (my $team = $org->next_team('perlchina')) { ...; }
    my $team  = $org->team($team_id);
    my $team  = $org->create_team('perlchina', {
        "name" => "new team"
    });
    my $team  = $org->update_team($team_id, {
        name => "new team name"
    });
    my $st = $org->delete_team($team_id);
    
    my @members = $org->team_members($team_id);
    while (my $member = $org->next_team_member($team_id)) { ...; }
    my $is_team_member = $org->is_team_member($team_id, 'fayland');
    my $st = $org->add_team_member($team_id, 'fayland');
    my $st = $org->delete_team_member($team_id, 'fayland');
    
    my @maintainers = $org->team_maintainers($team_id);
    while (my $maintainer = $org->next_team_maintainer($team_id)) { ...; }
    
    my @repos = $org->team_repos($team_id);
    while (my $repo = $org->next_team_repo($team_id)) { ...; }
    my $is_team_repos = $org->is_team_repos($team_id, 'Hello-World');
    my $st = $org->add_team_repos($team_id, 'Hello-World');
    my $st = $org->add_team_repos($team_id, 'YoinkOrg/Hello-World', { permission => 'admin' });
    my $st = $org->add_team_repos($team_id, 'YoinkOrg/Hello-World', { permission => 'push' });
    my $st = $org->add_team_repos($team_id, 'YoinkOrg/Hello-World', { permission => 'pull' });
    my $st = $org->delete_team_repos($team_id, 'Hello-World');
    

AUTHOR & COPYRIGHT & LICENSE

Refer Net::GitHub

2022-10-08 perl v5.34.0