Class RefsRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.refs.RefsRequestBuilder

public class RefsRequestBuilder extends BaseRequestBuilder
Request builder to handle requests for Git Refs Api.
  • Constructor Details

    • RefsRequestBuilder

      public RefsRequestBuilder(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

    • listAsync

      public CompletableFuture<GitRefs> listAsync(String repositoryName) throws AzDException
      Queries the provided repository for its refs and returns them.
      Parameters:
      repositoryName - The name or ID of the repository.
      Returns:
      GitRefs future object GitRefs.
      Throws:
      AzDException - Default Api exception handler.
    • listAsync

      public CompletableFuture<GitRefs> listAsync(String repositoryName, Consumer<RefsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Queries the provided repository for its refs and returns them.
      Parameters:
      repositoryName - The name or ID of the repository.
      Returns:
      GitRefs future object GitRefs.
      Throws:
      AzDException - Default Api exception handler.
    • updateAsync

      public CompletableFuture<GitRef> updateAsync(String repositoryName, String branchName, boolean isLocked) throws AzDException
      Lock or Unlock a branch with repository name and branch name.
      Parameters:
      repositoryName - The name or ID of the repository.
      branchName - The name of the branch to lock/unlock
      isLocked - true to lock the branch and false to unlock.
      Returns:
      GitRef GitRef
      Throws:
      AzDException - Default Api Exception handler.
    • updateAsync

      public CompletableFuture<GitRefUpdateResults> updateAsync(String repositoryName, List<GitRefUpdate> gitRefUpdates) throws AzDException
      Creating, updating, or deleting refs(branches). Updating a ref means making it point at a different commit than it used to. You must specify both the old and new commit to avoid race conditions.
      Parameters:
      repositoryName - The name or ID of the repository.
      gitRefUpdates - Collection of Git Reference object to update.
      Returns:
      GitRefUpdateResults GitRefUpdateResults
      Throws:
      AzDException - Default Api Exception handler.
    • list

      public GitRefs list(String repositoryName) throws AzDException
      Queries the provided repository for its refs and returns them.
      Parameters:
      repositoryName - The name or ID of the repository.
      Returns:
      GitRefs future object GitRefs.
      Throws:
      AzDException - Default Api exception handler.
    • list

      public GitRefs list(String repositoryName, Consumer<RefsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException
      Queries the provided repository for its refs and returns them.
      Parameters:
      repositoryName - The name or ID of the repository.
      Returns:
      GitRefs future object GitRefs.
      Throws:
      AzDException - Default Api exception handler.
    • update

      public GitRef update(String repositoryName, String branchName, boolean isLocked) throws AzDException
      Lock or Unlock a branch with repository name and branch name.
      Parameters:
      repositoryName - The name or ID of the repository.
      branchName - The name of the branch to lock/unlock
      isLocked - true to lock the branch and false to unlock.
      Returns:
      GitRef GitRef
      Throws:
      AzDException - Default Api Exception handler.
    • update

      public GitRefUpdateResults update(String repositoryName, List<GitRefUpdate> gitRefUpdates) throws AzDException
      Creating, updating, or deleting refs(branches). Updating a ref means making it point at a different commit than it used to. You must specify both the old and new commit to avoid race conditions.
      Parameters:
      repositoryName - The name or ID of the repository.
      gitRefUpdates - Collection of Git Reference object to update.
      Returns:
      GitRefUpdateResults GitRefUpdateResults
      Throws:
      AzDException - Default Api Exception handler.