Package org.kohsuke.github
Class GHUser
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHPerson
-
- org.kohsuke.github.GHUser
-
- Direct Known Subclasses:
GHMyself,GHRepository.Contributor
public class GHUser extends GHPerson
Represents an user of GitHub.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringldap_dnThe ldap dn.-
Fields inherited from class org.kohsuke.github.GHPerson
avatar_url, bio, blog, company, email, followers, following, hireable, html_url, location, login, name, public_gists, public_repos, site_admin, total_private_repos, twitter_username, type
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Equals.voidfollow()Follow this user.StringgetBio()Gets the bio.GHPersonSet<GHUser>getFollowers()Lists the users who are following this user.GHPersonSet<GHUser>getFollows()Lists the users that this user is following.List<GHKey>getKeys()Gets keys.Optional<String>getLdapDn()Gets LDAP information for user.GHPersonSet<GHOrganization>getOrganizations()Gets the organization that this user belongs to publicly.GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.inthashCode()Hash code.booleanisHireable()Returns true if this user is marked as hireable, false otherwise.booleanisMemberOf(GHOrganization org)Returns true if this user belongs to the specified organization.booleanisMemberOf(GHTeam team)Returns true if this user belongs to the specified team.booleanisPublicMemberOf(GHOrganization org)Returns true if this user belongs to the specified organization as a public member.PagedIterable<GHEventInfo>listEvents()Lists events performed by a user (this includes private events if the caller is authenticated.PagedIterable<GHUser>listFollowers()Lists the users who are following this user.PagedIterable<GHUser>listFollows()Lists the users that this user is following.PagedIterable<GHGist>listGists()Lists Gists created by this user.PagedIterable<GHProject>listProjects()Lists all the projects.PagedIterable<GHRepository>listStarredRepositories()Lists all the repositories that this user has starred.PagedIterable<GHRepository>listSubscriptions()Lists all the subscribed (aka watched) repositories.voidunfollow()Unfollow this user.-
Methods inherited from class org.kohsuke.github.GHPerson
getAvatarUrl, getBlog, getCompany, getCreatedAt, getEmail, getFollowersCount, getFollowingCount, getGravatarId, getHtmlUrl, getLocation, getLogin, getName, getPublicGistCount, getPublicRepoCount, getRepositories, getRepository, getTotalPrivateRepoCount, getTwitterUsername, getType, getUpdatedAt, isSiteAdmin, iterateRepositories, listRepositories, listRepositories, populate
-
Methods inherited from class org.kohsuke.github.GHObject
getId, getNodeId, getResponseHeaderFields, getUrl, setResponseHeaderFields, toString
-
-
-
-
Field Detail
-
ldap_dn
protected String ldap_dn
The ldap dn.
-
-
Method Detail
-
getKeys
public List<GHKey> getKeys() throws IOException
Gets keys.- Returns:
- the keys
- Throws:
IOException- the io exception
-
follow
public void follow() throws IOExceptionFollow this user.- Throws:
IOException- the io exception
-
unfollow
public void unfollow() throws IOExceptionUnfollow 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:
listEventsin classGHPerson- 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:
- Github LDAP
-
equals
public boolean equals(Object obj)
Equals.
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-