Class StashResource


  • @Singleton
    public class StashResource
    extends Object
    • 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 Server
        start - 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)
      • 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)
      • 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 id
        branchName - branch name
        start - 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)