Interface GitHubClientProvider
-
- All Known Implementing Classes:
GitHubService
public interface GitHubClientProviderA provider ofGitHub clientsfor the GitHub app.Inject as a CDI bean.
NOTE: You generally will not need this bean when processing events, as clients can be automatically injected into event listener methods, simply by adding a parameter of type
GitHuborDynamicGraphQLClientto the listener method. This provider is mostly useful for non-event use cases (e.g. cron jobs).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.kohsuke.github.GitHubgetApplicationClient()Gets theGitHub clientfor the application: it can be used without any installation, but has very little access rights (almost as little as an anonymous client).org.kohsuke.github.GitHubgetInstallationClient(long installationId)Gets theGitHub clientfor a given application installation.io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClientgetInstallationGraphQLClient(long installationId)Gets theGraphQL GitHub clientfor a given application installation.
-
-
-
Method Detail
-
getApplicationClient
org.kohsuke.github.GitHub getApplicationClient()
Gets theGitHub clientfor 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 clientgets automatically injected into event listeners. This method can still be useful for non-event use cases (e.g. cron jobs), toretrieve information about the application, in particularlist application installations.- Returns:
- The application client.
-
getInstallationClient
org.kohsuke.github.GitHub getInstallationClient(long installationId)
Gets theGitHub clientfor 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
GitHubto the method. This method can still be useful for non-event use cases (e.g. cron jobs), to retrieve installation clients after havinglist application installationsfrom theapplication client.- Returns:
- The client for the given installation.
-
getInstallationGraphQLClient
io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient getInstallationGraphQLClient(long installationId)
Gets theGraphQL GitHub clientfor 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
DynamicGraphQLClientto the listener method. This method can still be useful for non-event use cases (e.g. cron jobs), to retrieve installation clients after havinglist application installationsfrom theapplication client.- Returns:
- The client for the given installation.
-
-