Package org.kohsuke.github
Class GHTeam
- java.lang.Object
-
- org.kohsuke.github.GHTeam
-
- All Implemented Interfaces:
Refreshable
public class GHTeam extends Object implements Refreshable
A team in GitHub organization.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHTeam.RoleMember's role in a team
-
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 teamvoiddelete()Deletes this team.StringgetDescription()Gets description.intgetId()Gets id.Set<GHUser>getMembers()Gets members.StringgetName()Gets name.GHOrganizationgetOrganization()Gets organization.StringgetPermission()Gets permission.Map<String,GHRepository>getRepositories()Gets repositories.StringgetSlug()Gets slug.booleanhasMember(GHUser user)Checks if this team has the specified user as a member.PagedIterable<GHUser>listMembers()Retrieves the current members.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.kohsuke.github.Refreshable
refresh
-
-
-
-
Field Detail
-
root
protected GitHub root
-
-
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
-
setDescription
public void setDescription(String description) throws IOException
Sets description.- Parameters:
description- the description- Throws:
IOException- the io exception
-
getId
public int getId()
Gets id.- Returns:
- the id
-
listMembers
public PagedIterable<GHUser> listMembers() throws IOException
Retrieves the current members.- 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
-
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
-
-