public class

GitHubModule

extends Object
java.lang.Object
   ↳ org.mule.modules.github.GitHubModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Generic module

Summary

Fields
private String password The password
private ServiceFactory serviceFactory
private String user The user name
Public Constructors
GitHubModule()
Public Methods
void addCollaborator(String owner, String name, String user)
Adds a collaborator to the given repository

void addComment(String owner, String name, String body, String commitId, int line, String path, int position)
Creates a commit comment

void addEmails(List<String> emails)
Add one or more e-mail addresses to the currently authenticated user's account

void addTeamMember(int id, String user)
Add given user to team with given id

void addTeamRepository(int id, String owner, String name)
Add repository to team

Issue closeIssue(String user, String repository, String issueId)
Closes a GitHub issue

Comment createComment(String user, String repository, String issueId, String comment)
Create comment on specified issue id

Key createDeployKey(String owner, String name, String title, String key)
Returns a new deploy key

Comment createGistComment(String gistId, String comment)
Creates a comment on the specified gist id

Issue createIssue(String user, String repository, String title, String body, String assignee)
Creates a GitHub issue

Key createKey(String title, String key)
Create key for currently authenticated user

Label createLabel(String user, String repository, String name, String color)
Creates a new label

Milestone createMilestone(String user, String repository, String title, String state, String description, Date dueOn)
Creates a new milestone

Repository createRepository(String name, String description, boolean isPrivate, boolean hasIssues, boolean hasWiki, boolean hasDownloads)
Create a new repository

Repository createRepositoryForOrg(String organization, String name, String description, boolean isPrivate, boolean hasIssues, boolean hasWiki, boolean hasDownloads)
Create a new repository for the given organization

DownloadResource createResource(String owner, String name, String resourceName, long size, String description, String contentType)
Creates a new download resource

Team createTeam(String organization, String teamName, TeamPermission teamPermission, List<String> repoNames)
Create the given team

void deleteComment(String user, String repository, String commentId)
Delete the issue comment with the given id

void deleteCommitComment(String owner, String name, long commentId)
Deletes the given comment

void deleteDeployKey(String owner, String name, int id)
Deletes a deploy key given the given id

void deleteDownload(String owner, String name, int id)
Deletes a download given the provided id

void deleteGist(String gistId)
Deletes the given gist

void deleteGistComment(long commentId)
Deletes the given comment

void deleteKey(int id)
Delete key with given id

void deleteLabel(String user, String repository, String label)
Deletes the given label

void deleteMilestone(String user, String repository, String number)
Deletes a given milestone

void deleteTeam(int id)
Delete the team with the given id

Comment editComment(String user, String repository, Long commentId, String body)
Edits the body of the comment represented by the given comment id

void editCommitComment(String owner, String name, String body, String commitId, int line, String path, int position)
Edits a given comment

Key editDeployKey(String owner, String name, String title, String key)
Edits a given deploy key

Comment editGistComment(long commentId, String body)
Updates the given comment

Key editKey(int keyId, String title, String key)
Edit key for currently authenticated user

Repository editRepository(String owner, String name, String description, Boolean isPrivate, Boolean hasIssues, Boolean hasWiki, Boolean hasDownloads)
Edit given repository.
Team editTeam(int id, String name, TeamPermission teamPermission)
Edit the given team.
void follow(String user)
Make the currently authenticated user follow the given user

Gist forkGist(String gistId)
Forks the given gist

Repository forkRepository(String owner, String name)
Fork given repository into new repository under the currently authenticated user.
Repository forkRepositoryForOrg(String organization, String owner, String name)
Fork given repository into new repository.
List<RepositoryBranch> getBranches(String owner, String name)
Get branches in given repository

List<User> getCollaborators(String owner, String name)
Returns the list of collaborators of the given repository

CommitComment getComment(String owner, String name, long commentId)
Returns a comment from commit with the given id

List<Comment> getComments(String user, String repository, String issueId)
Get an issue's comments

RepositoryCommit getCommit(String owner, String name, String sha)
Returns a commit with given SHA-1 from given repository

List<RepositoryCommit> getCommits(String owner, String name)
Returns a list of the commits for a given repository

List<RepositoryCommit> getCommitsBySha(String owner, String name, String sha, String path)
Returns all commits in given repository beginning at an optional commit SHA-1 and affecting an optional path.
List<CommitComment> getCommmitComments(String owner, String name, String sha)
Returns all comments on commit with given Sha

List<Contributor> getContributors(String owner, String name, boolean includeAnonymous)
Get contributors to repository

User getCurrentUser()
Get the currently authenticated user

Key getDeployKey(String owner, String name, int id)
Returns the key that corresponds to the given id

List<Key> getDeployKeys(String owner, String name)
Returns all deploys keys associated with the given repository

Download getDownload(String owner, String name, int id)
Returns a single download given the provided id

List<String> getEmails()
Get all e-mail addresses for the currently authenticated user

List<User> getFollowers(String user)
Returns a list of followers for given user, if no one is provided the current authenticated user will be used

List<User> getFollowing(String user)
Returns a list users following the given user, if no one is provided the current authenticated user will be used

List<Repository> getForks(String owner, String name)
Get all the forks of the given repository

Gist getGist(String id)
Returns the gist according to the given id

Comment getGistComment(long commentId)
Returns the comment according to the given id

List<Comment> getGistComments(String gistId)
Returns a list of comments for the given gist

List<Gist> getGists(String user)
Returns a list of gists for the specified user

Issue getIssue(String user, String repository, String issueId)
Get the issue represented by the given issueId

IssueEvent getIssueEvent(String user, String repository, long eventId)
Get issue event for repository

List<Issue> getIssues(String user, String repository, Map<String, String> filterData)
Get a list of Issue objects that match the specified filter data

List<Issue> getIssuesCretedAfter(String user, String repository, int minutes)
Custom processor

List<Issue> getIssuesSinceNumber(String user, String repository, int fromIssueNumber)
Custom processor

Key getKey(int id)
Get key with given id

List<Key> getKeys()
Get all public keys for currently authenticated user

Label getLabel(String user, String repository, String label)
Returns a single label

List<Label> getLabels(String user, String repository)
Returns a list of labels for the given repository and user

Map<String, Long> getLanguages(String owner, String name)
Get languages used in given repository

Milestone getMilestone(String user, String repository, String number)
Returns a single milestone

List<Milestone> getMilestones(String user, String repository, String state)
Returns a list of milestones for the given repository

List<Repository> getOrgRepositories(String organization, Map<String, String> filterData)
Get organization repositories for the given organization

List<Repository> getRepositories(Map<String, String> filterData)
Get repositories for the currently authenticated user

List<Repository> getRepositoriesForUser(String user)
Get repositories for the given user

Repository getRepository(String owner, String name)
Get repository

List<Gist> getStarredGist()
Returns the starred gists for the currently authenticated user

List<RepositoryTag> getTags(String owner, String name)
Get tags in given repository

Team getTeam(int id)
Get team with given id

List<User> getTeamMembers(int id)
Get members of team with given id

List<Repository> getTeamRepositories(int id)
Get all repositories for given team

List<Team> getTeamsForOrg(String organization)
Get all teams in the given organization

User getUserByLoginName(String loginName)
Get user with given login name

List<Repository> getWatched(String user)
Get repositories watched by the given user

List<User> getWatchers(String owner, String name)
Get users watching given repository

boolean isCollaborator(String owner, String name, String user)
Returns whether the user is a collaborator of the given repository

boolean isFollowing(String user)
Returns wether the authenticated user is following the given user

boolean isStarred(String gistId)
Returns whether the gist is starred or not

boolean isTeamMember(int id, String user)
Is the given user a member of the team with the given id

boolean isWatching(String owner, String name)
Is currently authenticated user watching given repository?

void removeCollaborator(String owner, String name, String user)
Removes a collaborator from the given repository

void removeEmails(List<String> emails)
Removes one or more e-mail addresses to the currently authenticated user's account

void removeTeamMember(int id, String user)
Remove given user from team with given id

void removeTeamRepository(int id, String owner, String name)
Remove repository from team

void setPassword(String password)
void setServiceFactory(ServiceFactory serviceFactory)
void setUser(String user)
void setuser(String user)
void starGist(String gistId)

Star the gist with the given id

void unfollow(String user)
Make the currently authenticated user unfollow the given user

void unstarGist(String gistId)

Unstar the gist with the given id

void unwatch(String owner, String name)
Remove currently authenticated user as a watcher of the given repository

User updateCurrentUser(String name, String email, String blog, String company, String location, Boolean hireable)
Updates the currently authenticated user using the given attributes.
void watch(String owner, String name)
Add currently authenticated user as a watcher of the given repository

[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String password

The password

private ServiceFactory serviceFactory

private String user

The user name

Public Constructors

public GitHubModule ()

Public Methods

public void addCollaborator (String owner, String name, String user)

Adds a collaborator to the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
user The user that's going to be added as a collaborator to the given repository, leave empty to use this#user
Throws
IOException

public void addComment (String owner, String name, String body, String commitId, int line, String path, int position)

Creates a commit comment

Parameters
owner The name of the user that owns the repository
name The name of the repository
body Body of the commit comment
commitId Sha of the commit to comment on
line Line number in the file to comment on
path Relative path of the file to comment on
position Line index in the diff to comment on
Throws
IOException

public void addEmails (List<String> emails)

Add one or more e-mail addresses to the currently authenticated user's account

Parameters
emails The email addresses to add
Throws
IOException
IOException

public void addTeamMember (int id, String user)

Add given user to team with given id

Parameters
id The team id
user The user name
Throws
IOException
IOException

public void addTeamRepository (int id, String owner, String name)

Add repository to team

Parameters
id The team id
owner The owner of the repository
name The name of the repository
Throws
IOException
IOException

public Issue closeIssue (String user, String repository, String issueId)

Closes a GitHub issue

Parameters
user The owner of the repository, leave empty to use this#user
repository The repository name
issueId The issues's id
Returns
  • the newly created Issue
Throws
IOException

public Comment createComment (String user, String repository, String issueId, String comment)

Create comment on specified issue id

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
issueId The issue id
comment The text of the comment
Returns
  • the created Comment
Throws
IOException

public Key createDeployKey (String owner, String name, String title, String key)

Returns a new deploy key

Parameters
owner The name of the user that owns the repository
name The name of the repository
title The title of the key
key Ssh key
Returns
  • a new Key created based on the given parameters
Throws
IOException

public Comment createGistComment (String gistId, String comment)

Creates a comment on the specified gist id

Parameters
gistId Id of the gist
comment Comment to create in the gist
Returns
  • a new Comment for the gist
Throws
IOException

public Issue createIssue (String user, String repository, String title, String body, String assignee)

Creates a GitHub issue

Parameters
user The owner of the repository, leave empty to use this#user
repository The repository name
title The issues's title
body The issuess's body
assignee Optionally specify a asignee for the issue
Returns
  • the newly created Issue
Throws
IOException

public Key createKey (String title, String key)

Create key for currently authenticated user

Parameters
title The title of the new key
key The new key
Returns
  • the created Key
Throws
IOException
IOException

public Label createLabel (String user, String repository, String name, String color)

Creates a new label

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
name The name of the label
color The color of the label, a 6 character hex code, without a leading #
Returns
  • returns a new Label
Throws
IOException

public Milestone createMilestone (String user, String repository, String title, String state, String description, Date dueOn)

Creates a new milestone

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
title The title of the milestone
state The state of the milestone, open or closed, by default is open
description The description of the milestone
dueOn When the milestone is due
Returns
  • a new milestone with the given parameters
Throws
IOException

public Repository createRepository (String name, String description, boolean isPrivate, boolean hasIssues, boolean hasWiki, boolean hasDownloads)

Create a new repository

Parameters
name The name of the new repository
description A description for the new repository
isPrivate True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.
hasIssues True to enable issues for this repository, false to disable them. Default is true.
hasWiki True to enable the wiki for this repository, false to disable it. Default is true.
hasDownloads True to enable downloads for this repository, false to disable them. Default is true.
Returns
  • the created Repository
Throws
IOException
IOException

public Repository createRepositoryForOrg (String organization, String name, String description, boolean isPrivate, boolean hasIssues, boolean hasWiki, boolean hasDownloads)

Create a new repository for the given organization

Parameters
organization The organization for the new repository
name The name of the new repository
description A description for the new repository
isPrivate True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false.
hasIssues True to enable issues for this repository, false to disable them. Default is true.
hasWiki True to enable the wiki for this repository, false to disable it. Default is true.
hasDownloads True to enable downloads for this repository, false to disable them. Default is true.
Returns
  • the created Repository
Throws
IOException
IOException

public DownloadResource createResource (String owner, String name, String resourceName, long size, String description, String contentType)

Creates a new download resource

Parameters
owner The name of the user that owns the repository
name The name of the repository
resourceName The name of the resource
size Size of file in bytes.
description An optional description
contentType An optional content type
Returns
  • a new DownloadResource resource
Throws
IOException

public Team createTeam (String organization, String teamName, TeamPermission teamPermission, List<String> repoNames)

Create the given team

Parameters
organization The organization
teamName The team name
teamPermission The team's TeamPermission
repoNames The associated repository names
Returns
  • the created Team
Throws
IOException
IOException

public void deleteComment (String user, String repository, String commentId)

Delete the issue comment with the given id

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
commentId The id of the comment to delete
Throws
IOException

public void deleteCommitComment (String owner, String name, long commentId)

Deletes the given comment

Parameters
owner The name of the user that owns the repository
name The name of the repository
commentId Id from the comment
Throws
IOException

public void deleteDeployKey (String owner, String name, int id)

Deletes a deploy key given the given id

Parameters
owner The name of the user that owns the repository
name The name of the repository
id The id of the deploy key
Throws
IOException

public void deleteDownload (String owner, String name, int id)

Deletes a download given the provided id

Parameters
owner The name of the user that owns the repository
name The name of the repository
id The id of the download
Throws
IOException

public void deleteGist (String gistId)

Deletes the given gist

Parameters
gistId Id of the gist
Throws
IOException

public void deleteGistComment (long commentId)

Deletes the given comment

Parameters
commentId Id of the comment
Throws
IOException

public void deleteKey (int id)

Delete key with given id

Parameters
id The id of the key to delete
Throws
IOException
IOException

public void deleteLabel (String user, String repository, String label)

Deletes the given label

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
label The label id
Throws
IOException

public void deleteMilestone (String user, String repository, String number)

Deletes a given milestone

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
number Number of the milestone
Throws
IOException

public void deleteTeam (int id)

Delete the team with the given id

Parameters
id The id of the team to delete.
Throws
IOException
IOException

public Comment editComment (String user, String repository, Long commentId, String body)

Edits the body of the comment represented by the given comment id

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
commentId The comment id
body The new text of the comment
Returns
  • the created Comment
Throws
IOException

public void editCommitComment (String owner, String name, String body, String commitId, int line, String path, int position)

Edits a given comment

Parameters
owner The name of the user that owns the repository
name The name of the repository
body Body of the commit comment
commitId Sha of the commit to comment on
line Line number in the file to comment on
path Relative path of the file to comment on
position Line index in the diff to comment on
Throws
IOException

public Key editDeployKey (String owner, String name, String title, String key)

Edits a given deploy key

Parameters
owner The name of the user that owns the repository
name The name of the repository
title The title of the key
key Ssh key
Returns
  • the modified Key
Throws
IOException

public Comment editGistComment (long commentId, String body)

Updates the given comment

Parameters
commentId Id of the comment
body New body of the comment
Returns
  • returns the updated Comment
Throws
IOException

public Key editKey (int keyId, String title, String key)

Edit key for currently authenticated user

Parameters
keyId The id of the key to edit
title A new title for the key
key A new key
Returns
  • edited Key
Throws
IOException
IOException

public Repository editRepository (String owner, String name, String description, Boolean isPrivate, Boolean hasIssues, Boolean hasWiki, Boolean hasDownloads)

Edit given repository. Only provide values for the attributes you need to change.

Parameters
owner The owner of the repository
name The name of the repository
description A new description for the repository
isPrivate True to turn it into a private repository, false to make it public. Private repositories require a paid GitHub account.
hasIssues True to enable issues for this repository, false to disable them.
hasWiki True to enable the wiki for this repository, false to disable it.
hasDownloads True to enable downloads for this repository, false to disable them.
Returns
  • the edited Repository
Throws
IOException
IOException

public Team editTeam (int id, String name, TeamPermission teamPermission)

Edit the given team. Only provide values for the attributes you want to update.

Parameters
id The id of the team to edit
name The new name of the team
teamPermission The new TeamPermission for the team
Returns
  • the edited Team
Throws
IOException
IOException

public void follow (String user)

Make the currently authenticated user follow the given user

Parameters
user The user to follow
Throws
IOException
IOException

public Gist forkGist (String gistId)

Forks the given gist

Parameters
gistId Id of the gist to be forked
Returns
  • returns the forked gist
Throws
IOException

public Repository forkRepository (String owner, String name)

Fork given repository into new repository under the currently authenticated user.

Parameters
owner The owner of the repository
name The name of the repository
Returns
  • forked repository
Throws
IOException

public Repository forkRepositoryForOrg (String organization, String owner, String name)

Fork given repository into new repository.

The new repository will be under the given organization if non-null, else it will be under the currently authenticated user.

Parameters
organization The organization where the new repository will be
owner The owner of the repository
name The name of the repository
Returns
  • forked repository
Throws
IOException

public List<RepositoryBranch> getBranches (String owner, String name)

Get branches in given repository

Parameters
owner The owner of the repository
name The name of the repository
Returns
  • list of branches
Throws
IOException
IOException

public List<User> getCollaborators (String owner, String name)

Returns the list of collaborators of the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Returns
  • non-null but possibly empty list of User
Throws
IOException

public CommitComment getComment (String owner, String name, long commentId)

Returns a comment from commit with the given id

Parameters
owner The name of the user that owns the repository
name The name of the repository
commentId Id from the comment
Returns
  • a CommitComment that corresponds to the given id
Throws
IOException

public List<Comment> getComments (String user, String repository, String issueId)

Get an issue's comments

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
issueId The id of the issue
Returns
  • a list of Comment
Throws
IOException

public RepositoryCommit getCommit (String owner, String name, String sha)

Returns a commit with given SHA-1 from given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
sha Sha from comment
Returns
  • a RepositoryCommit for the given Sha and repository
Throws
IOException

public List<RepositoryCommit> getCommits (String owner, String name)

Returns a list of the commits for a given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Returns
  • non-null but possibly empty list of RepositoryCommit
Throws
IOException

public List<RepositoryCommit> getCommitsBySha (String owner, String name, String sha, String path)

Returns all commits in given repository beginning at an optional commit SHA-1 and affecting an optional path.

Parameters
owner The name of the user that owns the repository
name The name of the repository
sha An optional Sha or branch to start listing commits from
path Optional Only commits containing this file path will be returned
Returns
  • non-null but possibly empty list of RepositoryCommit
Throws
IOException

public List<CommitComment> getCommmitComments (String owner, String name, String sha)

Returns all comments on commit with given Sha

Parameters
owner The name of the user that owns the repository
name The name of the repository
sha Sha or branch to start listing commits comments from
Returns
  • non-null but possibly empty list of CommitComment
Throws
IOException

public List<Contributor> getContributors (String owner, String name, boolean includeAnonymous)

Get contributors to repository

Parameters
owner The owner of the repository
name The name of the repository
includeAnonymous Whether to include anonymus contributors
Returns
  • list of contributors
Throws
IOException
IOException

public User getCurrentUser ()

Get the currently authenticated user

Returns
  • a User instance representing the current user
Throws
IOException
IOException

public Key getDeployKey (String owner, String name, int id)

Returns the key that corresponds to the given id

Parameters
owner The name of the user that owns the repository
name The name of the repository
id The id of the key
Returns
  • the Key corresponding to the given id
Throws
IOException

public List<Key> getDeployKeys (String owner, String name)

Returns all deploys keys associated with the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Returns
  • non-null but possibly empty list of Key
Throws
IOException

public Download getDownload (String owner, String name, int id)

Returns a single download given the provided id

Parameters
owner The name of the user that owns the repository
name The name of the repository
id The id of the download
Returns
  • the download corresponding to the given id
Throws
IOException

public List<String> getEmails ()

Get all e-mail addresses for the currently authenticated user

Returns
  • list of e-mail address
Throws
IOException
IOException

public List<User> getFollowers (String user)

Returns a list of followers for given user, if no one is provided the current authenticated user will be used

Parameters
user The user for which to get the followers, leave empty to use current user
Returns
  • a collection of User that follow the current user
Throws
IOException
IOException

public List<User> getFollowing (String user)

Returns a list users following the given user, if no one is provided the current authenticated user will be used

Parameters
user The user for which to get who is following, leave empty to use current user
Returns
  • a collection of User the user is following
Throws
IOException
IOException

public List<Repository> getForks (String owner, String name)

Get all the forks of the given repository

Parameters
owner The owner of the repository
name The name of the repository
Returns
  • non-null but possibly empty list of repository
Throws
IOException

public Gist getGist (String id)

Returns the gist according to the given id

Parameters
id Id of the wanted gist
Returns
  • returns the Gist according to the provided id
Throws
IOException

public Comment getGistComment (long commentId)

Returns the comment according to the given id

Parameters
commentId Id of the comment to be retrieved
Returns
  • a comment corresponding to the given id
Throws
IOException

public List<Comment> getGistComments (String gistId)

Returns a list of comments for the given gist

Parameters
gistId Id of the gist
Returns
  • a list with the comments of the given gist
Throws
IOException

public List<Gist> getGists (String user)

Returns a list of gists for the specified user

Parameters
user User of the gists, leave empty to use this#user
Returns
  • a list of gists for the specified user
Throws
IOException

public Issue getIssue (String user, String repository, String issueId)

Get the issue represented by the given issueId

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
issueId The id of the issue
Returns
  • a Issue
Throws
IOException

public IssueEvent getIssueEvent (String user, String repository, long eventId)

Get issue event for repository

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
eventId The id of the event
Returns
  • a IssueEvent
Throws
IOException

public List<Issue> getIssues (String user, String repository, Map<String, String> filterData)

Get a list of Issue objects that match the specified filter data

Parameters
user The owner of the repository, leave empty to use this#user
repository The repostory name
filterData Data to filter issues, if non is specified all issues will be returned
Returns
  • list of Issue
Throws
java.io.IOException
IOException

public List<Issue> getIssuesCretedAfter (String user, String repository, int minutes)

Custom processor

Parameters
user The owner of the repository, leave empty to use this#user
repository The repository name
minutes Minutes
Returns
  • a list of Issue
Throws
IOException

public List<Issue> getIssuesSinceNumber (String user, String repository, int fromIssueNumber)

Custom processor

Parameters
user The owner of the repository, leave empty to use this#user
repository The repository name
fromIssueNumber From issue number
Returns
  • a list of Issue
Throws
IOException

public Key getKey (int id)

Get key with given id

Parameters
id The id of the key of obtain
Returns
  • a Key instance
Throws
IOException
IOException

public List<Key> getKeys ()

Get all public keys for currently authenticated user

Returns
  • non-null list of Key
Throws
IOException
IOException

public Label getLabel (String user, String repository, String label)

Returns a single label

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
label The label id
Returns
  • the label associated to the given id
Throws
IOException

public List<Label> getLabels (String user, String repository)

Returns a list of labels for the given repository and user

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
Returns
  • a list of labels for the given repository and user
Throws
IOException

public Map<String, Long> getLanguages (String owner, String name)

Get languages used in given repository

Parameters
owner The owner of the repository
name The name of the repository
Returns
  • map of language names mapped to line counts
Throws
IOException\
IOException

public Milestone getMilestone (String user, String repository, String number)

Returns a single milestone

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
number Milestone number
Returns
  • returns a single milestone
Throws
IOException

public List<Milestone> getMilestones (String user, String repository, String state)

Returns a list of milestones for the given repository

Parameters
user The owner of the repository, leave empty to use this#user
repository The name of the repository
state State of the milestone, open or closed
Returns
  • s list of Milestone for the given repository
Throws
IOException

public List<Repository> getOrgRepositories (String organization, Map<String, String> filterData)

Get organization repositories for the given organization

Parameters
organization The organization for which to get the repositories for
filterData Data to filter repos, if non is specified all repos will be returned
Returns
  • list of Repository
Throws
IOException
IOException

public List<Repository> getRepositories (Map<String, String> filterData)

Get repositories for the currently authenticated user

Parameters
filterData Data to filter repos, if non is specified all repos will be returned
Returns
  • list of Repository
Throws
IOException
IOException

public List<Repository> getRepositoriesForUser (String user)

Get repositories for the given user

Parameters
user The user for which to get the repositories for
Returns
  • list of Repository
Throws
IOException
IOException

public Repository getRepository (String owner, String name)

Get repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Returns
  • repository
Throws
IOException
IOException

public List<Gist> getStarredGist ()

Returns the starred gists for the currently authenticated user

Returns
  • list of starred Gist for currently authenticated user
Throws
IOException

public List<RepositoryTag> getTags (String owner, String name)

Get tags in given repository

Parameters
owner The owner of the repository
name The name of the repository
Returns
  • list of tags
Throws
IOException
IOException

public Team getTeam (int id)

Get team with given id

Parameters
id The id of the team
Returns
  • a Team instance
Throws
IOException
IOException

public List<User> getTeamMembers (int id)

Get members of team with given id

Parameters
id The team id
Returns
  • team members
Throws
IOException
IOException

public List<Repository> getTeamRepositories (int id)

Get all repositories for given team

Parameters
id The team id
Returns
  • non-null list of repositories
Throws
IOException
IOException

public List<Team> getTeamsForOrg (String organization)

Get all teams in the given organization

Parameters
organization The organization for which te get the teams associated with
Returns
  • list of Team
Throws
IOException
IOException

public User getUserByLoginName (String loginName)

Get user with given login name

Parameters
loginName The login name of the user to look up
Returns
  • a User instance
Throws
IOException
IOException

public List<Repository> getWatched (String user)

Get repositories watched by the given user

Parameters
user The user for which the get the watched repositories, leave empty to use this#user
Returns
  • non-null but possibly empty list of Repository
Throws
IOException

public List<User> getWatchers (String owner, String name)

Get users watching given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Returns
  • non-null but possibly empty list of User
Throws
IOException

public boolean isCollaborator (String owner, String name, String user)

Returns whether the user is a collaborator of the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
user The user to consult if it's a collaborator or not, leave empty to use this#user
Returns
  • true if the user is a collaborator, false otherwise
Throws
IOException

public boolean isFollowing (String user)

Returns wether the authenticated user is following the given user

Parameters
user The user to check
Returns
  • wether the authenticated user is following the given user
Throws
IOException
IOException

public boolean isStarred (String gistId)

Returns whether the gist is starred or not

Parameters
gistId Id of the gist
Returns
  • returns true if the gist is starred, false otherwise
Throws
IOException

public boolean isTeamMember (int id, String user)

Is the given user a member of the team with the given id

Parameters
id The team id
user The user name
Returns
  • true if member, false if not member
Throws
IOException
IOException

public boolean isWatching (String owner, String name)

Is currently authenticated user watching given repository?

Parameters
owner The name of the user that owns the repository
name The name of the repository
Returns
  • true if watch, false otherwise
Throws
IOException

public void removeCollaborator (String owner, String name, String user)

Removes a collaborator from the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
user The user that's going to be removed as a collaborator from the given repository, leave empty to use this#user
Throws
IOException

public void removeEmails (List<String> emails)

Removes one or more e-mail addresses to the currently authenticated user's account

Parameters
emails The email addresses to add
Throws
IOException
IOException

public void removeTeamMember (int id, String user)

Remove given user from team with given id

Parameters
id The team id
user The user name
Throws
IOException
IOException

public void removeTeamRepository (int id, String owner, String name)

Remove repository from team

Parameters
id The team id
owner The owner of the repository
name The name of the repository
Throws
IOException
IOException

public void setPassword (String password)

Parameters
password

public void setServiceFactory (ServiceFactory serviceFactory)

Parameters
serviceFactory

public void setUser (String user)

Parameters
user

public void setuser (String user)

Parameters
user

public void starGist (String gistId)

Star the gist with the given id

Parameters
gistId Id of the gist to be starred
Throws
IOException

public void unfollow (String user)

Make the currently authenticated user unfollow the given user

Parameters
user The user to unfollow
Throws
IOException
IOException

public void unstarGist (String gistId)

Unstar the gist with the given id

Parameters
gistId Id of the gist to be unstarred
Throws
IOException

public void unwatch (String owner, String name)

Remove currently authenticated user as a watcher of the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Throws
IOException

public User updateCurrentUser (String name, String email, String blog, String company, String location, Boolean hireable)

Updates the currently authenticated user using the given attributes. Only provide values for the attributes you want to change.

Parameters
name A the name for the current user
email A publicly visibile email address for the current user
blog A blog for the current user
company A company for the current user
location A location for the current user
hireable Whether the current user is hireable
Returns
  • a User instance representing the current user
Throws
IOException
IOException

public void watch (String owner, String name)

Add currently authenticated user as a watcher of the given repository

Parameters
owner The name of the user that owns the repository
name The name of the repository
Throws
IOException