Interface Collaborators


@Immutable public interface Collaborators
GitHub repository collaborators.
Since:
0.8
  • Method Details

    • repo

      Repo repo()
      Owner of them.
      Returns:
      Repo
    • isCollaborator

      boolean isCollaborator(String user) throws IOException
      Check if a user is collaborator.
      Parameters:
      user - User
      Returns:
      True is a user is a collaborator, otherwise returns false
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • add

      void add(String user) throws IOException
      Add user as a collaborator.
      Parameters:
      user - User
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • addWithPermission

      void addWithPermission(String user, Collaborators.Permission permission) throws IOException
      Add user with permissions. Only works on an organization repository
      Parameters:
      user - User to add
      permission - Permission level to grant
      Throws:
      IOException - if there is an I/O problem
      See Also:
      • invalid input: '<a href=https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator">Add user as a collaborator</a>'
    • permission

      String permission(String user) throws IOException
      Get user permission in this repo.
      Parameters:
      user - User to check
      Returns:
      Permission level granted, incl. "admin", "write", "read", or "none"
      Throws:
      IOException - if there is an I/O problem
      See Also:
      • invalid input: '<a href=https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user">Get repository permissions for a user</a>'
    • remove

      void remove(String user) throws IOException
      Remove user as a collaborator.
      Parameters:
      user - User
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • iterate

      Iterable<User> iterate()
      Iterates over repo collaborators.
      Returns:
      Iterator on repo collaborators.