Class PullRequestsRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.pullrequests.PullRequestsRequestBuilder

public class PullRequestsRequestBuilder extends BaseRequestBuilder
Pull requests request builder for managing Git PullRequests API.
  • Constructor Details

    • PullRequestsRequestBuilder

      public PullRequestsRequestBuilder(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<GitPullRequest> createAsync(String repositoryId, GitPullRequest gitPullRequest, Boolean supportsIterations) throws AzDException
      Create a pull request.
      Parameters:
      repositoryId - id of the repository.
      gitPullRequest - a GitPullRequest object.
      supportsIterations - If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.
      Returns:
      Git pull request object GitPullRequest
      Throws:
      AzDException - Default Api Exception handler.
    • getAsync

      public CompletableFuture<GitPullRequest> getAsync(String repositoryName, int pullRequestId) throws AzDException
      Retrieve a pull request.
      Parameters:
      repositoryName - The repository name of the pull request's target branch.
      pullRequestId - The ID of the pull request to retrieve.
      Returns:
      GitPullRequest object
      Throws:
      AzDException - Default Api Exception handler.
    • getAsync

      public CompletableFuture<GitPullRequest> getAsync(String repositoryName, int pullRequestId, Consumer<PullRequestsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Retrieve a pull request.
      Parameters:
      repositoryName - The repository name of the pull request's target branch.
      pullRequestId - The ID of the pull request to retrieve.
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      GitPullRequest object
      Throws:
      AzDException - Default Api Exception handler.
    • getByIdAsync

      public CompletableFuture<GitPullRequest> getByIdAsync(int pullRequestId) throws AzDException
      Retrieve a pull request.
      Parameters:
      pullRequestId - The ID of the pull request to retrieve.
      Returns:
      GitPullRequest object
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      public CompletableFuture<PullRequests> listAsync(String repositoryName) throws AzDException
      Retrieve all pull requests from a repository
      Parameters:
      repositoryName - specify the repository name
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      public CompletableFuture<PullRequests> listAsync(String repositoryName, Consumer<PullRequestsRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException
      Retrieve all pull requests from a repository
      Parameters:
      repositoryName - specify the repository name
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      public CompletableFuture<PullRequests> listAsync() throws AzDException
      Gets all pull requests from a project.
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      Gets all pull requests from a project.
      Parameters:
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • updateAsync

      public CompletableFuture<GitPullRequest> updateAsync(String repositoryId, int pullRequestId, GitPullRequest gitPullRequest) throws AzDException
      Update a pull request

      These are the properties that can be updated with the API: Status Title Description (up to 4000 characters) CompletionOptions MergeOptions AutoCompleteSetBy.Id TargetRefName (when the PR retargeting feature is enabled) Attempting to update other properties outside of this list will either cause the server to throw an InvalidArgumentValueException, or to silently ignore the update.

      Parameters:
      repositoryId - The repository ID of the pull request's target branch.
      pullRequestId - ID of the pull request to update.
      gitPullRequest - Git pull request object to update.
      Returns:
      GitPullRequest Object GitPullRequest
      Throws:
      AzDException - Default Api Exception handler.
    • create

      public GitPullRequest create(String repositoryId, GitPullRequest gitPullRequest, Boolean supportsIterations) throws AzDException
      Create a pull request.
      Parameters:
      repositoryId - id of the repository.
      gitPullRequest - a GitPullRequest object.
      supportsIterations - If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.
      Returns:
      Git pull request object GitPullRequest
      Throws:
      AzDException - Default Api Exception handler.
    • get

      public GitPullRequest get(String repositoryName, int pullRequestId) throws AzDException
      Retrieve a pull request.
      Parameters:
      repositoryName - The repository name of the pull request's target branch.
      pullRequestId - The ID of the pull request to retrieve.
      Returns:
      GitPullRequest object
      Throws:
      AzDException - Default Api Exception handler.
    • get

      public GitPullRequest get(String repositoryName, int pullRequestId, Consumer<PullRequestsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Retrieve a pull request.
      Parameters:
      repositoryName - The repository name of the pull request's target branch.
      pullRequestId - The ID of the pull request to retrieve.
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      GitPullRequest object
      Throws:
      AzDException - Default Api Exception handler.
    • getById

      public GitPullRequest getById(int pullRequestId) throws AzDException
      Retrieve a pull request.
      Parameters:
      pullRequestId - The ID of the pull request to retrieve.
      Returns:
      GitPullRequest object
      Throws:
      AzDException - Default Api Exception handler.
    • list

      public PullRequests list(String repositoryName) throws AzDException
      Retrieve all pull requests from a repository
      Parameters:
      repositoryName - specify the repository name
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • list

      public PullRequests list(String repositoryName, Consumer<PullRequestsRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException
      Retrieve all pull requests from a repository
      Parameters:
      repositoryName - specify the repository name
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • list

      public PullRequests list() throws AzDException
      Gets all pull requests from a project.
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • list

      Gets all pull requests from a project.
      Parameters:
      requestConfiguration - Consumer of request configuration. This represents the query parameter for the request.
      Returns:
      PullRequests object
      Throws:
      AzDException - Default Api Exception handler.
    • update

      public GitPullRequest update(String repositoryId, int pullRequestId, GitPullRequest gitPullRequest) throws AzDException
      Update a pull request

      These are the properties that can be updated with the API: Status Title Description (up to 4000 characters) CompletionOptions MergeOptions AutoCompleteSetBy.Id TargetRefName (when the PR retargeting feature is enabled) Attempting to update other properties outside of this list will either cause the server to throw an InvalidArgumentValueException, or to silently ignore the update.

      Parameters:
      repositoryId - The repository ID of the pull request's target branch.
      pullRequestId - ID of the pull request to update.
      gitPullRequest - Git pull request object to update.
      Returns:
      GitPullRequest Object GitPullRequest
      Throws:
      AzDException - Default Api Exception handler.