Class GitHubService
- All Implemented Interfaces:
GitHubClientProvider,InstallationTokenProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkiverse.githubapp.InstallationTokenProvider
InstallationTokenProvider.InstallationToken -
Constructor Summary
ConstructorsConstructorDescriptionGitHubService(CheckedConfigProvider checkedConfigProvider, JwtTokenCreator jwtTokenCreator, jakarta.enterprise.inject.Instance<GitHubCustomizer> gitHubCustomizer) -
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.github.GitHubGets 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.getInstallationToken(long installationId) Gets a valid installation token for a given application installation.io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClientio.smallrye.graphql.client.dynamic.api.DynamicGraphQLClientorg.kohsuke.github.GitHuborg.kohsuke.github.GitHub
-
Constructor Details
-
GitHubService
@Inject public GitHubService(CheckedConfigProvider checkedConfigProvider, JwtTokenCreator jwtTokenCreator, jakarta.enterprise.inject.Instance<GitHubCustomizer> gitHubCustomizer)
-
-
Method Details
-
getInstallationClient
public org.kohsuke.github.GitHub getInstallationClient(long installationId) Description copied from interface:GitHubClientProviderGets 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.- Specified by:
getInstallationClientin interfaceGitHubClientProvider- Returns:
- The client for the given installation.
-
getInstallationGraphQLClient
public io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient getInstallationGraphQLClient(long installationId) Description copied from interface:GitHubClientProviderGets 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.- Specified by:
getInstallationGraphQLClientin interfaceGitHubClientProvider- Returns:
- The client for the given installation.
-
getInstallationToken
Description copied from interface:InstallationTokenProviderGets a valid installation token for a given application installation.The token will remain functional a few minutes, so you should discard it after your unit of work and retrieve another one when necessary.
NOTE: You generally will not need this method when processing events, as clients 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 advanced use cases, e.g. when you need to access the GitHub API directly.- Specified by:
getInstallationTokenin interfaceInstallationTokenProvider- Returns:
- The client for the given installation.
-
getApplicationClient
public org.kohsuke.github.GitHub getApplicationClient()Description copied from interface:GitHubClientProviderGets 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.- Specified by:
getApplicationClientin interfaceGitHubClientProvider- Returns:
- The application client.
-
getTokenRestClient
public org.kohsuke.github.GitHub getTokenRestClient() -
getTokenGraphQLClient
public io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient getTokenGraphQLClient() -
getTokenOrApplicationClient
public org.kohsuke.github.GitHub getTokenOrApplicationClient() -
getTokenGraphQLClientOrNull
public io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient getTokenGraphQLClientOrNull()
-