Class GitHelpersRequestBuilder


public class GitHelpersRequestBuilder extends GitBaseRequestBuilder
Helper request builder that combines multiple Apis to create logical helper methods for ease of use.
  • Constructor Details

    • GitHelpersRequestBuilder

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

    • createForkRepository

      public GitRepository createForkRepository(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId) throws AzDException
      Create a fork of a parent repository
      Parameters:
      repositoryName - The name or ID of the repository.
      projectId - The project id of the target repository
      parentProjectId - Project id of the parent repository from which the fork operation has to initiate.
      parentRepositoryId - Id of the parent repository
      Returns:
      GitRepository Object GitRepository
      Throws:
      AzDException - Default Api Exception handler.
    • createForkRepository

      public GitRepository createForkRepository(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId, String sourceBranch) throws AzDException
      Create a fork of a parent repository syncing only the provided refs
      Parameters:
      repositoryName - The name or ID of the repository.
      projectId - The project id of the target repository
      parentProjectId - Project id of the parent repository from which the fork operation has to initiate.
      parentRepositoryId - Id of the parent repository
      sourceBranch - Provide the name of branch to create a fork request.
      Returns:
      GitRepository Object GitRepository
      Throws:
      AzDException - Default Api Exception handler.
    • createForkRepositoryWithComplete

      public GitRepository createForkRepositoryWithComplete(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId, String sourceBranch, int checkTimes) throws AzDException
      Create a fork of a parent repository syncing only the provided refs with wait for operation completion
      Parameters:
      repositoryName - The name or ID of the repository.
      projectId - The project id of the target repository
      parentProjectId - Project id of the parent repository from which the fork operation has to initiate.
      parentRepositoryId - Id of the parent repository
      sourceBranch - Provide the name of branch to create a fork request.
      checkTimes - Polling interval to wait for operation to complete.
      Returns:
      GitRepository Object GitRepository
      Throws:
      AzDException - Default Api Exception handler.
    • createForkSyncRequest

      public GitForkSyncRequest createForkSyncRequest(String repositoryName, String sourceCollectionId, String sourceProjectId, String sourceRepositoryId, Boolean includeLinks) throws AzDException
      Request that another repository's refs be fetched into this one. It syncs two existing forks.
      Parameters:
      repositoryName - The name or ID of the repository.
      sourceCollectionId - Team Project Collection ID of the collection for the repository.
      sourceProjectId - Team Project ID of the project for the repository.
      sourceRepositoryId - ID of the repository.
      includeLinks - Set to true to include links to items. Default is false.
      Returns:
      GitForkSyncRequest Object GitForkSyncRequest
      Throws:
      AzDException - Default Api Exception handler.
    • createForkSyncRequest

      public GitForkSyncRequest createForkSyncRequest(String repositoryName, String collectionId, String projectId, String repositoryId, String sourceRef, String targetRef, Boolean includeLinks) throws AzDException
      Request that another repository's refs be fetched into this one. It syncs two existing forks.
      Parameters:
      repositoryName - The name or ID of the repository.
      collectionId - Team Project Collection ID of the collection for the repository.
      projectId - Team Project ID of the project for the repository.
      repositoryId - ID of the repository.
      sourceRef - The source ref to copy. For example, refs/heads/main.
      targetRef - The target ref to update. For example, refs/heads/main.
      includeLinks - Set to true to include links to items. Default is false.
      Returns:
      GitForkSyncRequest Object GitForkSyncRequest
      Throws:
      AzDException - Default Api Exception handler.
    • getForkSyncRequest

      public GitForkSyncRequest getForkSyncRequest(String repositoryName, int operationId, boolean includeLinks) throws AzDException
      Get a specific fork sync operation's details.
      Parameters:
      repositoryName - The name or ID of the repository.
      operationId - OperationId of the sync request.
      includeLinks - Set to true to include links to items. Default is false.
      Returns:
      GitForkSyncRequest Object GitForkSyncRequest
      Throws:
      AzDException - Default Api Exception handler.
    • getForkSyncRequests

      public GitForkSyncRequests getForkSyncRequests(String repositoryName, boolean includeLinks, boolean includeAbandoned) throws AzDException
      Retrieve all requested fork sync operations on this repository.
      Parameters:
      repositoryName - The name or ID of the repository.
      includeLinks - Set to true to include links to items. Default is false.
      includeAbandoned - Set to true to include abandoned requests. Default is false.
      Returns:
      GitForkSyncRequests Object GitForkSyncRequests
      Throws:
      AzDException - Default Api Exception handler.