java.lang.Object
org.kohsuke.github.GHObject
org.kohsuke.github.GHTeam
- All Implemented Interfaces:
Refreshable
A team in GitHub organization.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The Enum Privacy.static enum
Member's role in a team. -
Field Summary
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(GHRepository r) Add.void
add
(GHRepository r, GHOrganization.RepositoryRole permission) Add.void
Adds a member to the team.void
add
(GHUser user, GHTeam.Role role) Adds a member to the teamconnectToExternalGroup
(long group_id) Connect an external group to the teamConnect an external group to the teamcreateDiscussion
(String title) Begins the creation of a new instance.void
delete()
Deletes this team.void
Remove the connection of the team to an external groupboolean
Equals.Gets description.getDiscussion
(long discussionNumber) Gets a single discussion by ID.Get the external groups connected to the teamGets the html url.Gets members.getName()
Gets name.Gets organization.Gets permission.Gets the privacy state.Gets repositories.getSlug()
Gets slug.int
hashCode()
Hash code.boolean
Checks if this team has the specified user as a member.Retrieves the teams that are children of this team.Retrieves the discussions.Retrieves the current members.listMembers
(String role) List members with specified role paged iterable.listMembers
(GHTeam.Role role) List members with specified role paged iterable.List repositories paged iterable.void
refresh()
Refresh.void
Remove.void
Removes a member to the team.void
setDescription
(String description) Sets description.void
setPrivacy
(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
-
Constructor Details
-
GHTeam
public GHTeam()Create default GHTeam instance
-
-
Method Details
-
add
Add.- Parameters:
r
- the r- Throws:
IOException
- the io exception
-
add
Add.- Parameters:
r
- the rpermission
- the permission- Throws:
IOException
- the io exception
-
add
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
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
-
connectToExternalGroup
Connect an external group to the team- Parameters:
group
- the group to connect- Returns:
- the external group
- Throws:
IOException
- in case of failure- See Also:
-
connectToExternalGroup
Connect an external group to the team- Parameters:
group_id
- the identifier of the group to connect- Returns:
- the external group
- Throws:
IOException
- in case of failure- See Also:
-
createDiscussion
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
-
delete
Deletes this team.- Throws:
IOException
- the io exception
-
deleteExternalGroupConnection
Remove the connection of the team to an external group- Throws:
IOException
- in case of failure- See Also:
-
equals
Equals. -
getDescription
Gets description.- Returns:
- the description
-
getDiscussion
Gets a single discussion by ID.- Parameters:
discussionNumber
- id of the discussion that we want to query for- Returns:
- the discussion
- Throws:
IOException
- the io exception- See Also:
-
getExternalGroups
Get the external groups connected to the team- Returns:
- the external groups
- Throws:
IOException
- the io exception- See Also:
-
getHtmlUrl
Gets the html url.- Returns:
- the html url
-
getMembers
Gets members.- Returns:
- the members
- Throws:
IOException
- the io exception
-
getName
Gets name.- Returns:
- the name
-
getOrganization
Gets organization.- Returns:
- the organization
- Throws:
IOException
- the io exception
-
getPermission
Gets permission.- Returns:
- the permission
-
getPrivacy
Gets the privacy state.- Returns:
- the privacy state.
-
getRepositories
Gets repositories.- Returns:
- the repositories
-
getSlug
Gets slug.- Returns:
- the slug
-
hasMember
Checks if this team has the specified user as a member.- Parameters:
user
- the user- Returns:
- the boolean
-
hashCode
public int hashCode()Hash code. -
listChildTeams
Retrieves the teams that are children of this team.- Returns:
- the paged iterable
-
listDiscussions
Retrieves the discussions.- Returns:
- the paged iterable
-
listMembers
Retrieves the current members.- Returns:
- the paged iterable
-
listMembers
List members with specified role paged iterable.- Parameters:
role
- the role- Returns:
- the paged iterable
-
listMembers
List members with specified role paged iterable.- Parameters:
role
- the role- Returns:
- the paged iterable
-
listRepositories
List repositories paged iterable.- Returns:
- the paged iterable
-
refresh
Refresh.- Specified by:
refresh
in interfaceRefreshable
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
remove
Remove.- Parameters:
r
- the r- Throws:
IOException
- the io exception
-
remove
Removes a member to the team.- Parameters:
u
- the u- Throws:
IOException
- the io exception
-
setDescription
Sets description.- Parameters:
description
- the description- Throws:
IOException
- the io exception
-
setPrivacy
Updates the team's privacy setting.- Parameters:
privacy
- the privacy- Throws:
IOException
- the io exception
-