Class GitHubResource
java.lang.Object
com.atlassian.bamboo.plugins.git.rest.resource.GitHubResource
@Path("gh")
@Consumes({"application/xml","application/json"})
@Produces({"application/xml","application/json"})
@Singleton
public class GitHubResource
extends Object
-
Constructor Summary
ConstructorsConstructorDescriptionGitHubResource
(com.atlassian.sal.api.message.I18nResolver i18nResolver, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, CredentialsAccessor credentialsAccessor, com.atlassian.plugins.whitelist.OutboundWhitelist outboundWhitelist, BambooPermissionManager bambooPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
createWebhook
(String owner, String name, @NotNull RestRequest request) javax.ws.rs.core.Response
destroyWebhook
(String owner, String name, @NotNull RestRequest request) javax.ws.rs.core.Response
getAvailableRepositories
(RestRequest request) javax.ws.rs.core.Response
getBranches
(String owner, String name, RestRequest request) protected @NotNull GitHubAccessor
getGitHubAccessor
(com.atlassian.bamboo.plugins.git.rest.resource.GitHubResource.GithubAccessCredentials accessCredentials, String apiBaseUrl) javax.ws.rs.core.Response
getWebhooks
(String owner, String name, @NotNull RestRequest request) javax.ws.rs.core.Response
invokeBambooWithWebhook
(@Nullable GithubWebhookPayload body, @Nullable String eventKey)
-
Constructor Details
-
GitHubResource
@Inject public GitHubResource(com.atlassian.sal.api.message.I18nResolver i18nResolver, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, CredentialsAccessor credentialsAccessor, com.atlassian.plugins.whitelist.OutboundWhitelist outboundWhitelist, BambooPermissionManager bambooPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
getAvailableRepositories
@POST @Path("repositories") public javax.ws.rs.core.Response getAvailableRepositories(RestRequest request) throws WebValidationException - Throws:
WebValidationException
-
getBranches
@POST @Path("repositories/{owner}/{name}/branches") public javax.ws.rs.core.Response getBranches(@PathParam("owner") String owner, @PathParam("name") String name, RestRequest request) throws WebValidationException - Throws:
WebValidationException
-
invokeBambooWithWebhook
@POST @Path("webhook/invoke") public javax.ws.rs.core.Response invokeBambooWithWebhook(@Nullable @Nullable GithubWebhookPayload body, @Nullable @HeaderParam("X-GitHub-Event") @Nullable String eventKey) -
getWebhooks
@POST @Path("webhooks/{owner}/{name}/") public javax.ws.rs.core.Response getWebhooks(@PathParam("owner") String owner, @PathParam("name") String name, @NotNull @NotNull RestRequest request) throws WebValidationException - Throws:
WebValidationException
-
createWebhook
@POST @Path("webhooks/{owner}/{name}/create") public javax.ws.rs.core.Response createWebhook(@PathParam("owner") String owner, @PathParam("name") String name, @NotNull @NotNull RestRequest request) throws WebValidationException - Throws:
WebValidationException
-
destroyWebhook
@POST @Path("webhooks/{owner}/{name}/destroy") public javax.ws.rs.core.Response destroyWebhook(@PathParam("owner") String owner, @PathParam("name") String name, @NotNull @NotNull RestRequest request) throws WebValidationException - Throws:
WebValidationException
-
getGitHubAccessor
@VisibleForTesting @NotNull protected @NotNull GitHubAccessor getGitHubAccessor(com.atlassian.bamboo.plugins.git.rest.resource.GitHubResource.GithubAccessCredentials accessCredentials, String apiBaseUrl)
-