Class Github

All Implemented Interfaces:
HttpRequestInterface, JSONHelper

public class Github extends GHBase
This class represents the main entry point for interacting with the GitHub API. It provides methods for fetching data about users, organizations, advisories, and gitignore templates.
  • Constructor Details

    • Github

      public Github(String token)
      Constructs a new GitHub instance with the provided username and token.
      Parameters:
      token - the GitHub token
  • Method Details

    • findOrganisationByName

      public GHOrganisation findOrganisationByName(String name)
      Finds an organization by its name.
      Parameters:
      name - the name of the organization
      Returns:
      the organization
    • findUserByName

      public GHUser findUserByName(String name)
      Finds a user by their username.
      Parameters:
      name - the username of the user
      Returns:
      the user
    • getToken

      public String getToken()
      Returns the GitHub token.
      Returns:
      the GitHub token
    • listGlobalAdvisories

      public List<GHAdvisory> listGlobalAdvisories()
      Lists all global advisories.
      Returns:
      a list of all global advisories
    • getGlobalAdvisories

      public GHAdvisory getGlobalAdvisories(String id)
      Gets a global advisory by its ID.
      Parameters:
      id - the ID of the advisory
      Returns:
      the advisory
    • listGitignoreTemplates

      public List<GHGitignoreTemplate> listGitignoreTemplates()
      Lists all gitignore templates.
      Returns:
      a list of all gitignore templates
    • getGitignoreTemplate

      public GHGitignoreTemplate getGitignoreTemplate(String name)
      Gets a gitignore template by its name.
      Parameters:
      name - the name of the template
      Returns:
      the gitignore template
    • getSelfUser

      public SelfUser getSelfUser()
      Lists all user advisories.
      Returns:
      a list of all user advisories
    • getLogger

      public static Logger getLogger()