Package org.kohsuke.github
Class GHTeam
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHTeam
-
- All Implemented Interfaces:
Refreshable
public class GHTeam extends GHObject implements Refreshable
A team in GitHub organization.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHTeam.Privacystatic classGHTeam.RoleMember's role in a team
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHTeam()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(GHRepository r)Add.voidadd(GHRepository r, GHOrganization.Permission permission)Add.voidadd(GHUser u)Adds a member to the team.voidadd(GHUser user, GHTeam.Role role)Adds a member to the teamGHDiscussion.CreatorcreateDiscussion(String title)Begins the creation of a new instance.voiddelete()Deletes this team.booleanequals(Object o)StringgetDescription()Gets description.GHDiscussiongetDiscussion(long discussionNumber)Gets a single discussion by ID.URLgetHtmlUrl()Gets html url.Set<GHUser>getMembers()Gets members.StringgetName()Gets name.GHOrganizationgetOrganization()Gets organization.StringgetPermission()Gets permission.GHTeam.PrivacygetPrivacy()Gets the privacy state.Map<String,GHRepository>getRepositories()Gets repositories.StringgetSlug()Gets slug.inthashCode()booleanhasMember(GHUser user)Checks if this team has the specified user as a member.PagedIterable<GHTeam>listChildTeams()Retrieves the teams that are children of this team.PagedIterable<GHDiscussion>listDiscussions()Retrieves the discussions.PagedIterable<GHUser>listMembers()Retrieves the current members.PagedIterable<GHUser>listMembers(String role)List members with specified role paged iterable.PagedIterable<GHRepository>listRepositories()List repositories paged iterable.voidrefresh()Opens a connection to the given URL.voidremove(GHRepository r)Remove.voidremove(GHUser u)Removes a member to the team.voidsetDescription(String description)Sets description.voidsetPrivacy(GHTeam.Privacy privacy)Updates the team's privacy setting.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.kohsuke.github.Refreshable
refresh
-
-
-
-
Method Detail
-
getName
public String getName()
Gets name.- Returns:
- the name
-
getPermission
public String getPermission()
Gets permission.- Returns:
- the permission
-
getSlug
public String getSlug()
Gets slug.- Returns:
- the slug
-
getDescription
public String getDescription()
Gets description.- Returns:
- the description
-
getPrivacy
public GHTeam.Privacy getPrivacy()
Gets the privacy state.- Returns:
- the privacy state.
-
setDescription
public void setDescription(String description) throws IOException
Sets description.- Parameters:
description- the description- Throws:
IOException- the io exception
-
setPrivacy
public void setPrivacy(GHTeam.Privacy privacy) throws IOException
Updates the team's privacy setting.- Parameters:
privacy- the privacy- Throws:
IOException- the io exception
-
listDiscussions
@Nonnull public PagedIterable<GHDiscussion> listDiscussions() throws IOException
Retrieves the discussions.- Returns:
- the paged iterable
- Throws:
IOException- the io exception
-
listMembers
public PagedIterable<GHUser> listMembers(String role) throws IOException
List members with specified role paged iterable.- Parameters:
role- the role- Returns:
- the paged iterable
- Throws:
IOException- the io exception
-
getDiscussion
@Nonnull public GHDiscussion getDiscussion(long discussionNumber) throws IOException
Gets a single discussion by ID.- Parameters:
discussionNumber- id of the discussion that we want to query for- Returns:
- the discussion
- Throws:
FileNotFoundException- if the discussion does not existIOException- the io exception- See Also:
- documentation
-
listMembers
public PagedIterable<GHUser> listMembers() throws IOException
Retrieves the current members.- Returns:
- the paged iterable
- Throws:
IOException- the io exception
-
listChildTeams
public PagedIterable<GHTeam> listChildTeams() throws IOException
Retrieves the teams that are children of this team.- Returns:
- the paged iterable
- Throws:
IOException- the io exception
-
getMembers
public Set<GHUser> getMembers() throws IOException
Gets members.- Returns:
- the members
- Throws:
IOException- the io exception
-
hasMember
public boolean hasMember(GHUser user)
Checks if this team has the specified user as a member.- Parameters:
user- the user- Returns:
- the boolean
-
getRepositories
public Map<String,GHRepository> getRepositories() throws IOException
Gets repositories.- Returns:
- the repositories
- Throws:
IOException- the io exception
-
listRepositories
public PagedIterable<GHRepository> listRepositories()
List repositories paged iterable.- Returns:
- the paged iterable
-
add
public void add(GHUser u) throws IOException
Adds a member to the team.The user will be invited to the organization if required.
- Parameters:
u- the u- Throws:
IOException- the io exception- Since:
- 1.59
-
add
public void add(GHUser user, GHTeam.Role role) throws IOException
Adds a member to the teamThe user will be invited to the organization if required.
- Parameters:
user- github userrole- role for the new member- Throws:
IOException- the io exception
-
remove
public void remove(GHUser u) throws IOException
Removes a member to the team.- Parameters:
u- the u- Throws:
IOException- the io exception
-
add
public void add(GHRepository r) throws IOException
Add.- Parameters:
r- the r- Throws:
IOException- the io exception
-
add
public void add(GHRepository r, GHOrganization.Permission permission) throws IOException
Add.- Parameters:
r- the rpermission- the permission- Throws:
IOException- the io exception
-
remove
public void remove(GHRepository r) throws IOException
Remove.- Parameters:
r- the r- Throws:
IOException- the io exception
-
delete
public void delete() throws IOExceptionDeletes this team.- Throws:
IOException- the io exception
-
createDiscussion
public GHDiscussion.Creator createDiscussion(String title) throws IOException
Begins the creation of a new instance. Consumer must callAbstractBuilder.done()to commit changes.- Parameters:
title- title of the discussion to be created- Returns:
- a
GHDiscussion.Creator - Throws:
IOException- the io exception
-
getOrganization
public GHOrganization getOrganization() throws IOException
Gets organization.- Returns:
- the organization
- Throws:
IOException- the io exception
-
refresh
public void refresh() throws IOExceptionDescription copied from interface:RefreshableOpens a connection to the given URL.- Specified by:
refreshin interfaceRefreshable- Throws:
IOException- the io exception
-
getHtmlUrl
public URL getHtmlUrl()
Description copied from class:GHObjectGets html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- URL of this object for humans, which renders some HTML.
-
-