Class GHUser

Direct Known Subclasses:
GHMyself, GHRepository.Contributor

public class GHUser extends GHPerson
Represents an user of GitHub.
Author:
Kohsuke Kawaguchi
  • Field Details

    • ldap_dn

      protected String ldap_dn
      The ldap dn.
  • Constructor Details

    • GHUser

      public GHUser()
  • Method Details

    • getKeys

      public List<GHKey> getKeys() throws IOException
      Gets keys.
      Returns:
      the keys
      Throws:
      IOException - the io exception
    • follow

      public void follow() throws IOException
      Follow this user.
      Throws:
      IOException - the io exception
    • unfollow

      public void unfollow() throws IOException
      Unfollow this user.
      Throws:
      IOException - the io exception
    • getFollows

      @WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHUser> getFollows() throws IOException
      Lists the users that this user is following.
      Returns:
      the follows
      Throws:
      IOException - the io exception
    • listFollows

      public PagedIterable<GHUser> listFollows()
      Lists the users that this user is following.
      Returns:
      the paged iterable
    • getFollowers

      @WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHUser> getFollowers() throws IOException
      Lists the users who are following this user.
      Returns:
      the followers
      Throws:
      IOException - the io exception
    • listFollowers

      public PagedIterable<GHUser> listFollowers()
      Lists the users who are following this user.
      Returns:
      the paged iterable
    • listSubscriptions

      public PagedIterable<GHRepository> listSubscriptions()
      Lists all the subscribed (aka watched) repositories.

      https://developer.github.com/v3/activity/watching/

      Returns:
      the paged iterable
    • listStarredRepositories

      public PagedIterable<GHRepository> listStarredRepositories()
      Lists all the repositories that this user has starred.
      Returns:
      the paged iterable
    • listProjects

      @Preview(INERTIA) public PagedIterable<GHProject> listProjects()
      Lists all the projects.

      https://docs.github.com/en/rest/reference/projects#list-user-projects

      Returns:
      the paged iterable
    • isMemberOf

      public boolean isMemberOf(GHOrganization org)
      Returns true if this user belongs to the specified organization.
      Parameters:
      org - the org
      Returns:
      the boolean
    • isMemberOf

      public boolean isMemberOf(GHTeam team)
      Returns true if this user belongs to the specified team.
      Parameters:
      team - the team
      Returns:
      the boolean
    • isPublicMemberOf

      public boolean isPublicMemberOf(GHOrganization org)
      Returns true if this user belongs to the specified organization as a public member.
      Parameters:
      org - the org
      Returns:
      the boolean
    • isHireable

      public boolean isHireable()
      Returns true if this user is marked as hireable, false otherwise.
      Returns:
      if the user is marked as hireable
    • getBio

      public String getBio()
      Gets the bio.
      Returns:
      the bio
    • getOrganizations

      @WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHOrganization> getOrganizations() throws IOException
      Gets the organization that this user belongs to publicly.
      Returns:
      the organizations
      Throws:
      IOException - the io exception
    • listEvents

      public PagedIterable<GHEventInfo> listEvents() throws IOException
      Lists events performed by a user (this includes private events if the caller is authenticated.
      Specified by:
      listEvents in class GHPerson
      Returns:
      the paged iterable
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • listGists

      public PagedIterable<GHGist> listGists() throws IOException
      Lists Gists created by this user.
      Returns:
      the paged iterable
      Throws:
      IOException - the io exception
    • getLdapDn

      public Optional<String> getLdapDn() throws IOException
      Gets LDAP information for user.
      Returns:
      The LDAP information
      Throws:
      IOException - the io exception
      See Also:
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int
    • equals

      public boolean equals(Object obj)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      obj - the obj
      Returns:
      true, if successful
    • getRoot

      @Deprecated public GitHub getRoot()
      Deprecated.
      For access to the GitHub instance, use a local copy instead of pulling it out of objects.
      Get the root GitHub instance for this object.
      Returns:
      the root GitHub instance