org.kohsuke.github
Class GHOrganization

java.lang.Object
  extended by org.kohsuke.github.GHPerson
      extended by org.kohsuke.github.GHOrganization

public class GHOrganization
extends GHPerson

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class GHOrganization.Permission
           
 
Field Summary
 
Fields inherited from class org.kohsuke.github.GHPerson
avatar_url, blog, company, created_at, email, followers, following, gravatar_id, html_url, id, location, login, name, public_gists, public_repos, url
 
Constructor Summary
GHOrganization()
           
 
Method Summary
 void conceal(GHUser u)
          Conceals the membership.
 GHRepository createRepository(String name, String description, String homepage, GHTeam team, boolean isPublic)
           
 GHRepository createRepository(String name, String description, String homepage, String team, boolean isPublic)
          Creates a new repository.
 GHTeam createTeam(String name, GHOrganization.Permission p, Collection<GHRepository> repositories)
          Creates a new team and assigns the repositories.
 GHTeam createTeam(String name, GHOrganization.Permission p, GHRepository... repositories)
           
 List<GHUser> getMembers()
          Deprecated. use listMembers()
 List<GHPullRequest> getPullRequests()
          Gets all the open pull requests in this organizataion.
 List<GHRepository> getRepositoriesWithOpenPullRequests()
          List up repositories that has some open pull requests.
 GHTeam getTeamByName(String name)
          Finds a team that has the given name in its GHTeam.getName()
 Map<String,GHTeam> getTeams()
          Teams by their names.
 boolean hasMember(GHUser user)
          Checks if this organization has the specified user as a member.
 boolean hasPublicMember(GHUser user)
          Checks if this organization has the specified user as a public member.
 PagedIterable<GHEventInfo> listEvents()
          Lists events performed by a user (this includes private events if the caller is authenticated.
 PagedIterable<GHUser> listMembers()
          All the members of this organization.
 PagedIterable<GHUser> listMembersWithFilter(String filter)
           
 PagedIterable<GHUser> listPublicMembers()
          All the public members of this organization.
 PagedIterable<GHRepository> listRepositories(int pageSize)
          Lists up all the repositories using the specified page size.
 PagedIterable<GHTeam> listTeams()
          List up all the teams.
 void publicize(GHUser u)
          Publicizes the membership.
 void remove(GHUser user)
          Remove a member of the organisation - which will remove them from all teams, and remove their access to the organization’s repositories.
 
Methods inherited from class org.kohsuke.github.GHPerson
getAvatarUrl, getBlog, getCompany, getCreatedAt, getEmail, getFollowersCount, getFollowingCount, getGravatarId, getHtmlUrl, getId, getLocation, getLogin, getName, getPublicGistCount, getPublicRepoCount, getRepositories, getRepository, iterateRepositories, listRepositories, populate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GHOrganization

public GHOrganization()
Method Detail

createRepository

public GHRepository createRepository(String name,
                                     String description,
                                     String homepage,
                                     String team,
                                     boolean isPublic)
                              throws IOException
Creates a new repository.

Returns:
Newly created repository.
Throws:
IOException

createRepository

public GHRepository createRepository(String name,
                                     String description,
                                     String homepage,
                                     GHTeam team,
                                     boolean isPublic)
                              throws IOException
Throws:
IOException

getTeams

public Map<String,GHTeam> getTeams()
                            throws IOException
Teams by their names.

Throws:
IOException

listTeams

public PagedIterable<GHTeam> listTeams()
                                throws IOException
List up all the teams.

Throws:
IOException

getTeamByName

public GHTeam getTeamByName(String name)
                     throws IOException
Finds a team that has the given name in its GHTeam.getName()

Throws:
IOException

hasMember

public boolean hasMember(GHUser user)
Checks if this organization has the specified user as a member.


remove

public void remove(GHUser user)
            throws IOException
Remove a member of the organisation - which will remove them from all teams, and remove their access to the organization’s repositories.

Throws:
IOException

hasPublicMember

public boolean hasPublicMember(GHUser user)
Checks if this organization has the specified user as a public member.


publicize

public void publicize(GHUser u)
               throws IOException
Publicizes the membership.

Throws:
IOException

getMembers

public List<GHUser> getMembers()
                        throws IOException
Deprecated. use listMembers()

Throws:
IOException

listMembers

public PagedIterable<GHUser> listMembers()
                                  throws IOException
All the members of this organization.

Throws:
IOException

listPublicMembers

public PagedIterable<GHUser> listPublicMembers()
                                        throws IOException
All the public members of this organization.

Throws:
IOException

listMembersWithFilter

public PagedIterable<GHUser> listMembersWithFilter(String filter)
                                            throws IOException
Throws:
IOException

conceal

public void conceal(GHUser u)
             throws IOException
Conceals the membership.

Throws:
IOException

createTeam

public GHTeam createTeam(String name,
                         GHOrganization.Permission p,
                         Collection<GHRepository> repositories)
                  throws IOException
Creates a new team and assigns the repositories.

Throws:
IOException

createTeam

public GHTeam createTeam(String name,
                         GHOrganization.Permission p,
                         GHRepository... repositories)
                  throws IOException
Throws:
IOException

getRepositoriesWithOpenPullRequests

public List<GHRepository> getRepositoriesWithOpenPullRequests()
                                                       throws IOException
List up repositories that has some open pull requests. This used to be an efficient method that didn't involve traversing every repository, but now it doesn't do any optimization.

Throws:
IOException

getPullRequests

public List<GHPullRequest> getPullRequests()
                                    throws IOException
Gets all the open pull requests in this organizataion.

Throws:
IOException

listEvents

public PagedIterable<GHEventInfo> listEvents()
                                      throws IOException
Lists events performed by a user (this includes private events if the caller is authenticated.

Specified by:
listEvents in class GHPerson
Throws:
IOException

listRepositories

public PagedIterable<GHRepository> listRepositories(int pageSize)
Lists up all the repositories using the specified page size.

Overrides:
listRepositories in class GHPerson
Parameters:
pageSize - size for each page of items returned by GitHub. Maximum page size is 100. Unlike GHPerson.getRepositories(), this does not wait until all the repositories are returned.


Copyright © 2014. All rights reserved.