Class GHOrganisation
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.bases.ClassBase
io.github.coho04.githubapi.bases.EntityBase
io.github.coho04.githubapi.entities.GHOrganisation
- All Implemented Interfaces:
- HttpRequestInterface,- JSONHelper
Represents a GitHub organization.
 This class provides methods and properties to access information about an organization on GitHub.
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelperJSONHelper.JSONToObject<T>
- 
Constructor SummaryConstructorsConstructorDescriptionGHOrganisation(Github github, org.json.JSONObject jsonObject, String name) Constructs a new GHOrganisation instance with the provided GitHub instance, JSON object, and name.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a member to the organization.Creates a hook in the organization.Creates a project in the organization.createProject(String name, String body) Creates a project in the organization.Creates a team in the organization.createTeam(String name) Creates a team in the organization.voiddeleteHook(Long id) Deletes a hook in the organization by its ID.booleandeleteRepositoryFromSecret(String secretName, String repoId) Deletes a repository from a specific secret in the organization by secret name and repository ID.booleandeleteSecret(String name) Deletes a specific secret in the organization by its name.findRepositoryByName(String name) Finds a repository by its name within the organization.findTeamByName(String name) Finds a team by its name within the organization.findTeamBySlug(String slug) Finds a team by its slug within the organization.Returns the date and time when the organization was archived.Returns the billing email of the organization.getBlog()Returns the blog URL of the organization.intReturns the total active cache usage count for the organization.intReturns the total active cache usage size in bytes for the organization.intReturns the number of collaborators in the organization.Returns the company associated with the organization.Returns the creation date and time of the organization.Returns the default repository permission for the organization.Returns the description of the organization.longReturns the disk usage of the organization.getEmail()Returns the email of the organization.intReturns the number of followers of the organization.intReturns the number of following of the organization.Returns the GitHub instance associated with this organization.Returns the given name of the organization.getHook(int id) Returns a specific hook in the organization by its ID.Returns a specific hook in the organization by its ID.getHooks()Returns a list of hooks in the organization.Returns the URL for fetching hooks of the organization.Returns the URL for fetching issues of the organization.Returns the location of the organization.Returns the allowed repository creation type for members of the organization.Returns the URL for fetching members of the organization.getName()Returns the name of the organization.static GHOrganisationgetOrganisation(Github github, String name) Fetches a GitHub organization by its name.intReturns the number of owned private repositories in the organization.getPackage(String name, GHPackageType packageType) Returns a specific package in the organization by its name and package type.getPlan()Returns the plan associated with the organization.intReturns the number of private gists in the organization.intReturns the number of public gists of the organization.Returns the public key for secrets in the organization.Returns the URL for fetching public members of the organization.intReturns the number of public repositories of the organization.Returns a list of pull requests in the organization.Returns a list of repositories within the organization.Returns a list of repositories with open pull requests in the organization.Returns a specific secret in the organization by its name.Returns the custom link for secret scanning push protection.getTeams()Returns a list of teams within the organization.intReturns the total number of private repositories in the organization.Returns the Twitter username of the organization.Returns the last updated date and time of the organization.getVariable(String name) Returns a specific variable in the organization by its name.Checks if a user is a member of the organization.hasPublicMember(GHUser user) Checks if a user is a public member of the organization.booleanReturns whether advanced security is enabled for new repositories in the organization.booleanReturns whether Dependabot alerts are enabled for new repositories in the organization.booleanReturns whether Dependabot security updates are enabled for new repositories in the organization.booleanReturns whether the dependency graph is enabled for new repositories in the organization.booleanReturns whether the organization has organization projects enabled.booleanReturns whether the organization has repository projects enabled.booleanReturns whether members can create internal repositories in the organization.booleanReturns whether members can create pages in the organization.booleanReturns whether members can create private pages in the organization.booleanReturns whether members can create private repositories in the organization.booleanReturns whether members can create public pages in the organization.booleanReturns whether members can create public repositories in the organization.booleanReturns whether members can create repositories in the organization.booleanReturns whether members can fork private repositories in the organization.booleanReturns whether secret scanning is enabled for new repositories in the organization.booleanReturns whether the custom link for secret scanning push protection is enabled.booleanReturns whether secret scanning push protection is enabled for new repositories in the organization.booleanReturns whether secret scanning validity checks are enabled.booleanReturns whether two-factor authentication is required for members of the organization.booleanReturns whether the organization is verified.booleanReturns whether web commit signoff is required for the organization.Returns a list of Docker conflict packages in the organization.Returns a list of events in the organization.Returns a list of members of the organization.Returns a list of outside collaborators of the organization.listPackages(GHPackageType packageType) Returns a list of packages in the organization filtered by package type.Returns a list of projects in the organization.Returns a list of public members of the organization.Returns a list of repository caches in the organization.Returns a list of repositories associated with a specific secret in the organization.Returns a list of secrets in the organization.Returns a list of secret scanning alerts in the organization.Returns a list of teams within the organization.Returns a list of repositories associated with a specific variable in the organization.Returns a list of variables in the organization.voidremoveMember(@NotNull GHUser user) Removes a member from the organization.org.json.JSONObjectConverts this organization instance to a JSONObject.Methods inherited from class io.github.coho04.githubapi.bases.EntityBasegetAvatarUrl, getLogin, getReposUrl, getType, getUsernameMethods inherited from class io.github.coho04.githubapi.bases.ClassBasegetEventsUrl, getHtmlUrl, getId, getNodeId, getUrlMethods inherited from class io.github.coho04.githubapi.bases.GHBasefetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrlMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.coho04.githubapi.interfaces.HttpRequestInterfaceextractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequestMethods inherited from interface io.github.coho04.githubapi.interfaces.JSONHelpergetArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
- 
Constructor Details- 
GHOrganisationConstructs a new GHOrganisation instance with the provided GitHub instance, JSON object, and name.- Parameters:
- github- the GitHub instance
- jsonObject- the JSON object containing the organization data
- name- the name of the organization
 
 
- 
- 
Method Details- 
getOrganisationFetches a GitHub organization by its name.- Parameters:
- github- the GitHub instance
- name- the name of the organization to fetch
- Returns:
- a GHOrganisation instance representing the fetched organization
 
- 
findRepositoryByNameFinds a repository by its name within the organization.- Parameters:
- name- the name of the repository to find
- Returns:
- a GHRepository instance representing the found repository
 
- 
getRepositoriesReturns a list of repositories within the organization.- Returns:
- a list of GHRepository instances
 
- 
getNameReturns the name of the organization.- Returns:
- the name of the organization
 
- 
getDescriptionReturns the description of the organization.- Returns:
- the description of the organization
 
- 
getGithubReturns the GitHub instance associated with this organization.- Returns:
- the GitHub instance
 
- 
getCompanyReturns the company associated with the organization.- Returns:
- the company associated with the organization
 
- 
getHooksUrlReturns the URL for fetching hooks of the organization.- Returns:
- the hooks URL
 
- 
getIssuesUrlReturns the URL for fetching issues of the organization.- Returns:
- the issues URL
 
- 
getMembersUrlReturns the URL for fetching members of the organization.- Returns:
- the members URL
 
- 
getPublicMembersUrlReturns the URL for fetching public members of the organization.- Returns:
- the public members URL
 
- 
getFollowerspublic int getFollowers()Returns the number of followers of the organization.- Returns:
- the number of followers
 
- 
getBlogReturns the blog URL of the organization.- Returns:
- the blog URL
 
- 
getFollowingpublic int getFollowing()Returns the number of following of the organization.- Returns:
- the number of following
 
- 
getPublicGistspublic int getPublicGists()Returns the number of public gists of the organization.- Returns:
- the number of public gists
 
- 
getPublicRepospublic int getPublicRepos()Returns the number of public repositories of the organization.- Returns:
- the number of public repositories
 
- 
getEmailReturns the email of the organization.- Returns:
- the email of the organization
 
- 
getArchivedAtReturns the date and time when the organization was archived.- Returns:
- the archived date and time
 
- 
getLocationReturns the location of the organization.- Returns:
- the location of the organization
 
- 
getCreatedAtReturns the creation date and time of the organization.- Returns:
- the creation date and time
 
- 
getTwitterUsernameReturns the Twitter username of the organization.- Returns:
- the Twitter username
 
- 
getUpdatedAtReturns the last updated date and time of the organization.- Returns:
- the last updated date and time
 
- 
isHasOrganizationProjectspublic boolean isHasOrganizationProjects()Returns whether the organization has organization projects enabled.- Returns:
- true if organization projects are enabled, false otherwise
 
- 
isHasRepositoryProjectspublic boolean isHasRepositoryProjects()Returns whether the organization has repository projects enabled.- Returns:
- true if repository projects are enabled, false otherwise
 
- 
isVerifiedpublic boolean isVerified()Returns whether the organization is verified.- Returns:
- true if the organization is verified, false otherwise
 
- 
getPlanReturns the plan associated with the organization.- Returns:
- the plan associated with the organization
 
- 
getCollaboratorspublic int getCollaborators()Returns the number of collaborators in the organization.- Returns:
- the number of collaborators
 
- 
getOwnedPrivateRepospublic int getOwnedPrivateRepos()Returns the number of owned private repositories in the organization.- Returns:
- the number of owned private repositories
 
- 
getPrivateGistspublic int getPrivateGists()Returns the number of private gists in the organization.- Returns:
- the number of private gists
 
- 
getTotalPrivateRepospublic int getTotalPrivateRepos()Returns the total number of private repositories in the organization.- Returns:
- the total number of private repositories
 
- 
getDiskUsagepublic long getDiskUsage()Returns the disk usage of the organization.- Returns:
- the disk usage
 
- 
getBillingEmailReturns the billing email of the organization.- Returns:
- the billing email
 
- 
getDefaultRepositoryPermissionReturns the default repository permission for the organization.- Returns:
- the default repository permission
 
- 
getMembersAllowedRepositoryCreationTypeReturns the allowed repository creation type for members of the organization.- Returns:
- the allowed repository creation type for members
 
- 
getSecretScanningPushProtectionCustomLinkReturns the custom link for secret scanning push protection.- Returns:
- the custom link for secret scanning push protection
 
- 
isAdvancedSecurityEnabledForNewRepositoriespublic boolean isAdvancedSecurityEnabledForNewRepositories()Returns whether advanced security is enabled for new repositories in the organization.- Returns:
- true if advanced security is enabled for new repositories, false otherwise
 
- 
isDependabotAlertsEnabledForNewRepositoriespublic boolean isDependabotAlertsEnabledForNewRepositories()Returns whether Dependabot alerts are enabled for new repositories in the organization.- Returns:
- true if Dependabot alerts are enabled for new repositories, false otherwise
 
- 
isDependabotSecurityUpdatesEnabledForNewRepositoriespublic boolean isDependabotSecurityUpdatesEnabledForNewRepositories()Returns whether Dependabot security updates are enabled for new repositories in the organization.- Returns:
- true if Dependabot security updates are enabled for new repositories, false otherwise
 
- 
isDependencyGraphEnabledForNewRepositoriespublic boolean isDependencyGraphEnabledForNewRepositories()Returns whether the dependency graph is enabled for new repositories in the organization.- Returns:
- true if the dependency graph is enabled for new repositories, false otherwise
 
- 
isMembersCanCreateInternalRepositoriespublic boolean isMembersCanCreateInternalRepositories()Returns whether members can create internal repositories in the organization.- Returns:
- true if members can create internal repositories, false otherwise
 
- 
isMembersCanCreatePagespublic boolean isMembersCanCreatePages()Returns whether members can create pages in the organization.- Returns:
- true if members can create pages, false otherwise
 
- 
isMembersCanCreatePrivatePagespublic boolean isMembersCanCreatePrivatePages()Returns whether members can create private pages in the organization.- Returns:
- true if members can create private pages, false otherwise
 
- 
isMembersCanCreatePrivateRepositoriespublic boolean isMembersCanCreatePrivateRepositories()Returns whether members can create private repositories in the organization.- Returns:
- true if members can create private repositories, false otherwise
 
- 
isMembersCanCreatePublicPagespublic boolean isMembersCanCreatePublicPages()Returns whether members can create public pages in the organization.- Returns:
- true if members can create public pages, false otherwise
 
- 
isMembersCanCreatePublicRepositoriespublic boolean isMembersCanCreatePublicRepositories()Returns whether members can create public repositories in the organization.- Returns:
- true if members can create public repositories, false otherwise
 
- 
isMembersCanCreateRepositoriespublic boolean isMembersCanCreateRepositories()Returns whether members can create repositories in the organization.- Returns:
- true if members can create repositories, false otherwise
 
- 
isMembersCanForkPrivateRepositoriespublic boolean isMembersCanForkPrivateRepositories()Returns whether members can fork private repositories in the organization.- Returns:
- true if members can fork private repositories, false otherwise
 
- 
isSecretScanningEnabledForNewRepositoriespublic boolean isSecretScanningEnabledForNewRepositories()Returns whether secret scanning is enabled for new repositories in the organization.- Returns:
- true if secret scanning is enabled for new repositories, false otherwise
 
- 
isSecretScanningPushProtectionCustomLinkEnabledpublic boolean isSecretScanningPushProtectionCustomLinkEnabled()Returns whether the custom link for secret scanning push protection is enabled.- Returns:
- true if the custom link for secret scanning push protection is enabled, false otherwise
 
- 
isSecretScanningPushProtectionEnabledForNewRepositoriespublic boolean isSecretScanningPushProtectionEnabledForNewRepositories()Returns whether secret scanning push protection is enabled for new repositories in the organization.- Returns:
- true if secret scanning push protection is enabled for new repositories, false otherwise
 
- 
isSecretScanningValidityChecksEnabledpublic boolean isSecretScanningValidityChecksEnabled()Returns whether secret scanning validity checks are enabled.- Returns:
- true if secret scanning validity checks are enabled, false otherwise
 
- 
isTwoFactorRequirementEnabledpublic boolean isTwoFactorRequirementEnabled()Returns whether two-factor authentication is required for members of the organization.- Returns:
- true if two-factor authentication is required, false otherwise
 
- 
isWebCommitSignoffRequiredpublic boolean isWebCommitSignoffRequired()Returns whether web commit signoff is required for the organization.- Returns:
- true if web commit signoff is required, false otherwise
 
- 
getGivenNameReturns the given name of the organization.- Returns:
- the given name of the organization
 
- 
toJSONObjectpublic org.json.JSONObject toJSONObject()Converts this organization instance to a JSONObject.- Overrides:
- toJSONObjectin class- EntityBase
- Returns:
- a JSONObject representation of this organization
 
- 
getTeamsReturns a list of teams within the organization.- Returns:
- a list of GHTeam instances
 
- 
listTeamsReturns a list of teams within the organization.- Returns:
- a list of GHTeam instances
 
- 
findTeamByNameFinds a team by its name within the organization.- Parameters:
- name- the name of the team to find
- Returns:
- a GHTeam instance representing the found team
 
- 
findTeamBySlugFinds a team by its slug within the organization.- Parameters:
- slug- the slug of the team to find
- Returns:
- a GHTeam instance representing the found team
 
- 
hasMemberChecks if a user is a member of the organization.- Parameters:
- user- the user to check
- Returns:
- true if the user is a member, false otherwise
 
- 
addMemberAdds a member to the organization. This method sends a POST request to the GitHub API to add a member to the organization. The member is identified by their email, and the role they should have in the organization is specified. The member is also added to specific teams within the organization, identified by their IDs.- Parameters:
- email- the email of the member to add
- role- the role the member should have in the organization
- teamIds- the IDs of the teams the member should be added to
 
- 
removeMemberRemoves a member from the organization.- Parameters:
- user- the user to remove
 
- 
hasPublicMemberChecks if a user is a public member of the organization.- Parameters:
- user- the user to check
- Returns:
- true if the user is a public member, false otherwise
 
- 
listMembersReturns a list of members of the organization.- Returns:
- a list of GHUser instances
 
- 
listPublicMembersReturns a list of public members of the organization.- Returns:
- a list of GHUser instances
 
- 
listOutsideCollaboratorsReturns a list of outside collaborators of the organization.- Returns:
- a list of GHUser instances
 
- 
listProjectsReturns a list of projects in the organization.- Returns:
- a list of GHProject instances
 
- 
createProjectCreates a project in the organization.
- 
createProjectCreates a project in the organization.- Returns:
- GHProject
 
- 
createTeamCreates a team in the organization.- Parameters:
- name- the name of the team to create
 
- 
createTeamCreates a team in the organization.- Returns:
- a TeamBuilder instance to build the team
 
- 
getRepositorysWithOpenPullRequestsReturns a list of repositories with open pull requests in the organization.- Returns:
- a list of GHRepository instances
 
- 
getPullRequestsReturns a list of pull requests in the organization.- Returns:
- a list of GHRepository instances
 
- 
listEventsReturns a list of events in the organization.- Returns:
- a list of GHEvent instances
 
- 
getHooksReturns a list of hooks in the organization.- Returns:
- a list of GHHook instances
 
- 
getHookReturns a specific hook in the organization by its ID.- Parameters:
- id- the ID of the hook to fetch
- Returns:
- a GHHook instance representing the fetched hook
 
- 
getHookReturns a specific hook in the organization by its ID.- Parameters:
- id- the ID of the hook to fetch
- Returns:
- a GHHook instance representing the fetched hook
 
- 
createHookCreates a hook in the organization.- Returns:
- GHHookBuilder
 
- 
deleteHookDeletes a hook in the organization by its ID.- Parameters:
- id- the ID of the hook to delete
 
- 
listDockerConflictsPackagesReturns a list of Docker conflict packages in the organization.- Returns:
- a list of GHPackage instances
 
- 
listPackagesReturns a list of packages in the organization filtered by package type.- Parameters:
- packageType- the type of packages to list
- Returns:
- a list of GHPackage instances
 
- 
getPackageReturns a specific package in the organization by its name and package type.- Parameters:
- name- the name of the package
- packageType- the type of the package
- Returns:
- a GHPackage instance representing the fetched package
 
- 
listSecretScanningAlertsReturns a list of secret scanning alerts in the organization.- Returns:
- a list of GHAlert instances
 
- 
getCacheUsageActiveCountpublic int getCacheUsageActiveCount()Returns the total active cache usage count for the organization.- Returns:
- the total active cache usage count
 
- 
getCacheUsageSizeInBytespublic int getCacheUsageSizeInBytes()Returns the total active cache usage size in bytes for the organization.- Returns:
- the total active cache usage size in bytes
 
- 
listRepositoryCachesReturns a list of repository caches in the organization.- Returns:
- a list of GHRepositoryCache instances
 
- 
listSecretsReturns a list of secrets in the organization.- Returns:
- a list of GHSecret instances
 
- 
getPublicKeyReturns the public key for secrets in the organization.- Returns:
- a GHPublicKey instance representing the public key
 
- 
getSecretReturns a specific secret in the organization by its name.- Parameters:
- name- the name of the secret to fetch
- Returns:
- a GHSecret instance representing the fetched secret
 
- 
deleteSecretDeletes a specific secret in the organization by its name.- Parameters:
- name- the name of the secret to delete
- Returns:
- true if the secret was deleted successfully, false otherwise
 
- 
listSecretRepositorysReturns a list of repositories associated with a specific secret in the organization.- Returns:
- a list of GHRepository instances
 
- 
deleteRepositoryFromSecretDeletes a repository from a specific secret in the organization by secret name and repository ID.- Parameters:
- secretName- the name of the secret
- repoId- the ID of the repository
- Returns:
- true if the repository was deleted successfully, false otherwise
 
- 
listVariablesReturns a list of variables in the organization.- Returns:
- a list of GHVariable instances
 
- 
getVariableReturns a specific variable in the organization by its name.- Parameters:
- name- the name of the variable to fetch
- Returns:
- a GHVariable instance representing the fetched variable
 
- 
listVariableRepositorysReturns a list of repositories associated with a specific variable in the organization.- Parameters:
- name- the name of the variable
- Returns:
- a list of GHRepository instances
 
 
-