- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Type of repositories returned during listing. -
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionaddPublicKey
(String title, String key) Add public SSH key for the user.Gets the organization that this user belongs to.Gets the all repositories this user owns (public and private).Lists installations of your GitHub App that the authenticated user has explicit permission to access.Deprecated.Deprecated.UselistEmails()
Gets your membership in a specific organization.Returns the read-only list of all the public keys of the current user.Returns the read-only list of all the public verified keys of the current user.Returns the read-only list of e-mail addresses configured for you.List your organization memberships.List your organization memberships.Lists up all repositories this user owns (public and private).listRepositories
(int pageSize) List repositories that are accessible to the authenticated user (public and private) using the specified page size.listRepositories
(int pageSize, GHMyself.RepositoryListFilter repoType) List repositories of a certain type that are accessible by current authenticated user using the specified page size.Methods inherited from class org.kohsuke.github.GHUser
equals, follow, getBio, getFollowers, getFollows, getKeys, getLdapDn, getOrganizations, getSuspendedAt, hashCode, isHireable, isMemberOf, isMemberOf, isPublicMemberOf, listEvents, listFollowers, listFollows, listGists, listProjects, listStarredRepositories, listSubscriptions, unfollow
Methods inherited from class org.kohsuke.github.GHPerson
getAvatarUrl, getBlog, getCompany, getCreatedAt, getEmail, getFollowersCount, getFollowingCount, getHtmlUrl, getLocation, getLogin, getName, getPublicGistCount, getPublicRepoCount, getRepositories, getRepository, getTotalPrivateRepoCount, getTwitterUsername, getType, getUpdatedAt, isSiteAdmin, populate
Methods inherited from class org.kohsuke.github.GHObject
getId, getNodeId, getResponseHeaderFields, getUrl, setResponseHeaderFields, toString
-
Constructor Details
-
GHMyself
public GHMyself()Create default GHMyself instance
-
-
Method Details
-
getEmails
Deprecated.UselistEmails()
Gets emails.- Returns:
- the emails
- Throws:
IOException
- the io exception
-
getEmails2
Deprecated.UselistEmails()
Returns the read-only list of e-mail addresses configured for you.This corresponds to the stuff you configure in https://github.com/settings/emails, and not to be confused with
GHPerson.getEmail()
that shows your public e-mail address set in https://github.com/settings/profile- Returns:
- Always non-null.
- Throws:
IOException
- the io exception
-
listEmails
Returns the read-only list of e-mail addresses configured for you.This corresponds to the stuff you configure in https://github.com/settings/emails, and not to be confused with
GHPerson.getEmail()
that shows your public e-mail address set in https://github.com/settings/profile- Returns:
- Always non-null.
-
getPublicKeys
Returns the read-only list of all the public keys of the current user.NOTE: When using OAuth authentication, the READ/WRITE User scope is required by the GitHub APIs, otherwise you will get a 404 NOT FOUND.
- Returns:
- Always non-null.
- Throws:
IOException
- the io exception
-
addPublicKey
Add public SSH key for the user.https://docs.github.com/en/rest/users/keys?apiVersion=2022-11-28#create-a-public-ssh-key-for-the-authenticated-user
- Parameters:
title
- Title of the SSH keykey
- the public key- Returns:
- the newly created Github key
- Throws:
IOException
- the io exception
-
getPublicVerifiedKeys
Returns the read-only list of all the public verified keys of the current user.Differently from the getPublicKeys() method, the retrieval of the user's verified public keys does not require any READ/WRITE OAuth Scope to the user's profile.
- Returns:
- Always non-null.
- Throws:
IOException
- the io exception
-
getAllOrganizations
Gets the organization that this user belongs to.- Returns:
- the all organizations
- Throws:
IOException
- the io exception
-
getAllRepositories
Gets the all repositories this user owns (public and private).- Returns:
- the all repositories
- Throws:
IOException
- the io exception
-
listRepositories
Lists up all repositories this user owns (public and private). UnlikegetAllRepositories()
, this does not wait until all the repositories are returned. Repositories are returned by GitHub API with a 30 items per page.- Overrides:
listRepositories
in classGHPerson
- Returns:
- the paged iterable
-
listRepositories
List repositories that are accessible to the authenticated user (public and private) using the specified page size. This includes repositories owned by the authenticated user, repositories that belong to other users where the authenticated user is a collaborator, and other organizations' repositories that the authenticated user has access to through an organization membership.- Overrides:
listRepositories
in classGHPerson
- Parameters:
pageSize
- size for each page of items returned by GitHub. Maximum page size is 100. UnlikeGHPerson.getRepositories()
, this does not wait until all the repositories are returned.- Returns:
- the paged iterable
-
listRepositories
public PagedIterable<GHRepository> listRepositories(int pageSize, GHMyself.RepositoryListFilter repoType) List repositories of a certain type that are accessible by current authenticated user using the specified page size.- Parameters:
pageSize
- size for each page of items returned by GitHub. Maximum page size is 100.repoType
- type of repository returned in the listing- Returns:
- the paged iterable
-
listOrgMemberships
List your organization memberships.- Returns:
- the paged iterable
-
listOrgMemberships
List your organization memberships.- Parameters:
state
- Filter by a specific state- Returns:
- the paged iterable
-
getMembership
Gets your membership in a specific organization.- Parameters:
o
- the o- Returns:
- the membership
- Throws:
IOException
- the io exception
-
getAppInstallations
Lists installations of your GitHub App that the authenticated user has explicit permission to access. You must use a user-to-server OAuth access token, created for a user who has authorized your GitHub App, to access this endpoint.- Returns:
- the paged iterable
- See Also:
-
listEmails()