Class StashUrlRewritingClient

  • All Implemented Interfaces:
    com.atlassian.stash.rest.client.api.StashClient

    public class StashUrlRewritingClient
    extends Object
    implements com.atlassian.stash.rest.client.api.StashClient
    A wrapper for StashClient, which rewrites all URLs (for projects, repositories and pull requests) to use the Display URL from an application link (as the Display URL may be different from the RPC URL).

    This is to handle a case when SAML is used with Bitbucket Server as the session cookies are being set on a different domain and without this rewrite user would not be authorized.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.atlassian.stash.rest.client.api.StashClient

        com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection, com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder, com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter
    • Constructor Summary

      Constructors 
      Constructor Description
      StashUrlRewritingClient​(com.atlassian.stash.rest.client.api.StashClient stashClient, URI applinkDisplayUrl, URI applinkRpcUrl)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addProjectGroupPermission​(@NotNull String projectKey, @NotNull String groupName, @NotNull com.atlassian.stash.rest.client.api.entity.ProjectPermission permission)  
      boolean addProjectUserPermission​(@NotNull String projectKey, @NotNull String userName, @NotNull com.atlassian.stash.rest.client.api.entity.ProjectPermission permission)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Comment addPullRequestGeneralComment​(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId, @NotNull String text)  
      boolean addRepositoryKey​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String publicKey, @Nullable String keyLabel, @NotNull com.atlassian.stash.rest.client.api.entity.Permission keyPermission)  
      boolean addRepositoryUserPermission​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String userName, @NotNull com.atlassian.stash.rest.client.api.entity.Permission permission)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Task addTask​(@NotNull com.atlassian.stash.rest.client.api.entity.TaskAnchor anchor, @NotNull String text)  
      boolean addUserKey​(@NotNull String publicKey, @Nullable String keyLabel)  
      @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestMergeability canMergePullRequest​(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId)  
      boolean createCodeAnnotations​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey, @NotNull Iterable<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> codeAnnotations)  
      boolean createProject​(@NotNull String projectKey, @NotNull String name, @NotNull String type, @NotNull String description)  
      @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest​(@NotNull String title, @Nullable String description, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef, @NotNull Iterable<String> reviewers)  
      @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest​(@NotNull String title, @Nullable String description, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef, @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef, @NotNull Iterable<String> reviewers, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Report createReport​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull com.atlassian.stash.rest.client.api.entity.Report report)  
      boolean createRepository​(@NotNull String projectKey, @NotNull String name, @NotNull String scmId, boolean forkable)  
      void deleteCodeAnnotation​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey, @NotNull String externalId)  
      void deleteCodeAnnotations​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey)  
      boolean deleteProject​(@NotNull String projectKey)  
      void deleteReport​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String key)  
      boolean deleteRepository​(@NotNull String projectKey, @NotNull String repositorySlug)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Repository forkRepository​(@NotNull String sourceProjectKey, @NotNull String sourceRepositorySlug, @NotNull String targetProjectKey, @NotNull String targetRepositorySlug)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Project> getAccessibleProjects​(long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.ApplicationProperties getApplicationProperties()  
      @NotNull List<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> getCodeAnnotations​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.UserSshKey> getCurrentUserKeys​(long start, long limit)  
      Optional<com.atlassian.stash.rest.client.api.entity.Permission> getCurrentUserRepositoryPermission​(@NotNull String projectKey, @NotNull String repositorySlug)  
      @Nullable com.atlassian.stash.rest.client.api.entity.MirrorServer getMirror​(@NotNull String mirrorId)  
      com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectGroupPermission> getProjectGroupPermissions​(@NotNull String projectKey, @Nullable String filter, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> getProjectRepositories​(@NotNull String projectKey, long start, long limit)  
      com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectUserPermission> getProjectUserPermissions​(@NotNull String projectKey, @Nullable String filter, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository​(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String branchName, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository​(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String branchName, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter, @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order, long start, long limit, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)  
      @NotNull Optional<com.atlassian.stash.rest.client.api.entity.Report> getReport​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String key)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Report> getReports​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> getRepositories​(@Nullable String projectKey, @Nullable String query, long start, long limit)  
      @Nullable com.atlassian.stash.rest.client.api.entity.Repository getRepository​(@NotNull String projectKey, @NotNull String repositorySlug)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Branch> getRepositoryBranches​(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String query, long start, long limit)  
      @Nullable com.atlassian.stash.rest.client.api.entity.Branch getRepositoryDefaultBranch​(@NotNull String projectKey, @NotNull String repositorySlug)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.RepositorySshKey> getRepositoryKeys​(@NotNull String projectKey, @NotNull String repositorySlug, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.MirrorServer> getRepositoryMirrors​(long repositoryId, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.MirrorServer> getRepositoryMirrors​(long repositoryId, long start, long limit, boolean preAuthorized)  
      com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Tag> getRepositoryTags​(@NotNull String projectKey, @NotNull String repositorySlug, @Nullable String query, long start, long limit)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.User> getUsers​(@Nullable String filterForUsername, long start, long limit)  
      boolean isRepositoryKey​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String publicKey)  
      boolean isUserKey​(@NotNull String publicKey)  
      @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest​(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId, long version)  
      @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest​(@NotNull String projectKey, @NotNull String repositorySlug, long pullRequestId, long version, @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)  
      boolean projectExists​(@NotNull String projectKey)  
      boolean removeUserKey​(long keyId)  
      boolean removeUserKey​(@NotNull String publicKey)  
      boolean updateCodeAnnotation​(@NotNull String projectKey, @NotNull String repositorySlug, @NotNull String revision, @NotNull String reportKey, @NotNull String externalId, @NotNull com.atlassian.stash.rest.client.api.entity.CodeAnnotation codeAnnotation)  
      boolean updateProject​(@NotNull String projectKey, @NotNull String newProjectKey, @NotNull String name, @Nullable String description)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Task updateTask​(long taskId, @NotNull com.atlassian.stash.rest.client.api.entity.TaskState taskState)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Task updateTask​(long taskId, @NotNull String text)  
      @NotNull com.atlassian.stash.rest.client.api.entity.Task updateTask​(long taskId, @Nullable com.atlassian.stash.rest.client.api.entity.TaskState taskState, @Nullable String text)  
    • Constructor Detail

      • StashUrlRewritingClient

        public StashUrlRewritingClient​(com.atlassian.stash.rest.client.api.StashClient stashClient,
                                       URI applinkDisplayUrl,
                                       URI applinkRpcUrl)
    • Method Detail

      • getAccessibleProjects

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Project> getAccessibleProjects​(long start,
                                                                                                                                                  long limit)
        Specified by:
        getAccessibleProjects in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositories

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> getRepositories​(@Nullable
                                                                                                                                               @Nullable String projectKey,
                                                                                                                                               @Nullable
                                                                                                                                               @Nullable String query,
                                                                                                                                               long start,
                                                                                                                                               long limit)
        Specified by:
        getRepositories in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepository

        @Nullable
        public @Nullable com.atlassian.stash.rest.client.api.entity.Repository getRepository​(@NotNull
                                                                                             @NotNull String projectKey,
                                                                                             @NotNull
                                                                                             @NotNull String repositorySlug)
        Specified by:
        getRepository in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositoryBranches

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Branch> getRepositoryBranches​(@NotNull
                                                                                                                                                 @NotNull String projectKey,
                                                                                                                                                 @NotNull
                                                                                                                                                 @NotNull String repositorySlug,
                                                                                                                                                 @Nullable
                                                                                                                                                 @Nullable String query,
                                                                                                                                                 long start,
                                                                                                                                                 long limit)
        Specified by:
        getRepositoryBranches in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositoryTags

        public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Tag> getRepositoryTags​(@NotNull
                                                                                                                                 @NotNull String projectKey,
                                                                                                                                 @NotNull
                                                                                                                                 @NotNull String repositorySlug,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable String query,
                                                                                                                                 long start,
                                                                                                                                 long limit)
        Specified by:
        getRepositoryTags in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositoryMirrors

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.MirrorServer> getRepositoryMirrors​(long repositoryId,
                                                                                                                                                      long start,
                                                                                                                                                      long limit)
        Specified by:
        getRepositoryMirrors in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositoryMirrors

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.MirrorServer> getRepositoryMirrors​(long repositoryId,
                                                                                                                                                      long start,
                                                                                                                                                      long limit,
                                                                                                                                                      boolean preAuthorized)
        Specified by:
        getRepositoryMirrors in interface com.atlassian.stash.rest.client.api.StashClient
      • getMirror

        @Nullable
        public @Nullable com.atlassian.stash.rest.client.api.entity.MirrorServer getMirror​(@NotNull
                                                                                           @NotNull String mirrorId)
        Specified by:
        getMirror in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositoryDefaultBranch

        @Nullable
        public @Nullable com.atlassian.stash.rest.client.api.entity.Branch getRepositoryDefaultBranch​(@NotNull
                                                                                                      @NotNull String projectKey,
                                                                                                      @NotNull
                                                                                                      @NotNull String repositorySlug)
        Specified by:
        getRepositoryDefaultBranch in interface com.atlassian.stash.rest.client.api.StashClient
      • getRepositoryKeys

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.RepositorySshKey> getRepositoryKeys​(@NotNull
                                                                                                                                                       @NotNull String projectKey,
                                                                                                                                                       @NotNull
                                                                                                                                                       @NotNull String repositorySlug,
                                                                                                                                                       long start,
                                                                                                                                                       long limit)
        Specified by:
        getRepositoryKeys in interface com.atlassian.stash.rest.client.api.StashClient
      • addRepositoryKey

        public boolean addRepositoryKey​(@NotNull
                                        @NotNull String projectKey,
                                        @NotNull
                                        @NotNull String repositorySlug,
                                        @NotNull
                                        @NotNull String publicKey,
                                        @Nullable
                                        @Nullable String keyLabel,
                                        @NotNull
                                        @NotNull com.atlassian.stash.rest.client.api.entity.Permission keyPermission)
        Specified by:
        addRepositoryKey in interface com.atlassian.stash.rest.client.api.StashClient
      • isRepositoryKey

        public boolean isRepositoryKey​(@NotNull
                                       @NotNull String projectKey,
                                       @NotNull
                                       @NotNull String repositorySlug,
                                       @NotNull
                                       @NotNull String publicKey)
        Specified by:
        isRepositoryKey in interface com.atlassian.stash.rest.client.api.StashClient
      • getCurrentUserKeys

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.UserSshKey> getCurrentUserKeys​(long start,
                                                                                                                                                  long limit)
        Specified by:
        getCurrentUserKeys in interface com.atlassian.stash.rest.client.api.StashClient
      • isUserKey

        public boolean isUserKey​(@NotNull
                                 @NotNull String publicKey)
        Specified by:
        isUserKey in interface com.atlassian.stash.rest.client.api.StashClient
      • addUserKey

        public boolean addUserKey​(@NotNull
                                  @NotNull String publicKey,
                                  @Nullable
                                  @Nullable String keyLabel)
        Specified by:
        addUserKey in interface com.atlassian.stash.rest.client.api.StashClient
      • removeUserKey

        public boolean removeUserKey​(@NotNull
                                     @NotNull String publicKey)
        Specified by:
        removeUserKey in interface com.atlassian.stash.rest.client.api.StashClient
      • removeUserKey

        public boolean removeUserKey​(long keyId)
        Specified by:
        removeUserKey in interface com.atlassian.stash.rest.client.api.StashClient
      • createProject

        public boolean createProject​(@NotNull
                                     @NotNull String projectKey,
                                     @NotNull
                                     @NotNull String name,
                                     @NotNull
                                     @NotNull String type,
                                     @NotNull
                                     @NotNull String description)
        Specified by:
        createProject in interface com.atlassian.stash.rest.client.api.StashClient
      • createRepository

        public boolean createRepository​(@NotNull
                                        @NotNull String projectKey,
                                        @NotNull
                                        @NotNull String name,
                                        @NotNull
                                        @NotNull String scmId,
                                        boolean forkable)
        Specified by:
        createRepository in interface com.atlassian.stash.rest.client.api.StashClient
      • deleteProject

        public boolean deleteProject​(@NotNull
                                     @NotNull String projectKey)
        Specified by:
        deleteProject in interface com.atlassian.stash.rest.client.api.StashClient
      • deleteRepository

        public boolean deleteRepository​(@NotNull
                                        @NotNull String projectKey,
                                        @NotNull
                                        @NotNull String repositorySlug)
        Specified by:
        deleteRepository in interface com.atlassian.stash.rest.client.api.StashClient
      • getApplicationProperties

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.ApplicationProperties getApplicationProperties()
        Specified by:
        getApplicationProperties in interface com.atlassian.stash.rest.client.api.StashClient
      • getCurrentUserRepositoryPermission

        public Optional<com.atlassian.stash.rest.client.api.entity.Permission> getCurrentUserRepositoryPermission​(@NotNull
                                                                                                                  @NotNull String projectKey,
                                                                                                                  @NotNull
                                                                                                                  @NotNull String repositorySlug)
        Specified by:
        getCurrentUserRepositoryPermission in interface com.atlassian.stash.rest.client.api.StashClient
      • addRepositoryUserPermission

        public boolean addRepositoryUserPermission​(@NotNull
                                                   @NotNull String projectKey,
                                                   @NotNull
                                                   @NotNull String repositorySlug,
                                                   @NotNull
                                                   @NotNull String userName,
                                                   @NotNull
                                                   @NotNull com.atlassian.stash.rest.client.api.entity.Permission permission)
        Specified by:
        addRepositoryUserPermission in interface com.atlassian.stash.rest.client.api.StashClient
      • createPullRequest

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest​(@NotNull
                                                                                                       @NotNull String title,
                                                                                                       @Nullable
                                                                                                       @Nullable String description,
                                                                                                       @NotNull
                                                                                                       @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef,
                                                                                                       @NotNull
                                                                                                       @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef,
                                                                                                       @NotNull
                                                                                                       @NotNull Iterable<String> reviewers,
                                                                                                       @Nullable
                                                                                                       @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
        Specified by:
        createPullRequest in interface com.atlassian.stash.rest.client.api.StashClient
      • getPullRequestsByRepository

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository​(@NotNull
                                                                                                                                                                  @NotNull String projectKey,
                                                                                                                                                                  @NotNull
                                                                                                                                                                  @NotNull String repositorySlug,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable String branchName,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order,
                                                                                                                                                                  long start,
                                                                                                                                                                  long limit,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
        Specified by:
        getPullRequestsByRepository in interface com.atlassian.stash.rest.client.api.StashClient
      • mergePullRequest

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest​(@NotNull
                                                                                                      @NotNull String projectKey,
                                                                                                      @NotNull
                                                                                                      @NotNull String repositorySlug,
                                                                                                      long pullRequestId,
                                                                                                      long version,
                                                                                                      @Nullable
                                                                                                      @Nullable com.atlassian.stash.rest.client.api.AvatarRequest avatarRequest)
        Specified by:
        mergePullRequest in interface com.atlassian.stash.rest.client.api.StashClient
      • canMergePullRequest

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestMergeability canMergePullRequest​(@NotNull
                                                                                                               @NotNull String projectKey,
                                                                                                               @NotNull
                                                                                                               @NotNull String repositorySlug,
                                                                                                               long pullRequestId)
        Specified by:
        canMergePullRequest in interface com.atlassian.stash.rest.client.api.StashClient
      • forkRepository

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Repository forkRepository​(@NotNull
                                                                                             @NotNull String sourceProjectKey,
                                                                                             @NotNull
                                                                                             @NotNull String sourceRepositorySlug,
                                                                                             @NotNull
                                                                                             @NotNull String targetProjectKey,
                                                                                             @NotNull
                                                                                             @NotNull String targetRepositorySlug)
        Specified by:
        forkRepository in interface com.atlassian.stash.rest.client.api.StashClient
      • addPullRequestGeneralComment

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Comment addPullRequestGeneralComment​(@NotNull
                                                                                                        @NotNull String projectKey,
                                                                                                        @NotNull
                                                                                                        @NotNull String repositorySlug,
                                                                                                        long pullRequestId,
                                                                                                        @NotNull
                                                                                                        @NotNull String text)
        Specified by:
        addPullRequestGeneralComment in interface com.atlassian.stash.rest.client.api.StashClient
      • addTask

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Task addTask​(@NotNull
                                                                                @NotNull com.atlassian.stash.rest.client.api.entity.TaskAnchor anchor,
                                                                                @NotNull
                                                                                @NotNull String text)
        Specified by:
        addTask in interface com.atlassian.stash.rest.client.api.StashClient
      • updateTask

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Task updateTask​(long taskId,
                                                                                   @Nullable
                                                                                   @Nullable com.atlassian.stash.rest.client.api.entity.TaskState taskState,
                                                                                   @Nullable
                                                                                   @Nullable String text)
        Specified by:
        updateTask in interface com.atlassian.stash.rest.client.api.StashClient
      • getUsers

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.User> getUsers​(@Nullable
                                                                                                                                  @Nullable String filterForUsername,
                                                                                                                                  long start,
                                                                                                                                  long limit)
        Specified by:
        getUsers in interface com.atlassian.stash.rest.client.api.StashClient
      • getProjectRepositories

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Repository> getProjectRepositories​(@NotNull
                                                                                                                                                      @NotNull String projectKey,
                                                                                                                                                      long start,
                                                                                                                                                      long limit)
        Specified by:
        getProjectRepositories in interface com.atlassian.stash.rest.client.api.StashClient
      • projectExists

        public boolean projectExists​(@NotNull
                                     @NotNull String projectKey)
        Specified by:
        projectExists in interface com.atlassian.stash.rest.client.api.StashClient
      • updateProject

        public boolean updateProject​(@NotNull
                                     @NotNull String projectKey,
                                     @NotNull
                                     @NotNull String newProjectKey,
                                     @NotNull
                                     @NotNull String name,
                                     @Nullable
                                     @Nullable String description)
        Specified by:
        updateProject in interface com.atlassian.stash.rest.client.api.StashClient
      • getProjectGroupPermissions

        public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectGroupPermission> getProjectGroupPermissions​(@NotNull
                                                                                                                                                             @NotNull String projectKey,
                                                                                                                                                             @Nullable
                                                                                                                                                             @Nullable String filter,
                                                                                                                                                             long start,
                                                                                                                                                             long limit)
        Specified by:
        getProjectGroupPermissions in interface com.atlassian.stash.rest.client.api.StashClient
      • addProjectGroupPermission

        public boolean addProjectGroupPermission​(@NotNull
                                                 @NotNull String projectKey,
                                                 @NotNull
                                                 @NotNull String groupName,
                                                 @NotNull
                                                 @NotNull com.atlassian.stash.rest.client.api.entity.ProjectPermission permission)
        Specified by:
        addProjectGroupPermission in interface com.atlassian.stash.rest.client.api.StashClient
      • getProjectUserPermissions

        public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.ProjectUserPermission> getProjectUserPermissions​(@NotNull
                                                                                                                                                           @NotNull String projectKey,
                                                                                                                                                           @Nullable
                                                                                                                                                           @Nullable String filter,
                                                                                                                                                           long start,
                                                                                                                                                           long limit)
        Specified by:
        getProjectUserPermissions in interface com.atlassian.stash.rest.client.api.StashClient
      • addProjectUserPermission

        public boolean addProjectUserPermission​(@NotNull
                                                @NotNull String projectKey,
                                                @NotNull
                                                @NotNull String userName,
                                                @NotNull
                                                @NotNull com.atlassian.stash.rest.client.api.entity.ProjectPermission permission)
        Specified by:
        addProjectUserPermission in interface com.atlassian.stash.rest.client.api.StashClient
      • createPullRequest

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus createPullRequest​(@NotNull
                                                                                                       @NotNull String title,
                                                                                                       @Nullable
                                                                                                       @Nullable String description,
                                                                                                       @NotNull
                                                                                                       @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef fromRef,
                                                                                                       @NotNull
                                                                                                       @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestRef toRef,
                                                                                                       @NotNull
                                                                                                       @NotNull Iterable<String> reviewers)
        Specified by:
        createPullRequest in interface com.atlassian.stash.rest.client.api.StashClient
      • getPullRequestsByRepository

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getPullRequestsByRepository​(@NotNull
                                                                                                                                                                  @NotNull String projectKey,
                                                                                                                                                                  @NotNull
                                                                                                                                                                  @NotNull String repositorySlug,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable String branchName,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestDirection direction,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestStateFilter stateFilter,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable com.atlassian.stash.rest.client.api.StashClient.PullRequestsOrder order,
                                                                                                                                                                  long start,
                                                                                                                                                                  long limit)
        Specified by:
        getPullRequestsByRepository in interface com.atlassian.stash.rest.client.api.StashClient
      • mergePullRequest

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest​(@NotNull
                                                                                                      @NotNull String projectKey,
                                                                                                      @NotNull
                                                                                                      @NotNull String repositorySlug,
                                                                                                      long pullRequestId,
                                                                                                      long version)
        Specified by:
        mergePullRequest in interface com.atlassian.stash.rest.client.api.StashClient
      • updateTask

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Task updateTask​(long taskId,
                                                                                   @NotNull
                                                                                   @NotNull com.atlassian.stash.rest.client.api.entity.TaskState taskState)
        Specified by:
        updateTask in interface com.atlassian.stash.rest.client.api.StashClient
      • updateTask

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Task updateTask​(long taskId,
                                                                                   @NotNull
                                                                                   @NotNull String text)
        Specified by:
        updateTask in interface com.atlassian.stash.rest.client.api.StashClient
      • getReports

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.Report> getReports​(@NotNull
                                                                                                                                      @NotNull String projectKey,
                                                                                                                                      @NotNull
                                                                                                                                      @NotNull String repositorySlug,
                                                                                                                                      @NotNull
                                                                                                                                      @NotNull String revision,
                                                                                                                                      long start,
                                                                                                                                      long limit)
        Specified by:
        getReports in interface com.atlassian.stash.rest.client.api.StashClient
      • getReport

        @NotNull
        public @NotNull Optional<com.atlassian.stash.rest.client.api.entity.Report> getReport​(@NotNull
                                                                                              @NotNull String projectKey,
                                                                                              @NotNull
                                                                                              @NotNull String repositorySlug,
                                                                                              @NotNull
                                                                                              @NotNull String revision,
                                                                                              @NotNull
                                                                                              @NotNull String key)
        Specified by:
        getReport in interface com.atlassian.stash.rest.client.api.StashClient
      • createReport

        @NotNull
        public @NotNull com.atlassian.stash.rest.client.api.entity.Report createReport​(@NotNull
                                                                                       @NotNull String projectKey,
                                                                                       @NotNull
                                                                                       @NotNull String repositorySlug,
                                                                                       @NotNull
                                                                                       @NotNull String revision,
                                                                                       @NotNull
                                                                                       @NotNull com.atlassian.stash.rest.client.api.entity.Report report)
        Specified by:
        createReport in interface com.atlassian.stash.rest.client.api.StashClient
      • deleteReport

        public void deleteReport​(@NotNull
                                 @NotNull String projectKey,
                                 @NotNull
                                 @NotNull String repositorySlug,
                                 @NotNull
                                 @NotNull String revision,
                                 @NotNull
                                 @NotNull String key)
        Specified by:
        deleteReport in interface com.atlassian.stash.rest.client.api.StashClient
      • getCodeAnnotations

        @NotNull
        public @NotNull List<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> getCodeAnnotations​(@NotNull
                                                                                                           @NotNull String projectKey,
                                                                                                           @NotNull
                                                                                                           @NotNull String repositorySlug,
                                                                                                           @NotNull
                                                                                                           @NotNull String revision)
        Specified by:
        getCodeAnnotations in interface com.atlassian.stash.rest.client.api.StashClient
      • createCodeAnnotations

        public boolean createCodeAnnotations​(@NotNull
                                             @NotNull String projectKey,
                                             @NotNull
                                             @NotNull String repositorySlug,
                                             @NotNull
                                             @NotNull String revision,
                                             @NotNull
                                             @NotNull String reportKey,
                                             @NotNull
                                             @NotNull Iterable<com.atlassian.stash.rest.client.api.entity.CodeAnnotation> codeAnnotations)
        Specified by:
        createCodeAnnotations in interface com.atlassian.stash.rest.client.api.StashClient
      • updateCodeAnnotation

        public boolean updateCodeAnnotation​(@NotNull
                                            @NotNull String projectKey,
                                            @NotNull
                                            @NotNull String repositorySlug,
                                            @NotNull
                                            @NotNull String revision,
                                            @NotNull
                                            @NotNull String reportKey,
                                            @NotNull
                                            @NotNull String externalId,
                                            @NotNull
                                            @NotNull com.atlassian.stash.rest.client.api.entity.CodeAnnotation codeAnnotation)
        Specified by:
        updateCodeAnnotation in interface com.atlassian.stash.rest.client.api.StashClient
      • deleteCodeAnnotation

        public void deleteCodeAnnotation​(@NotNull
                                         @NotNull String projectKey,
                                         @NotNull
                                         @NotNull String repositorySlug,
                                         @NotNull
                                         @NotNull String revision,
                                         @NotNull
                                         @NotNull String reportKey,
                                         @NotNull
                                         @NotNull String externalId)
        Specified by:
        deleteCodeAnnotation in interface com.atlassian.stash.rest.client.api.StashClient
      • deleteCodeAnnotations

        public void deleteCodeAnnotations​(@NotNull
                                          @NotNull String projectKey,
                                          @NotNull
                                          @NotNull String repositorySlug,
                                          @NotNull
                                          @NotNull String revision,
                                          @NotNull
                                          @NotNull String reportKey)
        Specified by:
        deleteCodeAnnotations in interface com.atlassian.stash.rest.client.api.StashClient