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()
      Create default GHUser instance
  • 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

      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

      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

      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

      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:
    • getSuspendedAt

      public Date getSuspendedAt() throws IOException
      When was this user suspended?.
      Returns:
      updated date
      Throws:
      IOException - on error
    • 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