public class GHOrganization extends GHPerson
| Modifier and Type | Class and Description |
|---|---|
static class |
GHOrganization.Permission
The enum Permission.
|
static class |
GHOrganization.Role
Member's role in an organization
|
avatar_url, blog, company, email, followers, following, gravatar_id, html_url, location, login, name, public_gists, public_repos, site_admin, typecreated_at, id, responseHeaderFields, updated_at, url| Constructor and Description |
|---|
GHOrganization() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(GHUser user,
GHOrganization.Role role)
Adds (invites) a user to the organization.
|
void |
conceal(GHUser u)
Conceals the membership.
|
GHHook |
createHook(String name,
Map<String,String> config,
Collection<GHEvent> events,
boolean active)
See https://api.github.com/hooks for possible names and their configuration scheme.
|
GHProject |
createProject(String name,
String body)
Creates a project for the organization.
|
GHCreateRepositoryBuilder |
createRepository(String name)
Starts a builder that creates a new repository.
|
GHRepository |
createRepository(String name,
String description,
String homepage,
GHTeam team,
boolean isPublic)
Deprecated.
Use
createRepository(String) that uses a builder pattern to let you control every aspect. |
GHRepository |
createRepository(String name,
String description,
String homepage,
String team,
boolean isPublic)
Deprecated.
Use
createRepository(String) that uses a builder pattern to let you control every aspect. |
GHTeam |
createTeam(String name,
Collection<GHRepository> repositories)
Creates a new team and assigns the repositories.
|
GHTeam |
createTeam(String name,
GHOrganization.Permission p,
Collection<GHRepository> repositories)
Deprecated.
https://developer.github.com/v3/teams/#create-team deprecates permission field use
createTeam(String, Collection) |
GHTeam |
createTeam(String name,
GHOrganization.Permission p,
GHRepository... repositories)
Deprecated.
https://developer.github.com/v3/teams/#create-team deprecates permission field use
createTeam(String, GHRepository...) |
GHTeam |
createTeam(String name,
GHRepository... repositories)
Create team gh team.
|
GHHook |
createWebHook(URL url)
Create web hook gh hook.
|
GHHook |
createWebHook(URL url,
Collection<GHEvent> events)
Create web hook gh hook.
|
GHHook |
getHook(int id)
Gets hook.
|
List<GHHook> |
getHooks()
Retrieves the currently configured hooks.
|
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() |
GHTeam |
getTeamBySlug(String slug)
Finds a team that has the given slug in its
GHTeam.getSlug() |
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)
List members with filter paged iterable.
|
PagedIterable<GHProject> |
listProjects()
Returns all open projects for the organization.
|
PagedIterable<GHProject> |
listProjects(GHProject.ProjectStateFilter status)
Returns the projects for this organization.
|
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.
|
getAvatarUrl, getBlog, getCompany, getCreatedAt, getEmail, getFollowersCount, getFollowingCount, getGravatarId, getHtmlUrl, getLocation, getLogin, getName, getPublicGistCount, getPublicRepoCount, getRepositories, getRepository, getType, getUpdatedAt, isSiteAdmin, iterateRepositories, listRepositories, populategetId, getResponseHeaderFields, getUrl, toStringpublic GHRepository createRepository(String name, String description, String homepage, String team, boolean isPublic) throws IOException
createRepository(String) that uses a builder pattern to let you control every aspect.name - the namedescription - the descriptionhomepage - the homepageteam - the teamisPublic - the is publicIOException - the io exceptionpublic GHRepository createRepository(String name, String description, String homepage, GHTeam team, boolean isPublic) throws IOException
createRepository(String) that uses a builder pattern to let you control every aspect.name - the namedescription - the descriptionhomepage - the homepageteam - the teamisPublic - the is publicIOException - the io exceptionpublic GHCreateRepositoryBuilder createRepository(String name)
You use the returned builder to set various properties, then call GHCreateRepositoryBuilder.create() to
finally createa repository.
name - the namepublic Map<String,GHTeam> getTeams() throws IOException
IOException - the io exceptionpublic PagedIterable<GHTeam> listTeams() throws IOException
IOException - the io exceptionpublic GHTeam getTeamByName(String name) throws IOException
GHTeam.getName()name - the nameIOException - the io exceptionpublic GHTeam getTeamBySlug(String slug) throws IOException
GHTeam.getSlug()slug - the slugIOException - the io exceptionpublic void add(GHUser user, GHOrganization.Role role) throws IOException
user - the userrole - the roleIOException - the io exceptionpublic boolean hasMember(GHUser user)
user - the userpublic void remove(GHUser user) throws IOException
user - the userIOException - the io exceptionpublic boolean hasPublicMember(GHUser user)
user - the userpublic void publicize(GHUser u) throws IOException
u - the uIOException - the io exceptionpublic List<GHUser> getMembers() throws IOException
listMembers()IOException - the io exceptionpublic PagedIterable<GHUser> listMembers() throws IOException
IOException - the io exceptionpublic PagedIterable<GHUser> listPublicMembers() throws IOException
IOException - the io exceptionpublic PagedIterable<GHUser> listMembersWithFilter(String filter) throws IOException
filter - the filterIOException - the io exceptionpublic void conceal(GHUser u) throws IOException
u - the uIOException - the io exceptionpublic PagedIterable<GHProject> listProjects(GHProject.ProjectStateFilter status) throws IOException
status - The status filter (all, open or closed).IOException - the io exceptionpublic PagedIterable<GHProject> listProjects() throws IOException
IOException - the io exceptionpublic GHProject createProject(String name, String body) throws IOException
name - the namebody - the bodyIOException - the io exception@Deprecated public GHTeam createTeam(String name, GHOrganization.Permission p, Collection<GHRepository> repositories) throws IOException
createTeam(String, Collection)name - the namep - the prepositories - the repositoriesIOException - the io exception@Deprecated public GHTeam createTeam(String name, GHOrganization.Permission p, GHRepository... repositories) throws IOException
createTeam(String, GHRepository...)name - the namep - the prepositories - the repositoriesIOException - the io exceptionpublic GHTeam createTeam(String name, Collection<GHRepository> repositories) throws IOException
name - the namerepositories - the repositoriesIOException - the io exceptionpublic GHTeam createTeam(String name, GHRepository... repositories) throws IOException
name - the namerepositories - the repositoriesIOException - the io exceptionpublic List<GHRepository> getRepositoriesWithOpenPullRequests() throws IOException
This used to be an efficient method that didn't involve traversing every repository, but now it doesn't do any optimization.
IOException - the io exceptionpublic List<GHPullRequest> getPullRequests() throws IOException
IOException - the io exceptionpublic PagedIterable<GHEventInfo> listEvents() throws IOException
listEvents in class GHPersonIOException - the io exceptionpublic PagedIterable<GHRepository> listRepositories(int pageSize)
listRepositories in class GHPersonpageSize - 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.public List<GHHook> getHooks() throws IOException
IOException - the io exceptionpublic GHHook getHook(int id) throws IOException
id - the idIOException - the io exceptionpublic GHHook createHook(String name, Map<String,String> config, Collection<GHEvent> events, boolean active) throws IOException
name - Type of the hook to be created. See https://api.github.com/hooks for possible names.config - The configuration hash.events - Can be null. Types of events to hook into.active - the activeIOException - the io exceptionpublic GHHook createWebHook(URL url, Collection<GHEvent> events) throws IOException
url - the urlevents - the eventsIOException - the io exceptionpublic GHHook createWebHook(URL url) throws IOException
url - the urlIOException - the io exceptionCopyright © 2020. All rights reserved.