org.eclipse.egit.github.core.service
Class TeamService

java.lang.Object
  extended by org.eclipse.egit.github.core.service.GitHubService
      extended by org.eclipse.egit.github.core.service.TeamService

public class TeamService
extends GitHubService

Service class for working with organization teams

See Also:
GitHub team API documentation

Field Summary
 
Fields inherited from class org.eclipse.egit.github.core.service.GitHubService
ACCEPT_FULL, ACCEPT_HTML, ACCEPT_TEXT, client
 
Constructor Summary
TeamService()
          Create team service
TeamService(GitHubClient client)
          Create team service
 
Method Summary
 void addMember(int id, String user)
          Add given user to team with given id
 void addRepository(int id, IRepositoryIdProvider repository)
          Add repository to team
 Team createTeam(String organization, Team team)
          Create the given team
 Team createTeam(String organization, Team team, List<String> repoNames)
          Create the given team
 void deleteTeam(int id)
          Delete the team with the given id
 Team editTeam(Team team)
          Edit the given team
 List<User> getMembers(int id)
          Get members of team with given id
 List<Repository> getRepositories(int id)
          Get all repositories for given team
 Team getTeam(int id)
          Get team with given id
 List<Team> getTeams(IRepositoryIdProvider repository)
          Get teams associated with given repository
 List<Team> getTeams(String organization)
          Get all teams in the given organization
 boolean isMember(int id, String user)
          Is the given user a member of the team with the given id
 boolean isTeamRepository(int id, IRepositoryIdProvider repository)
          Is given repository managed by given team
 void removeMember(int id, String user)
          Remove given user from team with given id
 void removeRepository(int id, IRepositoryIdProvider repository)
          Remove repository from team
 
Methods inherited from class org.eclipse.egit.github.core.service.GitHubService
check, createPagedRequest, createPagedRequest, createPageIterator, createRequest, getAll, getAll, getClient, getId, verifyRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeamService

public TeamService()
Create team service


TeamService

public TeamService(GitHubClient client)
Create team service

Parameters:
client -
Method Detail

getTeam

public Team getTeam(int id)
             throws IOException
Get team with given id

Parameters:
id -
Returns:
team
Throws:
IOException

getTeams

public List<Team> getTeams(String organization)
                    throws IOException
Get all teams in the given organization

Parameters:
organization -
Returns:
list of teams
Throws:
IOException

createTeam

public Team createTeam(String organization,
                       Team team)
                throws IOException
Create the given team

Parameters:
organization -
team -
Returns:
created team
Throws:
IOException

createTeam

public Team createTeam(String organization,
                       Team team,
                       List<String> repoNames)
                throws IOException
Create the given team

Parameters:
organization -
team -
repoNames -
Returns:
created team
Throws:
IOException

editTeam

public Team editTeam(Team team)
              throws IOException
Edit the given team

Parameters:
team -
Returns:
edited team
Throws:
IOException

deleteTeam

public void deleteTeam(int id)
                throws IOException
Delete the team with the given id

Parameters:
id -
Throws:
IOException

getMembers

public List<User> getMembers(int id)
                      throws IOException
Get members of team with given id

Parameters:
id -
Returns:
team members
Throws:
IOException

isMember

public boolean isMember(int id,
                        String user)
                 throws IOException
Is the given user a member of the team with the given id

Parameters:
id -
user -
Returns:
true if member, false if not member
Throws:
IOException

addMember

public void addMember(int id,
                      String user)
               throws IOException
Add given user to team with given id

Parameters:
id -
user -
Throws:
IOException

removeMember

public void removeMember(int id,
                         String user)
                  throws IOException
Remove given user from team with given id

Parameters:
id -
user -
Throws:
IOException

getRepositories

public List<Repository> getRepositories(int id)
                                 throws IOException
Get all repositories for given team

Parameters:
id -
Returns:
non-null list of repositories
Throws:
IOException

isTeamRepository

public boolean isTeamRepository(int id,
                                IRepositoryIdProvider repository)
                         throws IOException
Is given repository managed by given team

Parameters:
id -
repository -
Returns:
true if managed by team, false otherwise
Throws:
IOException

addRepository

public void addRepository(int id,
                          IRepositoryIdProvider repository)
                   throws IOException
Add repository to team

Parameters:
id -
repository -
Throws:
IOException

removeRepository

public void removeRepository(int id,
                             IRepositoryIdProvider repository)
                      throws IOException
Remove repository from team

Parameters:
id -
repository -
Throws:
IOException

getTeams

public List<Team> getTeams(IRepositoryIdProvider repository)
                    throws IOException
Get teams associated with given repository

Parameters:
repository -
Returns:
list of teams
Throws:
IOException


Copyright © 2012. All Rights Reserved.