Class GitHubService

java.lang.Object
io.quarkiverse.githubapp.runtime.github.GitHubService
All Implemented Interfaces:
GitHubClientProvider

@ApplicationScoped public class GitHubService extends Object implements GitHubClientProvider
  • Constructor Details

  • Method Details

    • getInstallationClient

      public org.kohsuke.github.GitHub getInstallationClient(long installationId)
      Description copied from interface: GitHubClientProvider
      Gets the GitHub client for a given application installation.

      The client will remain functional a few minutes at best, so you should discard it as soon as possible and retrieve another one when necessary.

      NOTE: You generally will not need this method when processing events, as this client can be automatically injected into event listener listener methods, simply by adding a parameter of type GitHub to the method. This method can still be useful for non-event use cases (e.g. cron jobs), to retrieve installation clients after having list application installations from the application client.

      Specified by:
      getInstallationClient in interface GitHubClientProvider
      Returns:
      The client for the given installation.
    • getInstallationGraphQLClient

      public io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient getInstallationGraphQLClient(long installationId)
      Description copied from interface: GitHubClientProvider
      Gets the GraphQL GitHub client for a given application installation.

      The client will remain functional a few minutes at best, so you should discard it as soon as possible and retrieve another one when necessary.

      NOTE: You generally will not need this method when processing events, as this client can be automatically injected into event listener methods, simply by adding a parameter of type DynamicGraphQLClient to the listener method. This method can still be useful for non-event use cases (e.g. cron jobs), to retrieve installation clients after having list application installations from the application client.

      Specified by:
      getInstallationGraphQLClient in interface GitHubClientProvider
      Returns:
      The client for the given installation.
    • getApplicationClient

      public org.kohsuke.github.GitHub getApplicationClient()
      Description copied from interface: GitHubClientProvider
      Gets the GitHub client for the application: it can be used without any installation, but has very little access rights (almost as little as an anonymous client).

      The client will remain functional a few minutes at best, so you should discard it as soon as possible and retrieve another one when necessary.

      NOTE: You generally will not need this method when processing events, as the more powerful installation client gets automatically injected into event listeners. This method can still be useful for non-event use cases (e.g. cron jobs), to retrieve information about the application, in particular list application installations.

      Specified by:
      getApplicationClient in interface GitHubClientProvider
      Returns:
      The application client.