Class PullRequestStatusRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.pullrequest.PullRequestStatusRequestBuilder

public class PullRequestStatusRequestBuilder extends BaseRequestBuilder
Request builder to manage pull request statuses Api.
  • Constructor Details

    • PullRequestStatusRequestBuilder

      public PullRequestStatusRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential)
      Instantiates a new RequestBuilder instance and sets the default values.
      Parameters:
      organizationUrl - Represents organization location request url.
      accessTokenCredential - Access token credential object.
  • Method Details

    • createAsync

      public CompletableFuture<GitStatus> createAsync(String repositoryId, int pullRequestId, GitStatus gitPullRequestStatus) throws AzDException
      Create a pull request status. The only required field for the status is Context.Name that uniquely identifies the status. Note that you can specify iterationId in the request body to post the status on the iteration.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      gitPullRequestStatus - Request body to create a new pull request status.
      Returns:
      GitStatus Object GitStatus
      Throws:
      AzDException - Default Api Exception handler.
    • deleteAsync

      public CompletableFuture<Void> deleteAsync(String repositoryId, int pullRequestId, int statusId) throws AzDException
      Delete pull request status. You can remove multiple statuses in one call by using Update operation.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      statusId - ID of the pull request status.
      Throws:
      AzDException - Default Api Exception handler.
    • getAsync

      public CompletableFuture<GitStatus> getAsync(String repositoryId, int pullRequestId, int statusId) throws AzDException
      Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      statusId - ID of the pull request status.
      Returns:
      GitStatus Object GitStatus
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      public CompletableFuture<GitStatuses> listAsync(String repositoryId, int pullRequestId) throws AzDException
      Get all the statuses associated with a pull request.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      Returns:
      GitStatuses Object GitStatuses
      Throws:
      AzDException - Default Api Exception handler.
    • updateAsync

      public CompletableFuture<Void> updateAsync(String repositoryId, int pullRequestId, List<JsonPatchDocument> propertiesToUpdate) throws AzDException
      Update pull request statuses collection. The only supported operation type is remove. This operation allows to delete multiple statuses in one call. The path of the remove operation should refer to the ID of the pull request status. For example path="/1" refers to the pull request status with ID 1.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      propertiesToUpdate - Collection of properties to update.
      
                                 [
                                   {
                                     "op": "remove",
                                     "path": "/1",
                                     "from": null,
                                     "value": null
                                   },
                                   {
                                     "op": "remove",
                                     "path": "/2",
                                     "from": null,
                                     "value": null
                                   }
                                 ]
                                 
      Throws:
      AzDException - Default Api Exception handler.
    • create

      public GitStatus create(String repositoryId, int pullRequestId, GitStatus gitPullRequestStatus) throws AzDException
      Create a pull request status. The only required field for the status is Context.Name that uniquely identifies the status. Note that you can specify iterationId in the request body to post the status on the iteration.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      gitPullRequestStatus - Request body to create a new pull request status.
      Returns:
      GitStatus Object GitStatus
      Throws:
      AzDException - Default Api Exception handler.
    • delete

      public Void delete(String repositoryId, int pullRequestId, int statusId) throws AzDException
      Delete pull request status. You can remove multiple statuses in one call by using Update operation.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      statusId - ID of the pull request status.
      Throws:
      AzDException - Default Api Exception handler.
    • get

      public GitStatus get(String repositoryId, int pullRequestId, int statusId) throws AzDException
      Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      statusId - ID of the pull request status.
      Returns:
      GitStatus Object GitStatus
      Throws:
      AzDException - Default Api Exception handler.
    • list

      public GitStatuses list(String repositoryId, int pullRequestId) throws AzDException
      Get all the statuses associated with a pull request.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      Returns:
      GitStatuses Object GitStatuses
      Throws:
      AzDException - Default Api Exception handler.
    • update

      public Void update(String repositoryId, int pullRequestId, List<JsonPatchDocument> propertiesToUpdate) throws AzDException
      Update pull request statuses collection. The only supported operation type is remove. This operation allows to delete multiple statuses in one call. The path of the remove operation should refer to the ID of the pull request status. For example path="/1" refers to the pull request status with ID 1.
      Parameters:
      repositoryId - The repository ID of the pull request’s target branch.
      pullRequestId - ID of the pull request.
      propertiesToUpdate - Collection of properties to update.
      
                                 [
                                   {
                                     "op": "remove",
                                     "path": "/1",
                                     "from": null,
                                     "value": null
                                   },
                                   {
                                     "op": "remove",
                                     "path": "/2",
                                     "from": null,
                                     "value": null
                                   }
                                 ]
                                 
      Throws:
      AzDException - Default Api Exception handler.