Package org.kohsuke.github
Class GHAppInstallation
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHAppInstallation
-
public class GHAppInstallation extends GHObject
A Github App Installation.- Author:
- Paulo Miguel Almeida
- See Also:
GHApp#listInstallations()
,GHApp#getInstallationById(long)
,GHApp#getInstallationByOrganization(String)
,GHApp#getInstallationByRepository(String, String)
,GHApp#getInstallationByUser(String)
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHAppInstallation()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GHAppCreateTokenBuilder
createToken()
Starts a builder that creates a new App Installation Token.GHAppCreateTokenBuilder
createToken(Map<String,GHPermissionType> permissions)
Deprecated.UsecreateToken()
instead.void
deleteInstallation()
Delete a Github App installationString
getAccessTokenUrl()
Gets access token url.GHUser
getAccount()
Gets account.long
getAppId()
Gets app id.List<GHEvent>
getEvents()
Gets events.URL
getHtmlUrl()
Gets the html url.GHMarketplaceAccountPlan
getMarketplaceAccount()
Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App.Map<String,GHPermissionType>
getPermissions()
Gets permissions.String
getRepositoriesUrl()
Gets repositories url.GHRepositorySelection
getRepositorySelection()
Gets repository selection.GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.String
getSingleFileName()
Gets single file name.long
getTargetId()
Gets target id.GHTargetType
getTargetType()
Gets target type.PagedSearchIterable<GHRepository>
listRepositories()
Deprecated.This method cannot work on aGHAppInstallation
retrieved fromGHApp.listInstallations()
(for example), except when resorting to unsupported hacks involvingsetRoot(GitHub)
to switch from an application client to an installation client.void
setAccessTokenUrl(String accessTokenUrl)
Deprecated.Do not use this method.void
setAccount(GHUser account)
Deprecated.Do not use this method.void
setAppId(long appId)
Deprecated.Do not use this method.void
setEvents(List<GHEvent> events)
Deprecated.Do not use this method.void
setPermissions(Map<String,GHPermissionType> permissions)
Deprecated.Do not use this method.void
setRepositoriesUrl(String repositoriesUrl)
Deprecated.Do not use this method.void
setRepositorySelection(GHRepositorySelection repositorySelection)
Deprecated.Do not use this method.void
setRoot(GitHub root)
Deprecated.Do not use this method.void
setSingleFileName(String singleFileName)
Deprecated.Do not use this method.void
setTargetId(long targetId)
Deprecated.Do not use this method.void
setTargetType(GHTargetType targetType)
Deprecated.Do not use this method.-
Methods inherited from class org.kohsuke.github.GHObject
getCreatedAt, getId, getNodeId, getResponseHeaderFields, getUpdatedAt, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
getHtmlUrl
public URL getHtmlUrl()
Gets the html url.- Specified by:
getHtmlUrl
in classGHObject
- Returns:
- the html url
-
setRoot
@Deprecated public void setRoot(GitHub root)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets root.- Parameters:
root
- the root
-
getAccount
public GHUser getAccount()
Gets account.- Returns:
- the account
-
setAccount
@Deprecated public void setAccount(GHUser account)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets account.- Parameters:
account
- the account
-
getAccessTokenUrl
public String getAccessTokenUrl()
Gets access token url.- Returns:
- the access token url
-
setAccessTokenUrl
@Deprecated public void setAccessTokenUrl(String accessTokenUrl)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets access token url.- Parameters:
accessTokenUrl
- the access token url
-
getRepositoriesUrl
public String getRepositoriesUrl()
Gets repositories url.- Returns:
- the repositories url
-
listRepositories
@Deprecated @Preview(MACHINE_MAN) public PagedSearchIterable<GHRepository> listRepositories()
Deprecated.This method cannot work on aGHAppInstallation
retrieved fromGHApp.listInstallations()
(for example), except when resorting to unsupported hacks involvingsetRoot(GitHub)
to switch from an application client to an installation client. This method will be removed. You should instead use an installation client (with an installation token, not a JWT), retrieve aGHAuthenticatedAppInstallation
fromGitHub.getInstallation()
, then callGHAuthenticatedAppInstallation.listRepositories()
.List repositories that this app installation can access.- Returns:
- the paged iterable
-
setRepositoriesUrl
@Deprecated public void setRepositoriesUrl(String repositoriesUrl)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets repositories url.- Parameters:
repositoriesUrl
- the repositories url
-
getAppId
public long getAppId()
Gets app id.- Returns:
- the app id
-
setAppId
@Deprecated public void setAppId(long appId)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets app id.- Parameters:
appId
- the app id
-
getTargetId
public long getTargetId()
Gets target id.- Returns:
- the target id
-
setTargetId
@Deprecated public void setTargetId(long targetId)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets target id.- Parameters:
targetId
- the target id
-
getTargetType
public GHTargetType getTargetType()
Gets target type.- Returns:
- the target type
-
setTargetType
@Deprecated public void setTargetType(GHTargetType targetType)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets target type.- Parameters:
targetType
- the target type
-
getPermissions
public Map<String,GHPermissionType> getPermissions()
Gets permissions.- Returns:
- the permissions
-
setPermissions
@Deprecated public void setPermissions(Map<String,GHPermissionType> permissions)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets permissions.- Parameters:
permissions
- the permissions
-
setEvents
@Deprecated public void setEvents(List<GHEvent> events)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets events.- Parameters:
events
- the events
-
getSingleFileName
public String getSingleFileName()
Gets single file name.- Returns:
- the single file name
-
setSingleFileName
@Deprecated public void setSingleFileName(String singleFileName)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets single file name.- Parameters:
singleFileName
- the single file name
-
getRepositorySelection
public GHRepositorySelection getRepositorySelection()
Gets repository selection.- Returns:
- the repository selection
-
setRepositorySelection
@Deprecated public void setRepositorySelection(GHRepositorySelection repositorySelection)
Deprecated.Do not use this method. It was added due to incomplete understanding of Jackson binding.Sets repository selection.- Parameters:
repositorySelection
- the repository selection
-
deleteInstallation
@Preview(GAMBIT) public void deleteInstallation() throws IOException
Delete a Github App installationYou must use a JWT to access this endpoint.
- Throws:
IOException
- on error- See Also:
- Delete an installation
-
createToken
@BetaApi public GHAppCreateTokenBuilder createToken(Map<String,GHPermissionType> permissions)
Deprecated.UsecreateToken()
instead.Starts a builder that creates a new App Installation Token.You use the returned builder to set various properties, then call
GHAppCreateTokenBuilder.create()
to finally create an access token.- Parameters:
permissions
- map of permissions for the created token- Returns:
- a GHAppCreateTokenBuilder instance
-
createToken
@BetaApi public GHAppCreateTokenBuilder createToken()
Starts a builder that creates a new App Installation Token.You use the returned builder to set various properties, then call
GHAppCreateTokenBuilder.create()
to finally create an access token.- Returns:
- a GHAppCreateTokenBuilder instance
-
getMarketplaceAccount
public GHMarketplaceAccountPlan getMarketplaceAccount() throws IOException
Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.GitHub Apps must use a JWT to access this endpoint.
OAuth Apps must use basic authentication with their client ID and client secret to access this endpoint.
- Returns:
- a GHMarketplaceAccountPlan instance
- Throws:
IOException
- it may throw anIOException
- See Also:
- Get a subscription plan for an account
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-