Package org.kohsuke.github
Class GHRepository
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHRepository
-
public class GHRepository extends GHObject
A repository on GitHub.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GHRepository.Contributor
The type Contributor.static class
GHRepository.ForkSort
Sort orders for listing forks
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCollaborators(Collection<GHUser> users)
Add collaborators.void
addCollaborators(Collection<GHUser> users, GHOrganization.Permission permission)
Add collaborators.void
addCollaborators(GHOrganization.Permission permission, GHUser... users)
Add collaborators.void
addCollaborators(GHUser... users)
Add collaborators.GHDeployKey
addDeployKey(String title, String key)
Add deploy key gh deploy key.void
allowMergeCommit(boolean value)
Allow merge commit.void
allowRebaseMerge(boolean value)
Allow rebase merge.void
allowSquashMerge(boolean value)
Allow squash merge.void
archive()
Will archive and this repository as read-only.GHBlobBuilder
createBlob()
Create blob gh blob builder.GHCheckRunBuilder
createCheckRun(String name, String headSHA)
Deprecated.GHCommitBuilder
createCommit()
Create commit gh commit builder.GHCommitStatus
createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description)
Create commit status gh commit status.GHCommitStatus
createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description, String context)
Creates a commit statusGHContentBuilder
createContent()
Creates a new content, or update an existing content.GHContentUpdateResponse
createContent(byte[] contentBytes, String commitMessage, String path)
Deprecated.GHContentUpdateResponse
createContent(byte[] contentBytes, String commitMessage, String path, String branch)
Deprecated.GHContentUpdateResponse
createContent(String content, String commitMessage, String path)
Deprecated.GHContentUpdateResponse
createContent(String content, String commitMessage, String path, String branch)
Deprecated.GHDeploymentBuilder
createDeployment(String ref)
Create deployment gh deployment builder.GHDeploymentStatusBuilder
createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState)
Deprecated.UsegetDeployment(deploymentId).createStatus(ghDeploymentState)
GHHook
createHook(String name, Map<String,String> config, Collection<GHEvent> events, boolean active)
See https://api.github.com/hooks for possible names and their configuration scheme.GHIssueBuilder
createIssue(String title)
Create issue gh issue builder.GHLabel
createLabel(String name, String color)
Create label gh label.GHLabel
createLabel(String name, String color, String description)
Description is still in preview.GHMilestone
createMilestone(String title, String description)
Create milestone gh milestone.GHProject
createProject(String name, String body)
Create a project for this repository.GHPullRequest
createPullRequest(String title, String head, String base, String body)
Creates a new pull request.GHPullRequest
createPullRequest(String title, String head, String base, String body, boolean maintainerCanModify)
Creates a new pull request.GHPullRequest
createPullRequest(String title, String head, String base, String body, boolean maintainerCanModify, boolean draft)
Creates a new pull request.GHRef
createRef(String name, String sha)
Creates a named ref, such as tag, branch, etc.GHReleaseBuilder
createRelease(String tag)
Create release gh release builder.GHTagObject
createTag(String tag, String message, String object, String type)
Create a tag.GHTreeBuilder
createTree()
Create tree gh tree builder.GHHook
createWebHook(URL url)
Create web hook gh hook.GHHook
createWebHook(URL url, Collection<GHEvent> events)
Create web hook gh hook.void
delete()
Deletes this repository.void
deleteBranchOnMerge(boolean value)
After pull requests are merged, you can have head branches deleted automatically.void
enableDownloads(boolean v)
Enable downloads.void
enableIssueTracker(boolean v)
Enables or disables the issue tracker for this repository.void
enableProjects(boolean v)
Enables or disables projects for this repository.void
enableWiki(boolean v)
Enables or disables Wiki for this repository.boolean
equals(Object obj)
GHRepository
fork()
Forks this repository as your repository.GHRepository
forkTo(GHOrganization org)
Forks this repository into an organization.GHBlob
getBlob(String blobSha)
Obtains the metadata & the content of a blob.GHBranch
getBranch(String name)
Gets branch.Map<String,GHBranch>
getBranches()
Gets branches by their names.PagedIterable<GHCheckRun>
getCheckRuns(String ref)
Deprecated.GHRepositoryCloneTraffic
getCloneTraffic()
Set<String>
getCollaboratorNames()
Gets the names of the collaborators on this repository.GHPersonSet<GHUser>
getCollaborators()
Gets the collaborators on this repository.GHCommit
getCommit(String sha1)
Gets a commit object in this repository.GHCompare
getCompare(String id1, String id2)
Gets a comparison between 2 points in the repository.GHCompare
getCompare(GHBranch id1, GHBranch id2)
Gets compare.GHCompare
getCompare(GHCommit id1, GHCommit id2)
Gets compare.String
getDefaultBranch()
Returns the primary branch you'll configure in the "Admin > Options" config page.List<GHDeployKey>
getDeployKeys()
Gets deploy keys.GHDeployment
getDeployment(long id)
Obtains a singleGHDeployment
by its ID.PagedIterable<GHDeploymentStatus>
getDeploymentStatuses(int id)
Deprecated.UsegetDeployment(id).listStatuses()
String
getDescription()
Gets description.List<GHContent>
getDirectoryContent(String path)
Gets directory content.List<GHContent>
getDirectoryContent(String path, String ref)
Gets directory content.GHContent
getFileContent(String path)
Gets file content.GHContent
getFileContent(String path, String ref)
Gets file content.int
getForks()
Deprecated.usegetForksCount()
insteadint
getForksCount()
Returns the number of all forks of this repository.String
getFullName()
Full repository name including the owner or organization.String
getGitTransportUrl()
Gets the git:// URL to this repository, such as "git://github.com/kohsuke/jenkins.git" This URL is read-only.String
getHomepage()
Gets homepage.GHHook
getHook(int id)
Gets hook.List<GHHook>
getHooks()
Retrieves the currently configured hooks.URL
getHtmlUrl()
Gets html url.String
getHttpTransportUrl()
Gets the HTTPS URL to this repository, such as "https://github.com/kohsuke/jenkins.git" This URL is read-only.GHIssue
getIssue(int id)
Gets issue.GHIssueEvent
getIssueEvent(long id)
Get a single issue event.List<GHIssue>
getIssues(GHIssueState state)
Gets issues.List<GHIssue>
getIssues(GHIssueState state, GHMilestone milestone)
Gets issues.GHLabel
getLabel(String name)
Gets label.String
getLanguage()
Gets the primary programming language.GHCommitStatus
getLastCommitStatus(String sha1)
Gets the last status of this commit, which is what gets shown in the UI.GHRelease
getLatestRelease()
Gets latest release.GHLicense
getLicense()
Gets the basic license details for the repository.GHContent
getLicenseContent()
Retrieves the contents of the repository's license file - makes an additional API callString
getMasterBranch()
Deprecated.Renamed togetDefaultBranch()
GHMilestone
getMilestone(int number)
Gets milestone.Map<Integer,GHMilestone>
getMilestones()
Deprecated.String
getMirrorUrl()
Gets the Mirror URL to access this repository: https://github.com/apache/tomee mirrored from git://git.apache.org/tomee.gitString
getName()
Short repository name without the owner.String
getNodeId()
Gets node idint
getOpenIssueCount()
Gets open issue count.GHUser
getOwner()
Gets owner.String
getOwnerName()
Gets owner name.GHRepository
getParent()
Forked repositories have a 'parent' attribute that specifies the repository this repository is directly forked from.GHPermissionType
getPermission(String user)
Obtain permission for a given user in this repository.GHPermissionType
getPermission(GHUser u)
Obtain permission for a given user in this repository.Set<URL>
getPostCommitHooks()
Deprecated.GHPullRequest
getPullRequest(int i)
Retrieves a specified pull request.List<GHPullRequest>
getPullRequests(GHIssueState state)
Retrieves all the pull requests of a particular state.Date
getPushedAt()
Gets pushed at.GHContent
getReadme()
https://developer.github.com/v3/repos/contents/#get-the-readmeGHRef
getRef(String refName)
Retrive a ref of the given type for the current GitHub repository.GHRef[]
getRefs()
Retrieves all refs for the github repository.GHRef[]
getRefs(String refType)
Retrieves all refs of the given type for the current GitHub repository.GHRelease
getRelease(long id)
Gets release.GHRelease
getReleaseByTagName(String tag)
Gets release by tag name.List<GHRelease>
getReleases()
Deprecated.uselistReleases()
int
getSize()
Gets size.GHRepository
getSource()
Forked repositories have a 'source' attribute that specifies the ultimate source of the forking chain.String
getSshUrl()
Gets the SSH URL to access this repository, such as [email protected]:rails/rails.gitint
getStargazersCount()
Gets stargazers count.GHRepositoryStatistics
getStatistics()
Returns the statistics for this repository.int
getSubscribersCount()
Gets subscribers count.GHSubscription
getSubscription()
Returns the current subscription.String
getSvnUrl()
Gets the Subversion URL to access this repository: https://github.com/rails/railsGHTagObject
getTagObject(String sha)
Returns the annotated tag object.Set<GHTeam>
getTeams()
If this repository belongs to an organization, return a set of teams.GHTree
getTree(String sha)
Retrive a tree of the given type for the current GitHub repository.GHTree
getTreeRecursive(String sha, int recursive)
Retrieves the tree for the current GitHub repository, recursively as described in here: https://developer.github.com/v3/git/trees/#get-a-tree-recursivelyGHRepositoryViewTraffic
getViewTraffic()
int
getWatchers()
Deprecated.usegetWatchersCount()
insteadint
getWatchersCount()
Gets the count of watchers.String
gitHttpTransportUrl()
Deprecated.Typo ofgetHttpTransportUrl()
boolean
hasAdminAccess()
Has admin access boolean.boolean
hasAssignee(GHUser u)
Checks if the given user is an assignee for this repository.boolean
hasDownloads()
Has downloads boolean.int
hashCode()
boolean
hasIssues()
Has issues boolean.boolean
hasPages()
Has pages boolean.boolean
hasProjects()
Has projects boolean.boolean
hasPullAccess()
Has pull access boolean.boolean
hasPushAccess()
Has push access boolean.boolean
hasWiki()
Has wiki boolean.boolean
isAllowMergeCommit()
Is allow merge commit boolean.boolean
isAllowRebaseMerge()
Is allow rebase merge boolean.boolean
isAllowSquashMerge()
Is allow squash merge boolean.boolean
isArchived()
Is archived boolean.boolean
isDeleteBranchOnMerge()
Automatically deleting head branches when pull requests are mergedboolean
isFork()
Is fork boolean.boolean
isPrivate()
Is private boolean.PagedIterable<GHUser>
listAssignees()
Lists all the available assignees to which issues may be assigned.PagedIterable<GHUser>
listCollaborators()
Lists up the collaborators on this repository.PagedIterable<GHCommitComment>
listCommitComments()
Lists up all the commit comments in this repository.PagedIterable<GHCommit>
listCommits()
Lists all the commits.PagedIterable<GHCommitStatus>
listCommitStatuses(String sha1)
/** Lists all the commit statuses attached to the given commit, newer ones first.PagedIterable<GHRepository.Contributor>
listContributors()
List contributors paged iterable.PagedIterable<GHDeployment>
listDeployments(String sha, String ref, String task, String environment)
List deployments paged iterable.PagedIterable<GHEventInfo>
listEvents()
Lists repository events.PagedIterable<GHRepository>
listForks()
Lists all the direct forks of this repository, sorted by github api default, currentlyForkSort.NEWEST
*.PagedIterable<GHRepository>
listForks(GHRepository.ForkSort sort)
Lists all the direct forks of this repository, sorted by the given sort order.PagedIterable<GHInvitation>
listInvitations()
Lists all the invitations.PagedIterable<GHIssueEvent>
listIssueEvents()
Get all issue events for this repository.PagedIterable<GHIssue>
listIssues(GHIssueState state)
Lists up all the issues in this repository.PagedIterable<GHLabel>
listLabels()
Lists labels in this repository.Map<String,Long>
listLanguages()
List languages for the specified repository.PagedIterable<GHMilestone>
listMilestones(GHIssueState state)
Lists up all the milestones in this repository.GHNotificationStream
listNotifications()
List all the notifications in a repository for the current user.PagedIterable<GHProject>
listProjects()
Returns open projects for this repository.PagedIterable<GHProject>
listProjects(GHProject.ProjectStateFilter status)
Returns the projects for this repository.PagedIterable<GHPullRequest>
listPullRequests(GHIssueState state)
Deprecated.PagedIterable<GHRef>
listRefs()
Retrieves all refs for the github repository.PagedIterable<GHRef>
listRefs(String refType)
Retrieves all refs of the given type for the current GitHub repository.PagedIterable<GHRelease>
listReleases()
List releases paged iterable.PagedIterable<GHUser>
listStargazers()
Lists all the users who have starred this repo based on the old version of the API.PagedIterable<GHStargazer>
listStargazers2()
Lists all the users who have starred this repo based on new version of the API, having extended information like the time when the repository was starred.PagedIterable<GHUser>
listSubscribers()
Lists all the subscribers (aka watchers.)PagedIterable<GHTag>
listTags()
List tags paged iterable.List<String>
listTopics()
Return the topics for this repository.GHCommitQueryBuilder
queryCommits()
Search commits by specifying filters through a builder pattern.GHPullRequestQueryBuilder
queryPullRequests()
Retrieves pull requests.InputStream
readBlob(String blobSha)
Reads the content of a blob as a stream for better efficiency.void
removeCollaborators(Collection<GHUser> users)
Remove collaborators.void
removeCollaborators(GHUser... users)
Remove collaborators.void
renameTo(String name)
Rename this repository.Reader
renderMarkdown(String text, MarkdownMode mode)
Render a Markdown document.void
setDefaultBranch(String value)
Sets default branch.void
setDescription(String value)
Sets description.void
setEmailServiceHook(String address)
Sets email service hook.void
setHomepage(String value)
Sets homepage.void
setPrivate(boolean value)
Sets private.void
setTopics(List<String> topics)
Set the topics for this repository.GHSubscription
subscribe(boolean subscribed, boolean ignored)
Subscribes to this repository to get notifications.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
createDeployment
public GHDeploymentBuilder createDeployment(String ref)
Create deployment gh deployment builder.- Parameters:
ref
- the ref- Returns:
- the gh deployment builder
-
getDeploymentStatuses
@Deprecated public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(int id) throws IOException
Deprecated.UsegetDeployment(id).listStatuses()
Gets deployment statuses.- Parameters:
id
- the id- Returns:
- the deployment statuses
- Throws:
IOException
- the io exception
-
listDeployments
public PagedIterable<GHDeployment> listDeployments(String sha, String ref, String task, String environment)
List deployments paged iterable.- Parameters:
sha
- the sharef
- the reftask
- the taskenvironment
- the environment- Returns:
- the paged iterable
-
getDeployment
public GHDeployment getDeployment(long id) throws IOException
Obtains a singleGHDeployment
by its ID.- Parameters:
id
- the id- Returns:
- the deployment
- Throws:
IOException
- the io exception
-
createDeployStatus
@Deprecated public GHDeploymentStatusBuilder createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState) throws IOException
Deprecated.UsegetDeployment(deploymentId).createStatus(ghDeploymentState)
Gets deploy status.- Parameters:
deploymentId
- the deployment idghDeploymentState
- the gh deployment state- Returns:
- the deploy status
- Throws:
IOException
- the io exception
-
getNodeId
public String getNodeId()
Gets node id- Overrides:
getNodeId
in classGHObject
- Returns:
- the node id
- See Also:
- Using Global Node IDs
-
getDescription
public String getDescription()
Gets description.- Returns:
- the description
-
getHomepage
public String getHomepage()
Gets homepage.- Returns:
- the homepage
-
getGitTransportUrl
public String getGitTransportUrl()
Gets the git:// URL to this repository, such as "git://github.com/kohsuke/jenkins.git" This URL is read-only.- Returns:
- the git transport url
-
getHttpTransportUrl
public String getHttpTransportUrl()
Gets the HTTPS URL to this repository, such as "https://github.com/kohsuke/jenkins.git" This URL is read-only.- Returns:
- the http transport url
-
gitHttpTransportUrl
@Deprecated public String gitHttpTransportUrl()
Deprecated.Typo ofgetHttpTransportUrl()
Git http transport url string.- Returns:
- the string
-
getSvnUrl
public String getSvnUrl()
Gets the Subversion URL to access this repository: https://github.com/rails/rails- Returns:
- the svn url
-
getMirrorUrl
public String getMirrorUrl()
Gets the Mirror URL to access this repository: https://github.com/apache/tomee mirrored from git://git.apache.org/tomee.git- Returns:
- the mirror url
-
getSshUrl
public String getSshUrl()
Gets the SSH URL to access this repository, such as [email protected]:rails/rails.git- Returns:
- the ssh url
-
getHtmlUrl
public URL getHtmlUrl()
Description copied from class:GHObject
Gets html url.- Specified by:
getHtmlUrl
in classGHObject
- Returns:
- URL of this object for humans, which renders some HTML.
-
getName
public String getName()
Short repository name without the owner. For example 'jenkins' in case of http://github.com/jenkinsci/jenkins- Returns:
- the name
-
getFullName
public String getFullName()
Full repository name including the owner or organization. For example 'jenkinsci/jenkins' in case of http://github.com/jenkinsci/jenkins- Returns:
- the full name
-
hasPullAccess
public boolean hasPullAccess()
Has pull access boolean.- Returns:
- the boolean
-
hasPushAccess
public boolean hasPushAccess()
Has push access boolean.- Returns:
- the boolean
-
hasAdminAccess
public boolean hasAdminAccess()
Has admin access boolean.- Returns:
- the boolean
-
getLanguage
public String getLanguage()
Gets the primary programming language.- Returns:
- the language
-
getOwner
public GHUser getOwner() throws IOException
Gets owner.- Returns:
- the owner
- Throws:
IOException
- the io exception
-
getIssue
public GHIssue getIssue(int id) throws IOException
Gets issue.- Parameters:
id
- the id- Returns:
- the issue
- Throws:
IOException
- the io exception
-
createIssue
public GHIssueBuilder createIssue(String title)
Create issue gh issue builder.- Parameters:
title
- the title- Returns:
- the gh issue builder
-
getIssues
public List<GHIssue> getIssues(GHIssueState state) throws IOException
Gets issues.- Parameters:
state
- the state- Returns:
- the issues
- Throws:
IOException
- the io exception
-
getIssues
public List<GHIssue> getIssues(GHIssueState state, GHMilestone milestone) throws IOException
Gets issues.- Parameters:
state
- the statemilestone
- the milestone- Returns:
- the issues
- Throws:
IOException
- the io exception
-
listIssues
public PagedIterable<GHIssue> listIssues(GHIssueState state)
Lists up all the issues in this repository.- Parameters:
state
- the state- Returns:
- the paged iterable
-
createRelease
public GHReleaseBuilder createRelease(String tag)
Create release gh release builder.- Parameters:
tag
- the tag- Returns:
- the gh release builder
-
createRef
public GHRef createRef(String name, String sha) throws IOException
Creates a named ref, such as tag, branch, etc.- Parameters:
name
- The name of the fully qualified reference (ie: refs/heads/master). If it doesn't start with 'refs' and have at least two slashes, it will be rejected.sha
- The SHA1 value to set this reference to- Returns:
- the gh ref
- Throws:
IOException
- the io exception
-
getReleases
public List<GHRelease> getReleases() throws IOException
Deprecated.uselistReleases()
Gets releases.- Returns:
- the releases
- Throws:
IOException
- the io exception
-
getRelease
public GHRelease getRelease(long id) throws IOException
Gets release.- Parameters:
id
- the id- Returns:
- the release
- Throws:
IOException
- the io exception
-
getReleaseByTagName
public GHRelease getReleaseByTagName(String tag) throws IOException
Gets release by tag name.- Parameters:
tag
- the tag- Returns:
- the release by tag name
- Throws:
IOException
- the io exception
-
getLatestRelease
public GHRelease getLatestRelease() throws IOException
Gets latest release.- Returns:
- the latest release
- Throws:
IOException
- the io exception
-
listReleases
public PagedIterable<GHRelease> listReleases() throws IOException
List releases paged iterable.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
listTags
public PagedIterable<GHTag> listTags() throws IOException
List tags paged iterable.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
listLanguages
public Map<String,Long> listLanguages() throws IOException
List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language. { "C": 78769, "Python": 7769 }- Returns:
- the map
- Throws:
IOException
- the io exception
-
getOwnerName
public String getOwnerName()
Gets owner name.- Returns:
- the owner name
-
hasIssues
public boolean hasIssues()
Has issues boolean.- Returns:
- the boolean
-
hasProjects
public boolean hasProjects()
Has projects boolean.- Returns:
- the boolean
-
hasWiki
public boolean hasWiki()
Has wiki boolean.- Returns:
- the boolean
-
isFork
public boolean isFork()
Is fork boolean.- Returns:
- the boolean
-
isArchived
public boolean isArchived()
Is archived boolean.- Returns:
- the boolean
-
isAllowSquashMerge
public boolean isAllowSquashMerge()
Is allow squash merge boolean.- Returns:
- the boolean
-
isAllowMergeCommit
public boolean isAllowMergeCommit()
Is allow merge commit boolean.- Returns:
- the boolean
-
isAllowRebaseMerge
public boolean isAllowRebaseMerge()
Is allow rebase merge boolean.- Returns:
- the boolean
-
isDeleteBranchOnMerge
public boolean isDeleteBranchOnMerge()
Automatically deleting head branches when pull requests are merged- Returns:
- the boolean
-
getForks
@Deprecated public int getForks()
Deprecated.usegetForksCount()
insteadReturns the number of all forks of this repository. This not only counts direct forks, but also forks of forks, and so on.- Returns:
- the forks
-
getForksCount
public int getForksCount()
Returns the number of all forks of this repository. This not only counts direct forks, but also forks of forks, and so on.- Returns:
- the forks
-
getStargazersCount
public int getStargazersCount()
Gets stargazers count.- Returns:
- the stargazers count
-
isPrivate
public boolean isPrivate()
Is private boolean.- Returns:
- the boolean
-
hasDownloads
public boolean hasDownloads()
Has downloads boolean.- Returns:
- the boolean
-
hasPages
public boolean hasPages()
Has pages boolean.- Returns:
- the boolean
-
getWatchers
@Deprecated public int getWatchers()
Deprecated.usegetWatchersCount()
insteadGets watchers.- Returns:
- the watchers
-
getWatchersCount
public int getWatchersCount()
Gets the count of watchers.- Returns:
- the watchers
-
getOpenIssueCount
public int getOpenIssueCount()
Gets open issue count.- Returns:
- the open issue count
-
getSubscribersCount
public int getSubscribersCount()
Gets subscribers count.- Returns:
- the subscribers count
-
getPushedAt
public Date getPushedAt()
Gets pushed at.- Returns:
- null if the repository was never pushed at.
-
getDefaultBranch
public String getDefaultBranch()
Returns the primary branch you'll configure in the "Admin > Options" config page.- Returns:
- This field is null until the user explicitly configures the master branch.
-
getMasterBranch
@Deprecated public String getMasterBranch()
Deprecated.Renamed togetDefaultBranch()
Gets master branch.- Returns:
- the master branch
-
getSize
public int getSize()
Gets size.- Returns:
- the size
-
getCollaborators
@WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHUser> getCollaborators() throws IOException
Gets the collaborators on this repository. This set always appear to include the owner.- Returns:
- the collaborators
- Throws:
IOException
- the io exception
-
listCollaborators
public PagedIterable<GHUser> listCollaborators() throws IOException
Lists up the collaborators on this repository.- Returns:
- Users paged iterable
- Throws:
IOException
- the io exception
-
listAssignees
public PagedIterable<GHUser> listAssignees() throws IOException
Lists all the available assignees to which issues may be assigned.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
hasAssignee
public boolean hasAssignee(GHUser u) throws IOException
Checks if the given user is an assignee for this repository.- Parameters:
u
- the u- Returns:
- the boolean
- Throws:
IOException
- the io exception
-
getCollaboratorNames
public Set<String> getCollaboratorNames() throws IOException
Gets the names of the collaborators on this repository. This method deviates from the principle of this library but it works a lot faster thangetCollaborators()
.- Returns:
- the collaborator names
- Throws:
IOException
- the io exception
-
getPermission
public GHPermissionType getPermission(String user) throws IOException
Obtain permission for a given user in this repository.- Parameters:
user
- aGHPerson.getLogin()
- Returns:
- the permission
- Throws:
IOException
- the io exception
-
getPermission
public GHPermissionType getPermission(GHUser u) throws IOException
Obtain permission for a given user in this repository.- Parameters:
u
- the user- Returns:
- the permission
- Throws:
IOException
- the io exception
-
getTeams
public Set<GHTeam> getTeams() throws IOException
If this repository belongs to an organization, return a set of teams.- Returns:
- the teams
- Throws:
IOException
- the io exception
-
addCollaborators
public void addCollaborators(GHOrganization.Permission permission, GHUser... users) throws IOException
Add collaborators.- Parameters:
users
- the userspermission
- the permission level- Throws:
IOException
- the io exception
-
addCollaborators
public void addCollaborators(GHUser... users) throws IOException
Add collaborators.- Parameters:
users
- the users- Throws:
IOException
- the io exception
-
addCollaborators
public void addCollaborators(Collection<GHUser> users) throws IOException
Add collaborators.- Parameters:
users
- the users- Throws:
IOException
- the io exception
-
addCollaborators
public void addCollaborators(Collection<GHUser> users, GHOrganization.Permission permission) throws IOException
Add collaborators.- Parameters:
users
- the userspermission
- the permission level- Throws:
IOException
- the io exception
-
removeCollaborators
public void removeCollaborators(GHUser... users) throws IOException
Remove collaborators.- Parameters:
users
- the users- Throws:
IOException
- the io exception
-
removeCollaborators
public void removeCollaborators(Collection<GHUser> users) throws IOException
Remove collaborators.- Parameters:
users
- the users- Throws:
IOException
- the io exception
-
setEmailServiceHook
public void setEmailServiceHook(String address) throws IOException
Sets email service hook.- Parameters:
address
- the address- Throws:
IOException
- the io exception
-
enableIssueTracker
public void enableIssueTracker(boolean v) throws IOException
Enables or disables the issue tracker for this repository.- Parameters:
v
- the v- Throws:
IOException
- the io exception
-
enableProjects
public void enableProjects(boolean v) throws IOException
Enables or disables projects for this repository.- Parameters:
v
- the v- Throws:
IOException
- the io exception
-
enableWiki
public void enableWiki(boolean v) throws IOException
Enables or disables Wiki for this repository.- Parameters:
v
- the v- Throws:
IOException
- the io exception
-
enableDownloads
public void enableDownloads(boolean v) throws IOException
Enable downloads.- Parameters:
v
- the v- Throws:
IOException
- the io exception
-
renameTo
public void renameTo(String name) throws IOException
Rename this repository.- Parameters:
name
- the name- Throws:
IOException
- the io exception
-
setDescription
public void setDescription(String value) throws IOException
Sets description.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
setHomepage
public void setHomepage(String value) throws IOException
Sets homepage.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
setDefaultBranch
public void setDefaultBranch(String value) throws IOException
Sets default branch.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
setPrivate
public void setPrivate(boolean value) throws IOException
Sets private.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
allowSquashMerge
public void allowSquashMerge(boolean value) throws IOException
Allow squash merge.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
allowMergeCommit
public void allowMergeCommit(boolean value) throws IOException
Allow merge commit.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
allowRebaseMerge
public void allowRebaseMerge(boolean value) throws IOException
Allow rebase merge.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
deleteBranchOnMerge
public void deleteBranchOnMerge(boolean value) throws IOException
After pull requests are merged, you can have head branches deleted automatically.- Parameters:
value
- the value- Throws:
IOException
- the io exception
-
delete
public void delete() throws IOException
Deletes this repository.- Throws:
IOException
- the io exception
-
archive
public void archive() throws IOException
Will archive and this repository as read-only. When a repository is archived, any operation that can change its state is forbidden. This applies symmetrically if trying to unarchive it.When you try to do any operation that modifies a read-only repository, it returns the response:
org.kohsuke.github.HttpException: { "message":"Repository was archived so is read-only.", "documentation_url":"https://developer.github.com/v3/repos/#edit" }
- Throws:
IOException
- In case of any networking error or error from the server.
-
listForks
public PagedIterable<GHRepository> listForks()
Lists all the direct forks of this repository, sorted by github api default, currentlyForkSort.NEWEST
*.- Returns:
- the paged iterable
-
listForks
public PagedIterable<GHRepository> listForks(GHRepository.ForkSort sort)
Lists all the direct forks of this repository, sorted by the given sort order.- Parameters:
sort
- the sort order. If null, defaults to github api default, currentlyForkSort.NEWEST
.- Returns:
- the paged iterable
-
fork
public GHRepository fork() throws IOException
Forks this repository as your repository.- Returns:
- Newly forked repository that belong to you.
- Throws:
IOException
- the io exception
-
forkTo
public GHRepository forkTo(GHOrganization org) throws IOException
Forks this repository into an organization.- Parameters:
org
- the org- Returns:
- Newly forked repository that belong to you.
- Throws:
IOException
- the io exception
-
getPullRequest
public GHPullRequest getPullRequest(int i) throws IOException
Retrieves a specified pull request.- Parameters:
i
- the- Returns:
- the pull request
- Throws:
IOException
- the io exception
-
getPullRequests
public List<GHPullRequest> getPullRequests(GHIssueState state) throws IOException
Retrieves all the pull requests of a particular state.- Parameters:
state
- the state- Returns:
- the pull requests
- Throws:
IOException
- the io exception- See Also:
#listPullRequests(GHIssueState)
-
listPullRequests
@Deprecated public PagedIterable<GHPullRequest> listPullRequests(GHIssueState state)
Deprecated.Retrieves all the pull requests of a particular state.- Parameters:
state
- the state- Returns:
- the paged iterable
-
queryPullRequests
public GHPullRequestQueryBuilder queryPullRequests()
Retrieves pull requests.- Returns:
- the gh pull request query builder
-
createPullRequest
public GHPullRequest createPullRequest(String title, String head, String base, String body) throws IOException
Creates a new pull request.- Parameters:
title
- Required. The title of the pull request.head
- Required. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch.base
- Required. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository.body
- The contents of the pull request. This is the markdown description of a pull request.- Returns:
- the gh pull request
- Throws:
IOException
- the io exception
-
createPullRequest
public GHPullRequest createPullRequest(String title, String head, String base, String body, boolean maintainerCanModify) throws IOException
Creates a new pull request. Maintainer's permissions aware.- Parameters:
title
- Required. The title of the pull request.head
- Required. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch.base
- Required. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository.body
- The contents of the pull request. This is the markdown description of a pull request.maintainerCanModify
- Indicates whether maintainers can modify the pull request.- Returns:
- the gh pull request
- Throws:
IOException
- the io exception
-
createPullRequest
public GHPullRequest createPullRequest(String title, String head, String base, String body, boolean maintainerCanModify, boolean draft) throws IOException
Creates a new pull request. Maintainer's permissions and draft aware.- Parameters:
title
- Required. The title of the pull request.head
- Required. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch.base
- Required. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository.body
- The contents of the pull request. This is the markdown description of a pull request.maintainerCanModify
- Indicates whether maintainers can modify the pull request.draft
- Indicates whether to create a draft pull request or not.- Returns:
- the gh pull request
- Throws:
IOException
- the io exception
-
getHooks
public List<GHHook> getHooks() throws IOException
Retrieves the currently configured hooks.- Returns:
- the hooks
- Throws:
IOException
- the io exception
-
getHook
public GHHook getHook(int id) throws IOException
Gets hook.- Parameters:
id
- the id- Returns:
- the hook
- Throws:
IOException
- the io exception
-
getCompare
public GHCompare getCompare(String id1, String id2) throws IOException
Gets a comparison between 2 points in the repository. This would be similar to callinggit log id1...id2
against a local repository.- Parameters:
id1
- an identifier for the first point to compare from, this can be a sha1 ID (for a commit, tag etc) or a direct tag nameid2
- an identifier for the second point to compare to. Can be the same as the first point.- Returns:
- the comparison output
- Throws:
IOException
- on failure communicating with GitHub
-
getCompare
public GHCompare getCompare(GHCommit id1, GHCommit id2) throws IOException
Gets compare.- Parameters:
id1
- the id 1id2
- the id 2- Returns:
- the compare
- Throws:
IOException
- the io exception
-
getCompare
public GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException
Gets compare.- Parameters:
id1
- the id 1id2
- the id 2- Returns:
- the compare
- Throws:
IOException
- the io exception
-
getRefs
public GHRef[] getRefs() throws IOException
Retrieves all refs for the github repository.- Returns:
- an array of GHRef elements coresponding with the refs in the remote repository.
- Throws:
IOException
- on failure communicating with GitHub
-
listRefs
public PagedIterable<GHRef> listRefs() throws IOException
Retrieves all refs for the github repository.- Returns:
- paged iterable of all refs
- Throws:
IOException
- on failure communicating with GitHub, potentially due to an invalid ref type being requested
-
getRefs
public GHRef[] getRefs(String refType) throws IOException
Retrieves all refs of the given type for the current GitHub repository.- Parameters:
refType
- the type of reg to search for e.g.tags
orcommits
- Returns:
- an array of all refs matching the request type
- Throws:
IOException
- on failure communicating with GitHub, potentially due to an invalid ref type being requested
-
listRefs
public PagedIterable<GHRef> listRefs(String refType) throws IOException
Retrieves all refs of the given type for the current GitHub repository.- Parameters:
refType
- the type of reg to search for e.g.tags
orcommits
- Returns:
- paged iterable of all refs of the specified type
- Throws:
IOException
- on failure communicating with GitHub, potentially due to an invalid ref type being requested
-
getRef
public GHRef getRef(String refName) throws IOException
Retrive a ref of the given type for the current GitHub repository.- Parameters:
refName
- eg: heads/branch- Returns:
- refs matching the request type
- Throws:
IOException
- on failure communicating with GitHub, potentially due to an invalid ref type being requested
-
getTagObject
public GHTagObject getTagObject(String sha) throws IOException
Returns the annotated tag object. Only valid if theGHRef.getObject()
has aGHRef.GHObject.getType()
oftag
.- Parameters:
sha
- the sha of the tag object- Returns:
- the annotated tag object
- Throws:
IOException
- the io exception
-
getTree
public GHTree getTree(String sha) throws IOException
Retrive a tree of the given type for the current GitHub repository.- Parameters:
sha
- sha number or branch name ex: "master"- Returns:
- refs matching the request type
- Throws:
IOException
- on failure communicating with GitHub, potentially due to an invalid tree type being requested
-
createTree
public GHTreeBuilder createTree()
Create tree gh tree builder.- Returns:
- the gh tree builder
-
getTreeRecursive
public GHTree getTreeRecursive(String sha, int recursive) throws IOException
Retrieves the tree for the current GitHub repository, recursively as described in here: https://developer.github.com/v3/git/trees/#get-a-tree-recursively- Parameters:
sha
- sha number or branch name ex: "master"recursive
- use 1- Returns:
- the tree recursive
- Throws:
IOException
- on failure communicating with GitHub, potentially due to an invalid tree type being requested
-
getBlob
public GHBlob getBlob(String blobSha) throws IOException
Obtains the metadata & the content of a blob.This method retrieves the whole content in memory, so beware when you are dealing with large BLOB.
- Parameters:
blobSha
- the blob sha- Returns:
- the blob
- Throws:
IOException
- the io exception- See Also:
- Get a blob,
#readBlob(String)
-
createBlob
public GHBlobBuilder createBlob()
Create blob gh blob builder.- Returns:
- the gh blob builder
-
readBlob
public InputStream readBlob(String blobSha) throws IOException
Reads the content of a blob as a stream for better efficiency.- Parameters:
blobSha
- the blob sha- Returns:
- the input stream
- Throws:
IOException
- the io exception- See Also:
- Get a blob,
#getBlob(String)
-
getCommit
public GHCommit getCommit(String sha1) throws IOException
Gets a commit object in this repository.- Parameters:
sha1
- the sha 1- Returns:
- the commit
- Throws:
IOException
- the io exception
-
createCommit
public GHCommitBuilder createCommit()
Create commit gh commit builder.- Returns:
- the gh commit builder
-
listCommits
public PagedIterable<GHCommit> listCommits()
Lists all the commits.- Returns:
- the paged iterable
-
queryCommits
public GHCommitQueryBuilder queryCommits()
Search commits by specifying filters through a builder pattern.- Returns:
- the gh commit query builder
-
listCommitComments
public PagedIterable<GHCommitComment> listCommitComments()
Lists up all the commit comments in this repository.- Returns:
- the paged iterable
-
getLicense
public GHLicense getLicense() throws IOException
Gets the basic license details for the repository.- Returns:
- null if there's no license.
- Throws:
IOException
- as usual but also if you don't use the preview connector
-
getLicenseContent
public GHContent getLicenseContent() throws IOException
Retrieves the contents of the repository's license file - makes an additional API call- Returns:
- details regarding the license contents, or null if there's no license.
- Throws:
IOException
- as usual but also if you don't use the preview connector
-
listCommitStatuses
public PagedIterable<GHCommitStatus> listCommitStatuses(String sha1) throws IOException
/** Lists all the commit statuses attached to the given commit, newer ones first.- Parameters:
sha1
- the sha 1- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
getLastCommitStatus
public GHCommitStatus getLastCommitStatus(String sha1) throws IOException
Gets the last status of this commit, which is what gets shown in the UI.- Parameters:
sha1
- the sha 1- Returns:
- the last commit status
- Throws:
IOException
- the io exception
-
getCheckRuns
@Preview @Deprecated public PagedIterable<GHCheckRun> getCheckRuns(String ref) throws IOException
Deprecated.Gets check runs for given ref.- Parameters:
ref
- ref- Returns:
- check runs for given ref
- Throws:
IOException
- the io exception- See Also:
- List check runs for a specific ref
-
createCommitStatus
public GHCommitStatus createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description, String context) throws IOException
Creates a commit status- Parameters:
sha1
- the sha 1state
- the statetargetUrl
- Optional parameter that points to the URL that has more details.description
- Optional short description.context
- Optinal commit status context.- Returns:
- the gh commit status
- Throws:
IOException
- the io exception
-
createCommitStatus
public GHCommitStatus createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description) throws IOException
Create commit status gh commit status.- Parameters:
sha1
- the sha 1state
- the statetargetUrl
- the target urldescription
- the description- Returns:
- the gh commit status
- Throws:
IOException
- the io exception- See Also:
#createCommitStatus(String, GHCommitState,String,String,String)
-
createCheckRun
@Preview @Deprecated @NonNull public GHCheckRunBuilder createCheckRun(@NonNull String name, @NonNull String headSHA)
Deprecated.Creates a check run for a commit.- Parameters:
name
- an identifier for the runheadSHA
- the commit hash- Returns:
- a builder which you should customize, then call
GHCheckRunBuilder.create()
-
listEvents
public PagedIterable<GHEventInfo> listEvents() throws IOException
Lists repository events.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
listLabels
public PagedIterable<GHLabel> listLabels() throws IOException
Lists labels in this repository.https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
getLabel
public GHLabel getLabel(String name) throws IOException
Gets label.- Parameters:
name
- the name- Returns:
- the label
- Throws:
IOException
- the io exception
-
createLabel
public GHLabel createLabel(String name, String color) throws IOException
Create label gh label.- Parameters:
name
- the namecolor
- the color- Returns:
- the gh label
- Throws:
IOException
- the io exception
-
createLabel
public GHLabel createLabel(String name, String color, String description) throws IOException
Description is still in preview.- Parameters:
name
- the namecolor
- the colordescription
- the description- Returns:
- gh label
- Throws:
IOException
- the io exception
-
listInvitations
public PagedIterable<GHInvitation> listInvitations()
Lists all the invitations.- Returns:
- the paged iterable
-
listSubscribers
public PagedIterable<GHUser> listSubscribers()
Lists all the subscribers (aka watchers.)https://developer.github.com/v3/activity/watching/
- Returns:
- the paged iterable
-
listStargazers
public PagedIterable<GHUser> listStargazers()
Lists all the users who have starred this repo based on the old version of the API. For additional information, like date when the repository was starred, seelistStargazers2()
- Returns:
- the paged iterable
-
listStargazers2
public PagedIterable<GHStargazer> listStargazers2()
Lists all the users who have starred this repo based on new version of the API, having extended information like the time when the repository was starred. For compatibility with the old API seelistStargazers()
- Returns:
- the paged iterable
-
createHook
public GHHook createHook(String name, Map<String,String> config, Collection<GHEvent> events, boolean active) throws IOException
See https://api.github.com/hooks for possible names and their configuration scheme. TODO: produce type-safe binding- Parameters:
name
- Type of the hook to be created. See https://api.github.com/hooks for possible names.config
- The configuration hash.events
- Can be null. Types of events to hook into.active
- the active- Returns:
- the gh hook
- Throws:
IOException
- the io exception
-
createWebHook
public GHHook createWebHook(URL url, Collection<GHEvent> events) throws IOException
Create web hook gh hook.- Parameters:
url
- the urlevents
- the events- Returns:
- the gh hook
- Throws:
IOException
- the io exception
-
createWebHook
public GHHook createWebHook(URL url) throws IOException
Create web hook gh hook.- Parameters:
url
- the url- Returns:
- the gh hook
- Throws:
IOException
- the io exception
-
getPostCommitHooks
@Deprecated public Set<URL> getPostCommitHooks()
Deprecated.Returns a set that represents the post-commit hook URLs. The returned set is live, and changes made to them are reflected to GitHub.- Returns:
- the post commit hooks
-
getBranches
public Map<String,GHBranch> getBranches() throws IOException
Gets branches by their names.- Returns:
- the branches
- Throws:
IOException
- the io exception
-
getBranch
public GHBranch getBranch(String name) throws IOException
Gets branch.- Parameters:
name
- the name- Returns:
- the branch
- Throws:
IOException
- the io exception
-
getMilestones
public Map<Integer,GHMilestone> getMilestones() throws IOException
Deprecated.Gets milestones.- Returns:
- the milestones
- Throws:
IOException
- the io exception
-
listMilestones
public PagedIterable<GHMilestone> listMilestones(GHIssueState state)
Lists up all the milestones in this repository.- Parameters:
state
- the state- Returns:
- the paged iterable
-
getMilestone
public GHMilestone getMilestone(int number) throws IOException
Gets milestone.- Parameters:
number
- the number- Returns:
- the milestone
- Throws:
IOException
- the io exception
-
getFileContent
public GHContent getFileContent(String path) throws IOException
Gets file content.- Parameters:
path
- the path- Returns:
- the file content
- Throws:
IOException
- the io exception
-
getFileContent
public GHContent getFileContent(String path, String ref) throws IOException
Gets file content.- Parameters:
path
- the pathref
- the ref- Returns:
- the file content
- Throws:
IOException
- the io exception
-
getDirectoryContent
public List<GHContent> getDirectoryContent(String path) throws IOException
Gets directory content.- Parameters:
path
- the path- Returns:
- the directory content
- Throws:
IOException
- the io exception
-
getDirectoryContent
public List<GHContent> getDirectoryContent(String path, String ref) throws IOException
Gets directory content.- Parameters:
path
- the pathref
- the ref- Returns:
- the directory content
- Throws:
IOException
- the io exception
-
getReadme
public GHContent getReadme() throws IOException
https://developer.github.com/v3/repos/contents/#get-the-readme- Returns:
- the readme
- Throws:
IOException
- the io exception
-
createContent
public GHContentBuilder createContent()
Creates a new content, or update an existing content.- Returns:
- the gh content builder
-
createContent
@Deprecated public GHContentUpdateResponse createContent(String content, String commitMessage, String path) throws IOException
Deprecated.UsecreateContent()
.- Parameters:
content
- the contentcommitMessage
- the commit messagepath
- the path- Returns:
- the gh content update response
- Throws:
IOException
- the io exception
-
createContent
@Deprecated public GHContentUpdateResponse createContent(String content, String commitMessage, String path, String branch) throws IOException
Deprecated.UsecreateContent()
.- Parameters:
content
- the contentcommitMessage
- the commit messagepath
- the pathbranch
- the branch- Returns:
- the gh content update response
- Throws:
IOException
- the io exception
-
createContent
@Deprecated public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path) throws IOException
Deprecated.UsecreateContent()
.- Parameters:
contentBytes
- the content bytescommitMessage
- the commit messagepath
- the path- Returns:
- the gh content update response
- Throws:
IOException
- the io exception
-
createContent
@Deprecated public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path, String branch) throws IOException
Deprecated.UsecreateContent()
.- Parameters:
contentBytes
- the content bytescommitMessage
- the commit messagepath
- the pathbranch
- the branch- Returns:
- the gh content update response
- Throws:
IOException
- the io exception
-
createMilestone
public GHMilestone createMilestone(String title, String description) throws IOException
Create milestone gh milestone.- Parameters:
title
- the titledescription
- the description- Returns:
- the gh milestone
- Throws:
IOException
- the io exception
-
addDeployKey
public GHDeployKey addDeployKey(String title, String key) throws IOException
Add deploy key gh deploy key.- Parameters:
title
- the titlekey
- the key- Returns:
- the gh deploy key
- Throws:
IOException
- the io exception
-
getDeployKeys
public List<GHDeployKey> getDeployKeys() throws IOException
Gets deploy keys.- Returns:
- the deploy keys
- Throws:
IOException
- the io exception
-
getSource
public GHRepository getSource() throws IOException
Forked repositories have a 'source' attribute that specifies the ultimate source of the forking chain.- Returns:
GHRepository
that points to the root repository where this repository is forked (indirectly or directly) from. Otherwise null.- Throws:
IOException
- the io exception- See Also:
#getParent()
-
getParent
public GHRepository getParent() throws IOException
Forked repositories have a 'parent' attribute that specifies the repository this repository is directly forked from. If we keep traversinggetParent()
until it returns null, that isgetSource()
.- Returns:
GHRepository
that points to the repository where this repository is forked directly from. Otherwise null.- Throws:
IOException
- the io exception- See Also:
#getSource()
-
subscribe
public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException
Subscribes to this repository to get notifications.- Parameters:
subscribed
- the subscribedignored
- the ignored- Returns:
- the gh subscription
- Throws:
IOException
- the io exception
-
getSubscription
public GHSubscription getSubscription() throws IOException
Returns the current subscription.- Returns:
- null if no subscription exists.
- Throws:
IOException
- the io exception
-
listContributors
public PagedIterable<GHRepository.Contributor> listContributors() throws IOException
List contributors paged iterable.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
getStatistics
public GHRepositoryStatistics getStatistics()
Returns the statistics for this repository.- Returns:
- the statistics
-
createProject
public GHProject createProject(String name, String body) throws IOException
Create a project for this repository.- Parameters:
name
- the namebody
- the body- Returns:
- the gh project
- Throws:
IOException
- the io exception
-
listProjects
public PagedIterable<GHProject> listProjects(GHProject.ProjectStateFilter status) throws IOException
Returns the projects for this repository.- Parameters:
status
- The status filter (all, open or closed).- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
listProjects
public PagedIterable<GHProject> listProjects() throws IOException
Returns open projects for this repository.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
renderMarkdown
public Reader renderMarkdown(String text, MarkdownMode mode) throws IOException
Render a Markdown document.In GFM mode, issue numbers and user mentions are linked accordingly.
- Parameters:
text
- the textmode
- the mode- Returns:
- the reader
- Throws:
IOException
- the io exception- See Also:
GitHub#renderMarkdown(String)
-
listNotifications
public GHNotificationStream listNotifications()
List all the notifications in a repository for the current user.- Returns:
- the gh notification stream
-
getViewTraffic
public GHRepositoryViewTraffic getViewTraffic() throws IOException
- Returns:
- the view traffic
- Throws:
IOException
- the io exception
-
getCloneTraffic
public GHRepositoryCloneTraffic getCloneTraffic() throws IOException
- Returns:
- the clone traffic
- Throws:
IOException
- the io exception
-
listIssueEvents
public PagedIterable<GHIssueEvent> listIssueEvents() throws IOException
Get all issue events for this repository. See https://developer.github.com/v3/issues/events/#list-events-for-a-repository- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
getIssueEvent
public GHIssueEvent getIssueEvent(long id) throws IOException
Get a single issue event. See https://developer.github.com/v3/issues/events/#get-a-single-event- Parameters:
id
- the id- Returns:
- the issue event
- Throws:
IOException
- the io exception
-
listTopics
public List<String> listTopics() throws IOException
Return the topics for this repository. See https://developer.github.com/v3/repos/#list-all-topics-for-a-repository- Returns:
- the list
- Throws:
IOException
- the io exception
-
setTopics
public void setTopics(List<String> topics) throws IOException
Set the topics for this repository. See https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository- Parameters:
topics
- the topics- Throws:
IOException
- the io exception
-
createTag
public GHTagObject createTag(String tag, String message, String object, String type) throws IOException
Create a tag. See https://developer.github.com/v3/git/tags/#create-a-tag-object- Parameters:
tag
- The tag's name.message
- The tag message.object
- The SHA of the git object this is tagging.type
- The type of the object we're tagging: "commit", "tree" or "blob".- Returns:
- The newly created tag.
- Throws:
IOException
- The IO exception.
-
-