Class StashResource
- java.lang.Object
-
- com.atlassian.bamboo.plugins.stash.rest.resource.StashResource
-
@Singleton public class StashResource extends Object
-
-
Constructor Summary
Constructors Constructor Description StashResource(com.atlassian.stash.rest.client.applinks.ApplinkStashClientFactory stashClientFactory, com.atlassian.sal.api.message.I18nResolver i18nResolver, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, BitbucketSeverMirrorHelper bitbucketSeverMirrorHelper, StashClientProvider stashClientProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
canMerge(long repositoryId, long pullRequestId)
javax.ws.rs.core.Response
getAvailableProjects(String serverKey, long start, long limit)
Returns list of available Bitbucket Server projects.javax.ws.rs.core.Response
getAvailableServers()
javax.ws.rs.core.Response
getBranch(String serverKey, String projectKey, String repositorySlug, String branchId)
javax.ws.rs.core.Response
getBranches(String serverKey, String projectKey, String repositorySlug, String query, long start, long limit)
javax.ws.rs.core.Response
getDefaultBranch(String serverKey, String projectKey, String repositorySlug)
javax.ws.rs.core.Response
getPullRequests(long repositoryId, String branchName, long start, long limit, long avatarSize)
Returns list of pull requests for given repository and optionally branch.javax.ws.rs.core.Response
getRepositories(String serverKey, String projectName, String query, long start, long limit)
javax.ws.rs.core.Response
getRepository(String serverKey, String projectKey, String repositorySlug)
javax.ws.rs.core.Response
getRepositoryMirrors(String serverKey, String projectKey, String repositorySlug)
javax.ws.rs.core.Response
getRepositoryPermission(String serverKey, String projectKey, String repositorySlug)
javax.ws.rs.core.Response
getRepositorySSHKeys(String serverKey, String projectKey, String repositorySlug, long start, long limit)
javax.ws.rs.core.Response
merge(long repositoryId, long pullRequestId, long version)
-
-
-
Constructor Detail
-
StashResource
@Inject public StashResource(com.atlassian.stash.rest.client.applinks.ApplinkStashClientFactory stashClientFactory, com.atlassian.sal.api.message.I18nResolver i18nResolver, CachedRepositoryDefinitionManager cachedRepositoryDefinitionManager, BitbucketSeverMirrorHelper bitbucketSeverMirrorHelper, StashClientProvider stashClientProvider)
-
-
Method Detail
-
getAvailableServers
public javax.ws.rs.core.Response getAvailableServers()
-
getAvailableProjects
public javax.ws.rs.core.Response getAvailableProjects(String serverKey, long start, long limit)
Returns list of available Bitbucket Server projects. Project's URL is based on the 'Display URL' configured in the application link.- Parameters:
serverKey
- name of the application link to Bitbucket Serverstart
- index of the first result to retrieve (for paging)limit
- total number of results to retrieve after start (for paging)- Returns:
- Response - list of projects
-
getRepositories
public javax.ws.rs.core.Response getRepositories(String serverKey, String projectName, String query, long start, long limit)
-
getRepository
public javax.ws.rs.core.Response getRepository(String serverKey, String projectKey, String repositorySlug)
-
getRepositoryMirrors
public javax.ws.rs.core.Response getRepositoryMirrors(String serverKey, String projectKey, String repositorySlug) throws WebValidationException
- Throws:
WebValidationException
-
getBranches
public javax.ws.rs.core.Response getBranches(String serverKey, String projectKey, String repositorySlug, String query, long start, long limit)
-
getDefaultBranch
public javax.ws.rs.core.Response getDefaultBranch(String serverKey, String projectKey, String repositorySlug)
-
getBranch
public javax.ws.rs.core.Response getBranch(String serverKey, String projectKey, String repositorySlug, String branchId)
-
getRepositoryPermission
public javax.ws.rs.core.Response getRepositoryPermission(String serverKey, String projectKey, String repositorySlug) throws WebValidationException
- Throws:
WebValidationException
-
getRepositorySSHKeys
public javax.ws.rs.core.Response getRepositorySSHKeys(String serverKey, String projectKey, String repositorySlug, long start, long limit) throws CredentialsRequiredContextException, com.opensymphony.webwork.dispatcher.json.JSONException
- Throws:
CredentialsRequiredContextException
com.opensymphony.webwork.dispatcher.json.JSONException
-
getPullRequests
public javax.ws.rs.core.Response getPullRequests(long repositoryId, String branchName, long start, long limit, long avatarSize)
Returns list of pull requests for given repository and optionally branch. Pull request URL is based on application link 'Display URL'.- Parameters:
repositoryId
- repository idbranchName
- branch namestart
- index of the first result to retrieve (for paging)limit
- total number of results to retrieve after start (for paging)avatarSize
- size of avatar images returned- Returns:
- Response - list of pull requests
-
merge
public javax.ws.rs.core.Response merge(long repositoryId, long pullRequestId, long version)
-
canMerge
public javax.ws.rs.core.Response canMerge(long repositoryId, long pullRequestId)
-
-