Klasse GHRepository
java.lang.Object
de.coho04.githubapi.bases.GHBase
de.coho04.githubapi.bases.ClassBase
de.coho04.githubapi.entities.repositories.GHRepository
- Alle implementierten Schnittstellen:
HttpRequestInterface,JSONHelper
This class represents a GitHub repository.
It provides methods for fetching and manipulating data about the repository such as its size, forks, license, name, owner, watchers, and more.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen de.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T> -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungGHRepository(org.json.JSONObject jsonObject, Github github) Constructs a new GHRepository instance with the provided JSON object and GitHub instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaddFile()Starts the process of adding a new file to this repository.Starts the process of adding a new file to the given branch of this repository.Starts the process of adding a new file with the given path, content, and commit message to the given branch of this repository.createIssue(String title) Creates a new issue in this repository with the given title.Creates a project in the organization.createProject(String name, String body) Creates a project in the organization.booleandeleteActionsCache(int id) Deletes the actions cache with the given ID in this repository.voiddeleteActionsCache(String key) Deletes the actions cache with the given key in this repository.deleteArtifact(int id) Deletes the artifact with the given ID in this repository.Fetches all filenames in this repository.Returns the URL for fetching the archive of this repository.getArtifact(int id) Fetches the artifact with the given ID in this repository.Returns the URL for fetching assignees in this repository.Returns the URL for fetching blobs in this repository.Fetches the branches of this repository.Returns the URL for fetching the branches of this repository.getCache()Fetches the cache of this repository.Returns the clone URL of this repository.Returns the URL for fetching collaborators of this repository.Returns the URL for fetching comments in this repository.Returns the URL for fetching commits in this repository.Returns the URL for comparing commits in this repository.Returns the URL for fetching contents of this repository.Fetches the contributors of this repository.Returns the URL for fetching contributors to this repository.Returns the date and time when this repository was created.Returns the default branch of this repository.Returns the URL for fetching deployments in this repository.Returns the description of this repository.getDirectoryContent(String path) Fetches the content of the directory at the given path in this repository.Returns the URL for fetching downloads in this repository.getEnvironmentPublicKey(String environment) Fetches the public key of the given environment in this repository.getEnvironmentSecret(String environment, String name) Fetches the secret with the given name in the specified environment.getEnvironmentVariable(String environment, String name) Fetches the variable with the given name in the specified environment.intgetForks()Returns the number of forks of this repository.intReturns the number of forks of this repository.Returns the URL for fetching forks of this repository.Returns the full name of this repository.Returns the URL for fetching git commits in this repository.Returns the URL for fetching git references in this repository.Returns the URL for fetching git tags in this repository.Returns the git URL of this repository.Returns the homepage URL of this repository.Returns the URL for fetching hooks in this repository.getIssueById(int id) Fetches the issue with the given ID in this repository.Returns the URL for fetching issue comments in this repository.Returns the URL for fetching issue events in this repository.Fetches the issues of this repository with the given state.Returns the URL for fetching issues in this repository.getJobFromWorkflowRun(int id) Fetches the workflow job with the given ID in this repository.Returns the URL for fetching keys in this repository.Returns the URL for fetching labels in this repository.Returns the primary programming language used in this repository.Returns the URL for fetching languages used in this repository.Returns the license associated with this repository.Returns the URL for fetching merges in this repository.Returns the URL for fetching milestones in this repository.Returns the mirror URL of this repository.getName()Returns the name of this repository.Returns the URL for fetching notifications in this repository.intReturns the number of open issues in this repository.intReturns the number of open issues in this repository.getOwner()Returns the owner of this repository.Returns the permissions associated with this repository.Fetches the public key of this repository.Returns the URL for fetching pull requests in this repository.Returns the date and time when this repository was last pushed to.Returns the URL for fetching releases in this repository.static GHRepositorygetRepository(Github github, String owner, String name) Fetches and returns a GitHub repository based on the provided owner and name.Fetches the secret with the given name in this repository.intgetSize()Returns the size of this repository.Returns the SSH URL of this repository.intReturns the number of stargazers for this repository.Returns the URL for fetching stargazers of this repository.Returns the URL for fetching statuses in this repository.Returns the URL for fetching subscribers of this repository.Returns the URL for subscribing to this repository.Returns the SVN URL of this repository.Returns the URL for fetching tags in this repository.Returns the URL for fetching teams associated with this repository.Returns the list of topics associated with this repository.Returns the URL for fetching trees in this repository.Returns the date and time when this repository was last updated.getVariable(String name) Fetches the variable with the given name in this repository.Returns the visibility of this repository.intReturns the number of watchers of this repository.intReturns the number of watchers in this repository.getWorkflowRun(int id) Fetches the workflow run with the given ID in this repository.booleanhasPullRequestsWithState(GHState state) Checks if this repository has any pull requests with the given state.booleanReturns whether forking is allowed for this repository.booleanReturns whether this repository is archived.booleanReturns whether this repository is disabled.booleanisFork()Returns whether this repository is a fork.booleanReturns whether this repository has discussions enabled.booleanReturns whether this repository has downloads enabled.booleanReturns whether this repository has issues enabled.booleanReturns whether this repository has GitHub Pages enabled.booleanReturns whether this repository has projects enabled.booleanReturns whether this repository has a wiki enabled.booleanReturns whether this repository is private.booleanReturns whether this repository is a template repository.booleanReturns whether web commit signoff is required for this repository.Fetches the list of actions caches in this repository.Fetches the list of artifacts in this repository.listEnvironmentSecrets(String environment) Fetches the list of environment secrets in this repository.listEnvironmentVariables(String environment) Fetches the list of environment variables in the specified environment.Fetches the list of events in this repository.listJobsForWorkflowAttempt(int id, int attempt) Fetches the list of jobs for the specified workflow attempt.listJobsFromWorkflowRun(int id) Fetches the list of jobs in the specified workflow run.Fetches the list of organisation secrets in this repository.Fetches the list of organisation variables in this repository.Fetches the list of pull requests in this repository.Fetches the list of repository secrets in this repository.Fetches the list of repository variables in this repository.voidUpdates the homepage of this repository.voidupdateTopics(List<String> topics) Updates the topics of this repository.Von Klasse geerbte Methoden de.coho04.githubapi.bases.ClassBase
getEventsUrl, getHtmlUrl, getId, getNodeId, getUrl, toJSONObjectVon Klasse geerbte Methoden de.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrlVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden de.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequestVon Schnittstelle geerbte Methoden de.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Konstruktordetails
-
GHRepository
Constructs a new GHRepository instance with the provided JSON object and GitHub instance.- Parameter:
jsonObject- the JSON object containing the repository datagithub- the GitHub instance associated with this repository
-
-
Methodendetails
-
getRepository
Fetches and returns a GitHub repository based on the provided owner and name.- Parameter:
github- the GitHub instance associated with this repositoryowner- the username of the owner of the repositoryname- the name of the repository- Gibt zurück:
- a GHRepository instance representing the fetched repository
-
createIssue
Creates a new issue in this repository with the given title.- Parameter:
title- the title of the new issue- Gibt zurück:
- a GHIssueBuilder instance for building the new issue
-
getBranches
Fetches the branches of this repository.- Gibt zurück:
- a HashMap mapping branch names to GHBranch instances
-
getContributors
Fetches the contributors of this repository.- Gibt zurück:
- a List of GHUser instances representing the contributors of this repository
-
getIssues
Fetches the issues of this repository with the given state.- Gibt zurück:
- a List of GHIssue instances representing the issues of this repository with the given state
-
getIssueById
Fetches the issue with the given ID in this repository.- Parameter:
id- the ID of the issue to fetch- Gibt zurück:
- a GHIssue instance representing the fetched issue
-
addFile
Starts the process of adding a new file to this repository.- Gibt zurück:
- a GHFileBuilder instance for building the new file
-
addFile
Starts the process of adding a new file to the given branch of this repository.- Parameter:
branch- the branch to add the new file to- Gibt zurück:
- a GHFileBuilder instance for building the new file
-
addFile
Starts the process of adding a new file with the given path, content, and commit message to the given branch of this repository.- Parameter:
branch- the branch to add the new file topath- the path of the new filecontent- the content of the new filemessage- the commit message for the new file- Gibt zurück:
- a GHFileBuilder instance for building the new file
-
getAllFilenames
Fetches all filenames in this repository.- Gibt zurück:
- a List of Strings representing all filenames in this repository
-
getDirectoryContent
Fetches the content of the directory at the given path in this repository.- Parameter:
path- the path of the directory- Gibt zurück:
- a List of GHFile instances representing the content of the directory
-
getForks
public int getForks()Returns the number of forks of this repository.- Gibt zurück:
- the number of forks
-
getOpenIssuesCount
public int getOpenIssuesCount()Returns the number of open issues in this repository.- Gibt zurück:
- the number of open issues
-
getSize
public int getSize()Returns the size of this repository.- Gibt zurück:
- the size of the repository
-
getStargazersCount
public int getStargazersCount()Returns the number of stargazers for this repository.- Gibt zurück:
- the number of stargazers
-
getPermissions
Returns the permissions associated with this repository.- Gibt zurück:
- the permissions
-
getPushedAt
Returns the date and time when this repository was last pushed to.- Gibt zurück:
- the date and time of the last push
-
getBranchesUrl
Returns the URL for fetching the branches of this repository.- Gibt zurück:
- the branches URL
-
getIssueCommentUrl
Returns the URL for fetching issue comments in this repository.- Gibt zurück:
- the issue comment URL
-
getArchiveUrl
Returns the URL for fetching the archive of this repository.- Gibt zurück:
- the archive URL
-
getLabelsUrl
Returns the URL for fetching labels in this repository.- Gibt zurück:
- the labels URL
-
getLanguage
Returns the primary programming language used in this repository.- Gibt zurück:
- the programming language
-
getReleasesUrl
Returns the URL for fetching releases in this repository.- Gibt zurück:
- the releases URL
-
getSubscribersUrl
Returns the URL for fetching subscribers of this repository.- Gibt zurück:
- the subscribers URL
-
getSubscriptionUrl
Returns the URL for subscribing to this repository.- Gibt zurück:
- the subscription URL
-
getForksUrl
Returns the URL for fetching forks of this repository.- Gibt zurück:
- the forks URL
-
getGitRefsUrl
Returns the URL for fetching git references in this repository.- Gibt zurück:
- the git references URL
-
getWatchers
public int getWatchers()Returns the number of watchers of this repository.- Gibt zurück:
- the number of watchers
-
getSvnUrl
Returns the SVN URL of this repository.- Gibt zurück:
- the SVN URL
-
getCreatedAt
Returns the date and time when this repository was created.- Gibt zurück:
- the creation date and time
-
getUpdatedAt
Returns the date and time when this repository was last updated.- Gibt zurück:
- the update date and time
-
getBlobsUrl
Returns the URL for fetching blobs in this repository.- Gibt zurück:
- the blobs URL
-
getCloneUrl
Returns the clone URL of this repository.- Gibt zurück:
- the clone URL
-
getCollaboratorsUrl
Returns the URL for fetching collaborators of this repository.- Gibt zurück:
- the collaborators URL
-
getCommentsUrl
Returns the URL for fetching comments in this repository.- Gibt zurück:
- the comments URL
-
getCommitsUrl
Returns the URL for fetching commits in this repository.- Gibt zurück:
- the commits URL
-
getVisibility
Returns the visibility of this repository.- Gibt zurück:
- the visibility
-
getCompareUrl
Returns the URL for comparing commits in this repository.- Gibt zurück:
- the compare URL
-
getContentsUrl
Returns the URL for fetching contents of this repository.- Gibt zurück:
- the contents URL
-
getContributorsUrl
Returns the URL for fetching contributors to this repository.- Gibt zurück:
- the contributors URL
-
getDefaultBranch
Returns the default branch of this repository.- Gibt zurück:
- the default branch
-
getDeploymentsUrl
Returns the URL for fetching deployments in this repository.- Gibt zurück:
- the deployments URL
-
getDescription
Returns the description of this repository.- Gibt zurück:
- the description
-
getDownloadsUrl
Returns the URL for fetching downloads in this repository.- Gibt zurück:
- the downloads URL
-
getStatusesUrl
Returns the URL for fetching statuses in this repository.- Gibt zurück:
- the statuses URL
-
getFullName
Returns the full name of this repository.- Gibt zurück:
- the full name
-
getGitCommitsUrl
Returns the URL for fetching git commits in this repository.- Gibt zurück:
- the git commits URL
-
getLanguagesUrl
Returns the URL for fetching languages used in this repository.- Gibt zurück:
- the languages URL
-
getGitTagsUrl
Returns the URL for fetching git tags in this repository.- Gibt zurück:
- the git tags URL
-
getGitUrl
Returns the git URL of this repository.- Gibt zurück:
- the git URL
-
getSshUrl
Returns the SSH URL of this repository.- Gibt zurück:
- the SSH URL
-
getAssigneesUrl
Returns the URL for fetching assignees in this repository.- Gibt zurück:
- the assignees URL
-
getOpenIssues
public int getOpenIssues()Returns the number of open issues in this repository.- Gibt zurück:
- the number of open issues
-
getWatchersCount
public int getWatchersCount()Returns the number of watchers in this repository.- Gibt zurück:
- the watchers count
-
getHooksUrl
Returns the URL for fetching hooks in this repository.- Gibt zurück:
- the hooks URL
-
getIssueEventsUrl
Returns the URL for fetching issue events in this repository.- Gibt zurück:
- the issue events URL
-
getHomepage
Returns the homepage URL of this repository.- Gibt zurück:
- the homepage URL
-
getIssuesUrl
Returns the URL for fetching issues in this repository.- Gibt zurück:
- the issues URL
-
getForksCount
public int getForksCount()Returns the number of forks of this repository.- Gibt zurück:
- the forks count
-
getKeysUrl
Returns the URL for fetching keys in this repository.- Gibt zurück:
- the keys URL
-
getMergesUrl
Returns the URL for fetching merges in this repository.- Gibt zurück:
- the merges URL
-
getMilestonesUrl
Returns the URL for fetching milestones in this repository.- Gibt zurück:
- the milestones URL
-
getMirrorUrl
Returns the mirror URL of this repository.- Gibt zurück:
- the mirror URL
-
getName
Returns the name of this repository.- Gibt zurück:
- the name
-
getNotificationsUrl
Returns the URL for fetching notifications in this repository.- Gibt zurück:
- the notifications URL
-
getPullsUrl
Returns the URL for fetching pull requests in this repository.- Gibt zurück:
- the pulls URL
-
getStargazersUrl
Returns the URL for fetching stargazers of this repository.- Gibt zurück:
- the stargazers URL
-
getTagsUrl
Returns the URL for fetching tags in this repository.- Gibt zurück:
- the tags URL
-
getTeamsUrl
Returns the URL for fetching teams associated with this repository.- Gibt zurück:
- the teams URL
-
getTreesUrl
Returns the URL for fetching trees in this repository.- Gibt zurück:
- the trees URL
-
isWebCommitSignoffRequired
public boolean isWebCommitSignoffRequired()Returns whether web commit signoff is required for this repository.- Gibt zurück:
- true if web commit signoff is required, false otherwise
-
isHasDiscussions
public boolean isHasDiscussions()Returns whether this repository has discussions enabled.- Gibt zurück:
- true if discussions are enabled, false otherwise
-
isAllowForking
public boolean isAllowForking()Returns whether forking is allowed for this repository.- Gibt zurück:
- true if forking is allowed, false otherwise
-
isTemplate
public boolean isTemplate()Returns whether this repository is a template repository.- Gibt zurück:
- true if this is a template repository, false otherwise
-
isArchived
public boolean isArchived()Returns whether this repository is archived.- Gibt zurück:
- true if this repository is archived, false otherwise
-
isDisabled
public boolean isDisabled()Returns whether this repository is disabled.- Gibt zurück:
- true if this repository is disabled, false otherwise
-
isFork
public boolean isFork()Returns whether this repository is a fork.- Gibt zurück:
- true if this repository is a fork, false otherwise
-
isHasPages
public boolean isHasPages()Returns whether this repository has GitHub Pages enabled.- Gibt zurück:
- true if GitHub Pages is enabled, false otherwise
-
isHasDownloads
public boolean isHasDownloads()Returns whether this repository has downloads enabled.- Gibt zurück:
- true if downloads are enabled, false otherwise
-
isHasProjects
public boolean isHasProjects()Returns whether this repository has projects enabled.- Gibt zurück:
- true if projects are enabled, false otherwise
-
isHasWiki
public boolean isHasWiki()Returns whether this repository has a wiki enabled.- Gibt zurück:
- true if the wiki is enabled, false otherwise
-
isPrivate
public boolean isPrivate()Returns whether this repository is private.- Gibt zurück:
- true if this repository is private, false otherwise
-
isHasIssues
public boolean isHasIssues()Returns whether this repository has issues enabled.- Gibt zurück:
- true if issues are enabled, false otherwise
-
getTopics
Returns the list of topics associated with this repository.- Gibt zurück:
- the list of topics
-
getLicense
Returns the license associated with this repository.- Gibt zurück:
- the license
-
getOwner
Returns the owner of this repository.- Gibt zurück:
- the owner
-
listPullRequests
Fetches the list of pull requests in this repository.- Gibt zurück:
- a List of GHPullRequest instances representing the pull requests in this repository
-
hasPullRequestsWithState
Checks if this repository has any pull requests with the given state.- Parameter:
state- the state of the pull requests to check for- Gibt zurück:
- true if this repository has any pull requests with the given state, false otherwise
-
updateTopics
Updates the topics of this repository.- Parameter:
topics- the new topics
-
updateHomePage
public void updateHomePage()Updates the homepage of this repository. -
listEvents
Fetches the list of events in this repository.- Gibt zurück:
- a List of GHEvent instances representing the events in this repository
-
listArtifacts
Fetches the list of artifacts in this repository.- Gibt zurück:
- a List of GHArtifact instances representing the artifacts in this repository
-
getArtifact
Fetches the artifact with the given ID in this repository.- Parameter:
id- the ID of the artifact- Gibt zurück:
- a GHArtifact instance representing the artifact with the given ID
-
deleteArtifact
Deletes the artifact with the given ID in this repository.- Parameter:
id- the ID of the artifact- Gibt zurück:
- true if the artifact was successfully deleted, false otherwise
-
getCache
Fetches the cache of this repository.- Gibt zurück:
- a GHRepositoryCache instance representing the cache of this repository
-
listActionsCaches
Fetches the list of actions caches in this repository.- Gibt zurück:
- a List of GHActionsCache instances representing the actions caches in this repository
-
deleteActionsCache
Deletes the actions cache with the given key in this repository.- Parameter:
key- the key of the actions cache
-
deleteActionsCache
public boolean deleteActionsCache(int id) Deletes the actions cache with the given ID in this repository.- Parameter:
id- the ID of the actions cache- Gibt zurück:
- true if the actions cache was successfully deleted, false otherwise
-
listOrganisationSecrets
Fetches the list of organisation secrets in this repository.- Gibt zurück:
- a List of GHSecret instances representing the organisation secrets in this repository
-
listRepositorySecrets
Fetches the list of repository secrets in this repository.- Gibt zurück:
- a List of GHSecret instances representing the repository secrets in this repository
-
getPublicKey
Fetches the public key of this repository.- Gibt zurück:
- a GHPublicKey instance representing the public key of this repository
-
getSecret
Fetches the secret with the given name in this repository.- Parameter:
name- the name of the secret- Gibt zurück:
- a GHSecret instance representing the secret with the given name
-
listEnvironmentSecrets
Fetches the list of environment secrets in this repository.- Parameter:
environment- the name of the environment- Gibt zurück:
- a List of GHSecret instances representing the environment secrets in this repository
-
getEnvironmentPublicKey
Fetches the public key of the given environment in this repository.- Parameter:
environment- the name of the environment- Gibt zurück:
- a GHPublicKey instance representing the public key of the environment
-
getEnvironmentSecret
Fetches the secret with the given name in the specified environment.- Parameter:
environment- the name of the environmentname- the name of the secret- Gibt zurück:
- a GHSecret instance representing the secret with the given name
-
listOrganisationVariables
Fetches the list of organisation variables in this repository.- Gibt zurück:
- a List of GHVariable instances representing the organisation variables in this repository
-
listRepositoryVariables
Fetches the list of repository variables in this repository.- Gibt zurück:
- a List of GHVariable instances representing the repository variables in this repository
-
getVariable
Fetches the variable with the given name in this repository.- Parameter:
name- the name of the variable- Gibt zurück:
- a GHVariable instance representing the variable with the given name
-
listEnvironmentVariables
Fetches the list of environment variables in the specified environment.- Parameter:
environment- the name of the environment- Gibt zurück:
- a List of GHVariable instances representing the environment variables
-
getEnvironmentVariable
Fetches the variable with the given name in the specified environment.- Parameter:
environment- the name of the environmentname- the name of the variable- Gibt zurück:
- a GHVariable instance representing the variable with the given name
-
getJobFromWorkflowRun
Fetches the workflow job with the given ID in this repository.- Parameter:
id- the ID of the workflow job- Gibt zurück:
- a GHWorkflowJob instance representing the workflow job with the given ID
-
listJobsFromWorkflowRun
Fetches the list of jobs in the specified workflow run.- Parameter:
id- the ID of the workflow run- Gibt zurück:
- a List of GHWorkflowJob instances representing the jobs in the workflow run
-
listJobsForWorkflowAttempt
Fetches the list of jobs for the specified workflow attempt.- Parameter:
id- the ID of the workflow runattempt- the attempt number- Gibt zurück:
- a List of GHWorkflowJob instances representing the jobs for the workflow attempt
-
getWorkflowRun
Fetches the workflow run with the given ID in this repository.- Parameter:
id- the ID of the workflow run- Gibt zurück:
- a GHWorkflowRun instance representing the workflow run with the given ID
-
createProject
Creates a project in the organization. -
createProject
Creates a project in the organization.
-