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:
  • Constructor Details

    • GHAppInstallation

      public GHAppInstallation()
      Create default GHAppInstallation instance
  • Method Details

    • createToken

      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
    • createToken

      @Deprecated public GHAppCreateTokenBuilder createToken(Map<String,GHPermissionType> permissions)
      Deprecated.
      Use createToken() 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
    • deleteInstallation

      public void deleteInstallation() throws IOException
      Delete a Github App installation

      You must use a JWT to access this endpoint.

      Throws:
      IOException - on error
      See Also:
    • getAccessTokenUrl

      public String getAccessTokenUrl()
      Gets access token url.
      Returns:
      the access token url
    • getAccount

      public GHUser getAccount()
      Gets account.
      Returns:
      the account
    • getAppId

      public long getAppId()
      Gets app id.
      Returns:
      the app id
    • getEvents

      public List<GHEvent> getEvents()
      Gets events.
      Returns:
      the events
    • getHtmlUrl

      public URL getHtmlUrl()
      Gets the html url.
      Returns:
      the html url
    • 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 an IOException
      See Also:
    • getPermissions

      public Map<String,GHPermissionType> getPermissions()
      Gets permissions.
      Returns:
      the permissions
    • getRepositoriesUrl

      public String getRepositoriesUrl()
      Gets repositories url.
      Returns:
      the repositories url
    • getRepositorySelection

      public GHRepositorySelection getRepositorySelection()
      Gets repository selection.
      Returns:
      the repository selection
    • getSingleFileName

      public String getSingleFileName()
      Gets single file name.
      Returns:
      the single file name
    • getSuspendedAt

      @WithBridgeMethods(value=java.util.Date.class, adapterMethod="instantToDate") public Instant getSuspendedAt()
      Gets suspended at.
      Returns:
      the suspended at
    • getSuspendedBy

      public GHUser getSuspendedBy()
      Gets suspended by.
      Returns:
      the suspended by
    • getTargetId

      public long getTargetId()
      Gets target id.
      Returns:
      the target id
    • getTargetType

      public GHTargetType getTargetType()
      Gets target type.
      Returns:
      the target type
    • listRepositories

      @Deprecated public PagedSearchIterable<GHRepository> listRepositories()
      Deprecated.
      This method cannot work on a GHAppInstallation retrieved from GHApp.listInstallations() (for example), except when resorting to unsupported hacks involving setRoot(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 a GHAuthenticatedAppInstallation from GitHub.getInstallation(), then call GHAuthenticatedAppInstallation.listRepositories().
      List repositories that this app installation can access.
      Returns:
      the paged iterable