Klasse GHOrganisation

Alle implementierten Schnittstellen:
HttpRequestInterface, JSONHelper

public class GHOrganisation extends EntityBase
Represents a GitHub organization. This class provides methods and properties to access information about an organization on GitHub.
  • Konstruktordetails

    • GHOrganisation

      public GHOrganisation(Github github, org.json.JSONObject jsonObject, String name)
      Constructs a new GHOrganisation instance with the provided GitHub instance, JSON object, and name.
      Parameter:
      github - the GitHub instance
      jsonObject - the JSON object containing the organization data
      name - the name of the organization
  • Methodendetails

    • getOrganisation

      public static GHOrganisation getOrganisation(Github github, String name)
      Fetches a GitHub organization by its name.
      Parameter:
      github - the GitHub instance
      name - the name of the organization to fetch
      Gibt zurück:
      a GHOrganisation instance representing the fetched organization
    • findRepositoryByName

      public GHRepository findRepositoryByName(String name)
      Finds a repository by its name within the organization.
      Parameter:
      name - the name of the repository to find
      Gibt zurück:
      a GHRepository instance representing the found repository
    • getRepositories

      public List<GHRepository> getRepositories()
      Returns a list of repositories within the organization.
      Gibt zurück:
      a list of GHRepository instances
    • getName

      public String getName()
      Returns the name of the organization.
      Gibt zurück:
      the name of the organization
    • getDescription

      public String getDescription()
      Returns the description of the organization.
      Gibt zurück:
      the description of the organization
    • getGithub

      public Github getGithub()
      Returns the GitHub instance associated with this organization.
      Gibt zurück:
      the GitHub instance
    • getCompany

      public String getCompany()
      Returns the company associated with the organization.
      Gibt zurück:
      the company associated with the organization
    • getHooksUrl

      public String getHooksUrl()
      Returns the URL for fetching hooks of the organization.
      Gibt zurück:
      the hooks URL
    • getIssuesUrl

      public String getIssuesUrl()
      Returns the URL for fetching issues of the organization.
      Gibt zurück:
      the issues URL
    • getMembersUrl

      public String getMembersUrl()
      Returns the URL for fetching members of the organization.
      Gibt zurück:
      the members URL
    • getPublicMembersUrl

      public String getPublicMembersUrl()
      Returns the URL for fetching public members of the organization.
      Gibt zurück:
      the public members URL
    • getFollowers

      public int getFollowers()
      Returns the number of followers of the organization.
      Gibt zurück:
      the number of followers
    • getBlog

      public String getBlog()
      Returns the blog URL of the organization.
      Gibt zurück:
      the blog URL
    • getFollowing

      public int getFollowing()
      Returns the number of following of the organization.
      Gibt zurück:
      the number of following
    • getPublicGists

      public int getPublicGists()
      Returns the number of public gists of the organization.
      Gibt zurück:
      the number of public gists
    • getPublicRepos

      public int getPublicRepos()
      Returns the number of public repositories of the organization.
      Gibt zurück:
      the number of public repositories
    • getEmail

      public String getEmail()
      Returns the email of the organization.
      Gibt zurück:
      the email of the organization
    • getArchivedAt

      public OffsetDateTime getArchivedAt()
      Returns the date and time when the organization was archived.
      Gibt zurück:
      the archived date and time
    • getLocation

      public String getLocation()
      Returns the location of the organization.
      Gibt zurück:
      the location of the organization
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Returns the creation date and time of the organization.
      Gibt zurück:
      the creation date and time
    • getTwitterUsername

      public String getTwitterUsername()
      Returns the Twitter username of the organization.
      Gibt zurück:
      the Twitter username
    • getUpdatedAt

      public OffsetDateTime getUpdatedAt()
      Returns the last updated date and time of the organization.
      Gibt zurück:
      the last updated date and time
    • isHasOrganizationProjects

      public boolean isHasOrganizationProjects()
      Returns whether the organization has organization projects enabled.
      Gibt zurück:
      true if organization projects are enabled, false otherwise
    • isHasRepositoryProjects

      public boolean isHasRepositoryProjects()
      Returns whether the organization has repository projects enabled.
      Gibt zurück:
      true if repository projects are enabled, false otherwise
    • isVerified

      public boolean isVerified()
      Returns whether the organization is verified.
      Gibt zurück:
      true if the organization is verified, false otherwise
    • getPlan

      public GHPlan getPlan()
      Returns the plan associated with the organization.
      Gibt zurück:
      the plan associated with the organization
    • getCollaborators

      public int getCollaborators()
      Returns the number of collaborators in the organization.
      Gibt zurück:
      the number of collaborators
    • getOwnedPrivateRepos

      public int getOwnedPrivateRepos()
      Returns the number of owned private repositories in the organization.
      Gibt zurück:
      the number of owned private repositories
    • getPrivateGists

      public int getPrivateGists()
      Returns the number of private gists in the organization.
      Gibt zurück:
      the number of private gists
    • getTotalPrivateRepos

      public int getTotalPrivateRepos()
      Returns the total number of private repositories in the organization.
      Gibt zurück:
      the total number of private repositories
    • getDiskUsage

      public long getDiskUsage()
      Returns the disk usage of the organization.
      Gibt zurück:
      the disk usage
    • getBillingEmail

      public String getBillingEmail()
      Returns the billing email of the organization.
      Gibt zurück:
      the billing email
    • getDefaultRepositoryPermission

      public String getDefaultRepositoryPermission()
      Returns the default repository permission for the organization.
      Gibt zurück:
      the default repository permission
    • getMembersAllowedRepositoryCreationType

      public String getMembersAllowedRepositoryCreationType()
      Returns the allowed repository creation type for members of the organization.
      Gibt zurück:
      the allowed repository creation type for members
    • getSecretScanningPushProtectionCustomLink

      public String getSecretScanningPushProtectionCustomLink()
      Returns the custom link for secret scanning push protection.
      Gibt zurück:
      the custom link for secret scanning push protection
    • isAdvancedSecurityEnabledForNewRepositories

      public boolean isAdvancedSecurityEnabledForNewRepositories()
      Returns whether advanced security is enabled for new repositories in the organization.
      Gibt zurück:
      true if advanced security is enabled for new repositories, false otherwise
    • isDependabotAlertsEnabledForNewRepositories

      public boolean isDependabotAlertsEnabledForNewRepositories()
      Returns whether Dependabot alerts are enabled for new repositories in the organization.
      Gibt zurück:
      true if Dependabot alerts are enabled for new repositories, false otherwise
    • isDependabotSecurityUpdatesEnabledForNewRepositories

      public boolean isDependabotSecurityUpdatesEnabledForNewRepositories()
      Returns whether Dependabot security updates are enabled for new repositories in the organization.
      Gibt zurück:
      true if Dependabot security updates are enabled for new repositories, false otherwise
    • isDependencyGraphEnabledForNewRepositories

      public boolean isDependencyGraphEnabledForNewRepositories()
      Returns whether the dependency graph is enabled for new repositories in the organization.
      Gibt zurück:
      true if the dependency graph is enabled for new repositories, false otherwise
    • isMembersCanCreateInternalRepositories

      public boolean isMembersCanCreateInternalRepositories()
      Returns whether members can create internal repositories in the organization.
      Gibt zurück:
      true if members can create internal repositories, false otherwise
    • isMembersCanCreatePages

      public boolean isMembersCanCreatePages()
      Returns whether members can create pages in the organization.
      Gibt zurück:
      true if members can create pages, false otherwise
    • isMembersCanCreatePrivatePages

      public boolean isMembersCanCreatePrivatePages()
      Returns whether members can create private pages in the organization.
      Gibt zurück:
      true if members can create private pages, false otherwise
    • isMembersCanCreatePrivateRepositories

      public boolean isMembersCanCreatePrivateRepositories()
      Returns whether members can create private repositories in the organization.
      Gibt zurück:
      true if members can create private repositories, false otherwise
    • isMembersCanCreatePublicPages

      public boolean isMembersCanCreatePublicPages()
      Returns whether members can create public pages in the organization.
      Gibt zurück:
      true if members can create public pages, false otherwise
    • isMembersCanCreatePublicRepositories

      public boolean isMembersCanCreatePublicRepositories()
      Returns whether members can create public repositories in the organization.
      Gibt zurück:
      true if members can create public repositories, false otherwise
    • isMembersCanCreateRepositories

      public boolean isMembersCanCreateRepositories()
      Returns whether members can create repositories in the organization.
      Gibt zurück:
      true if members can create repositories, false otherwise
    • isMembersCanForkPrivateRepositories

      public boolean isMembersCanForkPrivateRepositories()
      Returns whether members can fork private repositories in the organization.
      Gibt zurück:
      true if members can fork private repositories, false otherwise
    • isSecretScanningEnabledForNewRepositories

      public boolean isSecretScanningEnabledForNewRepositories()
      Returns whether secret scanning is enabled for new repositories in the organization.
      Gibt zurück:
      true if secret scanning is enabled for new repositories, false otherwise
    • isSecretScanningPushProtectionCustomLinkEnabled

      public boolean isSecretScanningPushProtectionCustomLinkEnabled()
      Returns whether the custom link for secret scanning push protection is enabled.
      Gibt zurück:
      true if the custom link for secret scanning push protection is enabled, false otherwise
    • isSecretScanningPushProtectionEnabledForNewRepositories

      public boolean isSecretScanningPushProtectionEnabledForNewRepositories()
      Returns whether secret scanning push protection is enabled for new repositories in the organization.
      Gibt zurück:
      true if secret scanning push protection is enabled for new repositories, false otherwise
    • isSecretScanningValidityChecksEnabled

      public boolean isSecretScanningValidityChecksEnabled()
      Returns whether secret scanning validity checks are enabled.
      Gibt zurück:
      true if secret scanning validity checks are enabled, false otherwise
    • isTwoFactorRequirementEnabled

      public boolean isTwoFactorRequirementEnabled()
      Returns whether two-factor authentication is required for members of the organization.
      Gibt zurück:
      true if two-factor authentication is required, false otherwise
    • isWebCommitSignoffRequired

      public boolean isWebCommitSignoffRequired()
      Returns whether web commit signoff is required for the organization.
      Gibt zurück:
      true if web commit signoff is required, false otherwise
    • getGivenName

      public String getGivenName()
      Returns the given name of the organization.
      Gibt zurück:
      the given name of the organization
    • toJSONObject

      public org.json.JSONObject toJSONObject()
      Converts this organization instance to a JSONObject.
      Setzt außer Kraft:
      toJSONObject in Klasse EntityBase
      Gibt zurück:
      a JSONObject representation of this organization
    • getTeams

      public List<GHTeam> getTeams()
      Returns a list of teams within the organization.
      Gibt zurück:
      a list of GHTeam instances
    • listTeams

      public List<GHTeam> listTeams()
      Returns a list of teams within the organization.
      Gibt zurück:
      a list of GHTeam instances
    • findTeamByName

      public GHTeam findTeamByName(String name)
      Finds a team by its name within the organization.
      Parameter:
      name - the name of the team to find
      Gibt zurück:
      a GHTeam instance representing the found team
    • findTeamBySlug

      public GHTeam findTeamBySlug(String slug)
      Finds a team by its slug within the organization.
      Parameter:
      slug - the slug of the team to find
      Gibt zurück:
      a GHTeam instance representing the found team
    • hasMember

      public Boolean hasMember(GHUser user)
      Checks if a user is a member of the organization.
      Parameter:
      user - the user to check
      Gibt zurück:
      true if the user is a member, false otherwise
    • addMember

      public void addMember(String email, GHRole role, List<Integer> teamIds)
    • removeMember

      public void removeMember(GHUser user)
      Removes a member from the organization.
      Parameter:
      user - the user to remove
    • hasPublicMember

      public Boolean hasPublicMember(GHUser user)
      Checks if a user is a public member of the organization.
      Parameter:
      user - the user to check
      Gibt zurück:
      true if the user is a public member, false otherwise
    • publicize

      public void publicize(GHUser user)
      Publicizes a user's membership in the organization.
      Parameter:
      user - the user to publicize
    • listMembers

      public List<GHUser> listMembers()
      Returns a list of members of the organization.
      Gibt zurück:
      a list of GHUser instances
    • listPublicMembers

      public List<GHUser> listPublicMembers()
      Returns a list of public members of the organization.
      Gibt zurück:
      a list of GHUser instances
    • listOutsideCollaborators

      public List<GHUser> listOutsideCollaborators()
      Returns a list of outside collaborators of the organization.
      Gibt zurück:
      a list of GHUser instances
    • listMembersWithRole

      public void listMembersWithRole(String role)
      Lists members of the organization with a specific role.
      Parameter:
      role - the role to filter members by
    • isOrganisationProjectsEnabled

      public void isOrganisationProjectsEnabled()
      Checks if organization projects are enabled.
    • enableOrganisationProjects

      public void enableOrganisationProjects()
      Enables organization projects.
    • listProjects

      public List<GHProject> listProjects()
      Returns a list of projects in the organization.
      Gibt zurück:
      a list of GHProject instances
    • createProject

      public GHProjectBuilder createProject()
      Creates a project in the organization.
    • createProject

      public GHProject createProject(String name, String body)
      Creates a project in the organization.
    • createTeam

      public GHTeam createTeam(String name)
      Creates a team in the organization.
      Parameter:
      name - the name of the team to create
    • createTeam

      public GHTeamBuilder createTeam()
      Creates a team in the organization.
      Gibt zurück:
      a TeamBuilder instance to build the team
    • getRepositorysWithOpenPullRequests

      public List<GHRepository> getRepositorysWithOpenPullRequests()
      Returns a list of repositories with open pull requests in the organization.
      Gibt zurück:
      a list of GHRepository instances
    • getPullRequests

      public List<GHRepository> getPullRequests()
      Returns a list of pull requests in the organization.
      Gibt zurück:
      a list of GHRepository instances
    • listEvents

      public List<GHEvent> listEvents()
      Returns a list of events in the organization.
      Gibt zurück:
      a list of GHEvent instances
    • getHooks

      public List<GHHook> getHooks()
      Returns a list of hooks in the organization.
      Gibt zurück:
      a list of GHHook instances
    • getHook

      public GHHook getHook(Long id)
      Returns a specific hook in the organization by its ID.
      Parameter:
      id - the ID of the hook to fetch
      Gibt zurück:
      a GHHook instance representing the fetched hook
    • getHook

      public GHHook getHook(int id)
      Returns a specific hook in the organization by its ID.
      Parameter:
      id - the ID of the hook to fetch
      Gibt zurück:
      a GHHook instance representing the fetched hook
    • createHook

      public void createHook()
      Creates a hook in the organization.
    • deleteHook

      public void deleteHook(Long id)
      Deletes a hook in the organization by its ID.
      Parameter:
      id - the ID of the hook to delete
    • listDockerConflictsPackages

      public List<GHPackage> listDockerConflictsPackages()
      Returns a list of Docker conflict packages in the organization.
      Gibt zurück:
      a list of GHPackage instances
    • listPackages

      public List<GHPackage> listPackages(GHPackageType packageType)
      Returns a list of packages in the organization filtered by package type.
      Parameter:
      packageType - the type of packages to list
      Gibt zurück:
      a list of GHPackage instances
    • getPackage

      public GHPackage getPackage(String name, GHPackageType packageType)
      Returns a specific package in the organization by its name and package type.
      Parameter:
      name - the name of the package
      packageType - the type of the package
      Gibt zurück:
      a GHPackage instance representing the fetched package
    • listSecretScanningAlerts

      public List<GHAlert> listSecretScanningAlerts()
      Returns a list of secret scanning alerts in the organization.
      Gibt zurück:
      a list of GHAlert instances
    • getCacheUsageActiveCount

      public int getCacheUsageActiveCount()
      Returns the total active cache usage count for the organization.
      Gibt zurück:
      the total active cache usage count
    • getCacheUsageSizeInBytes

      public int getCacheUsageSizeInBytes()
      Returns the total active cache usage size in bytes for the organization.
      Gibt zurück:
      the total active cache usage size in bytes
    • listRepositoryCaches

      public List<GHRepositoryCache> listRepositoryCaches()
      Returns a list of repository caches in the organization.
      Gibt zurück:
      a list of GHRepositoryCache instances
    • listSecrets

      public List<GHSecret> listSecrets()
      Returns a list of secrets in the organization.
      Gibt zurück:
      a list of GHSecret instances
    • getPublicKey

      public GHPublicKey getPublicKey()
      Returns the public key for secrets in the organization.
      Gibt zurück:
      a GHPublicKey instance representing the public key
    • getSecret

      public GHSecret getSecret(String name)
      Returns a specific secret in the organization by its name.
      Parameter:
      name - the name of the secret to fetch
      Gibt zurück:
      a GHSecret instance representing the fetched secret
    • deleteSecret

      public boolean deleteSecret(String name)
      Deletes a specific secret in the organization by its name.
      Parameter:
      name - the name of the secret to delete
      Gibt zurück:
      true if the secret was deleted successfully, false otherwise
    • listSecretRepositorys

      public List<GHRepository> listSecretRepositorys()
      Returns a list of repositories associated with a specific secret in the organization.
      Gibt zurück:
      a list of GHRepository instances
    • deleteRepositoryFromSecret

      public boolean deleteRepositoryFromSecret(String secretName, String repoId)
      Deletes a repository from a specific secret in the organization by secret name and repository ID.
      Parameter:
      secretName - the name of the secret
      repoId - the ID of the repository
      Gibt zurück:
      true if the repository was deleted successfully, false otherwise
    • listVariables

      public List<GHVariable> listVariables()
      Returns a list of variables in the organization.
      Gibt zurück:
      a list of GHVariable instances
    • getVariable

      public GHVariable getVariable(String name)
      Returns a specific variable in the organization by its name.
      Parameter:
      name - the name of the variable to fetch
      Gibt zurück:
      a GHVariable instance representing the fetched variable
    • listVariableRepositorys

      public List<GHRepository> listVariableRepositorys(String name)
      Returns a list of repositories associated with a specific variable in the organization.
      Parameter:
      name - the name of the variable
      Gibt zurück:
      a list of GHRepository instances