Package org.azd.helpers.git
Class GitHelpersRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.GitBaseRequestBuilder
org.azd.helpers.git.GitHelpersRequestBuilder
Helper request builder that combines multiple Apis to create logical helper methods for ease of use.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.azd.abstractions.BaseRequestBuilder
BaseRequestBuilder.ProjectExcludeParameter
-
Field Summary
Fields inherited from class org.azd.abstractions.BaseRequestBuilder
accessTokenCredential, apiVersion, area, locationId, organizationUrl, serializer
-
Constructor Summary
ConstructorDescriptionGitHelpersRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreateForkRepository
(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId) Create a fork of a parent repositorycreateForkRepository
(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId, String sourceBranch) Create a fork of a parent repository syncing only the provided refscreateForkRepositoryWithComplete
(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId, String sourceBranch, int checkTimes) Create a fork of a parent repository syncing only the provided refs with wait for operation completioncreateForkSyncRequest
(String repositoryName, String sourceCollectionId, String sourceProjectId, String sourceRepositoryId, Boolean includeLinks) Request that another repository's refs be fetched into this one.createForkSyncRequest
(String repositoryName, String collectionId, String projectId, String repositoryId, String sourceRef, String targetRef, Boolean includeLinks) Request that another repository's refs be fetched into this one.getForkSyncRequest
(String repositoryName, int operationId, boolean includeLinks) Get a specific fork sync operation's details.getForkSyncRequests
(String repositoryName, boolean includeLinks, boolean includeAbandoned) Retrieve all requested fork sync operations on this repository.Methods inherited from class org.azd.git.GitBaseRequestBuilder
annotatedTags, blobs, commits, forks, items, pullRequest, pullRequests, pushes, refs, repositories
Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
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 repositoryparentProjectId
- 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 repositoryparentProjectId
- Project id of the parent repository from which the fork operation has to initiate.parentRepositoryId
- Id of the parent repositorysourceBranch
- 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 repositoryparentProjectId
- Project id of the parent repository from which the fork operation has to initiate.parentRepositoryId
- Id of the parent repositorysourceBranch
- 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.
-