Interface Repos


@Immutable public interface Repos
GitHub Repo API.
Since:
0.5
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Settings to use when creating a new GitHub repository.
  • Method Summary

    Modifier and Type
    Method
    Description
    Create repository.
    boolean
    Check if a repository exists on GitHub.
    get(Coordinates coords)
    Get repository by name.
    Get its owner.
    iterate(String identifier)
    Iterate all public repos, starting with the one you've seen already.
    void
    Remove repository by name.
  • Method Details

    • github

      GitHub github()
      Get its owner.
      Returns:
      GitHub
    • create

      Repo create(Repos.RepoCreate settings) throws IOException
      Create repository.
      Parameters:
      settings - Settings to use for creating the new repository
      Returns:
      Repository
      Throws:
      IOException - If there is any I/O problem
      Since:
      0.5
      See Also:
    • get

      Repo get(Coordinates coords)
      Get repository by name.
      Parameters:
      coords - Repository name in "user/repo" format
      Returns:
      Repository
      See Also:
    • remove

      void remove(Coordinates coords) throws IOException
      Remove repository by name.

      Note: Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required.

      Parameters:
      coords - Repository name in "user/repo" format
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • iterate

      Iterable<Repo> iterate(String identifier)
      Iterate all public repos, starting with the one you've seen already.
      Parameters:
      identifier - The integer ID of the last Repo that you’ve seen.
      Returns:
      Iterator of repo
      See Also:
    • exists

      boolean exists(Coordinates coords) throws IOException
      Check if a repository exists on GitHub.
      Parameters:
      coords - Coordinates of the repo.
      Returns:
      True if it exists, false otherwise.
      Throws:
      IOException - If something goes wrong.