Package org.azd.git
Class GitApi
- All Implemented Interfaces:
GitDetails
GIT class to manage git API
-
Constructor Summary
ConstructorDescriptionGitApi
(Connection connection) Pass the connection object to work with Git Api -
Method Summary
Modifier and TypeMethodDescriptioncreateAnnotatedTag
(String repositoryName, String tagName, String objectId, String message) Create an annotated tag.createForkRepository
(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.createPullRequest
(String repositoryId, String sourceRefName, String targetRefName, String title, String description, boolean isDraft) Create a pull request and optionally make it a draft.createPullRequest
(String repositoryId, String sourceRefName, String targetRefName, String title, String description, String[] reviewers) Create a pull request.createPullRequest
(GitPullRequest gitPullRequest) Create a pull request.createPullRequestLabel
(String repositoryName, int pullRequestId, String labelName) Create a label for a specified pull request.createPullRequestReviewer
(int pullRequestId, String repositoryName, String reviewerId, int vote, boolean isRequired) Add a reviewer to a pull request or cast a vote.createPullRequestStatus
(int pullRequestId, String repositoryId, GitStatus gitPullRequestStatus) Create a pull request status.createPush
(String repositoryId, GitPush gitPush) Push changes to the repository.createRepository
(String repositoryName, String projectId) Create a git repository in a team project.Creates a new tag in the repository that points to the supplied ref.deletePullRequestLabel
(String repositoryName, int pullRequestId, String labelName) Removes a label from the set of those assigned to the pull request.deletePullRequestReviewer
(int pullRequestId, String repositoryName, String reviewerId) Remove a reviewer from a pull request.deletePullRequestStatus
(int pullRequestId, String repositoryId, int statusId) Delete pull request status.deleteRepository
(String repositoryId) Delete a git repositorydeleteRepositoryFromRecycleBin
(String repositoryId) Destroy (hard delete) a soft-deleted Git repository.Deletes a tag of a repository with given name.getAnnotatedTag
(String repositoryName, String objectId) Get an annotated tag.Get a single blob.Get a single blob.getBlobContent
(String repositoryId, String sha1, boolean download, String fileName, boolean resolveLfs) Get a single blob content.getBlobContentAsStream
(String repositoryId, String sha1, boolean download, String fileName, boolean resolveLfs) Get a single blob content as input stream.getBlobContentAsZip
(String repositoryId, String sha1, boolean download, String fileName, boolean resolveLfs) Get a single blob as zip of input stream.getBlobsZip
(String repositoryId, String fileName, List<String> sha1) Gets one or more blobs in a zip file download.getBlobsZip
(String repositoryId, List<String> sha1) Gets one or more blobs in a zip file download.Get a specific branch from a repository.getBranches
(String repositoryName) Get the branches from a repository.getChanges
(String repositoryName, String commitId) Retrieve changes for a particular commit.getChanges
(String repositoryName, String commitId, int top, int skip) Retrieve changes for a particular commit.Retrieve a particular commit.Retrieve a particular commit.getCommits
(String repositoryName) Retrieve git commits for a project.getCommits
(String repositoryName, int top) Retrieve git commits for a project.getCommits
(String repositoryName, int top, int skip, String author, String version, GitVersionOptions versionOptions, GitVersionType versionType, boolean excludeDeletes, String fromCommitId, String toCommitId, String fromDate, String toDate, GitHistoryMode historyMode, List<String> ids, boolean includeLinks, boolean includePushData, boolean includeUserImageUrl, boolean includeWorkItems, String itemPath, boolean showOldestCommitsFirst, String user, String itemVersion, GitVersionOptions itemVersionOptions, GitVersionType itemVersionType) Retrieve git commits for a project.getCommits
(String repositoryName, List<String> ids) Retrieve git commits for a project.getCommitsBatch
(String repositoryId, GitCommitsBatch gitCommitsBatch) Retrieve git commits for a project matching the search criteria.Retrieve deleted git repositories.Retrieve all forks of a repository in the collection.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.Get Item Metadata and/or Content for a collection of items.getItems
(String repositoryName, boolean includeContentMetadata, boolean includeLinks, boolean latestProcessedChange, VersionControlRecursionType recursionType, String scopePath) Get Item Metadata and/or Content for a collection of items.getItems
(String repositoryName, boolean includeContentMetadata, boolean includeLinks, boolean latestProcessedChange, VersionControlRecursionType recursionType, String scopePath, String version, GitVersionOptions versionOptions, GitVersionType versionType) Get Item Metadata and/or Content for a collection of items.getItems
(String repositoryName, VersionControlRecursionType recursionType) Get Item Metadata and/or Content for a collection of items.getPullRequest
(String repositoryName, int pullRequestId) Retrieve a pull request.getPullRequest
(String repositoryName, int pullRequestId, boolean includeCommits) Retrieve a pull request.getPullRequest
(String repositoryName, int pullRequestId, boolean includeCommits, boolean includeWorkItemRefs) Retrieve a pull request.getPullRequestById
(int pullRequestId) Retrieve a pull request.getPullRequestLabel
(String repositoryName, int pullRequestId, String labelName) Retrieves a single label that has been assigned to a pull request.getPullRequestLabels
(String repositoryName, int pullRequestId) Get all the labels assigned to a pull request.getPullRequestReviewer
(int pullRequestId, String repositoryName, String reviewerId) Retrieve information about a particular reviewer on a pull requestgetPullRequestReviewers
(int pullRequestId, String repositoryName) Retrieve the reviewers for a pull requestgetPullRequests
(String repositoryName) Retrieve all pull requests from a repositorygetPullRequests
(String repositoryName, boolean includeLinks) Retrieve all pull requests from a repositorygetPullRequests
(String repositoryName, int top) Retrieve all pull requests from a repositorygetPullRequests
(String repositoryName, int top, int skip) Retrieve all pull requests from a repositorygetPullRequests
(String repositoryName, int top, int skip, String creatorId) Retrieve all pull requests from a repositorygetPullRequests
(String repositoryName, PullRequestStatus status) Retrieve all pull requests from a repositorygetPullRequests
(String repositoryName, GitPullRequestQueryParameters gitPullRequestQueryParameters) Retrieve all pull requests from a repositoryGets all pull requests from a project.getPullRequestsByProject
(int top) Gets all pull requests from a project.getPullRequestsByProject
(int skip, int top, String creatorId, boolean includeLinks, String repositoryId, String reviewerId, String sourceRefName, String sourceRepositoryId, PullRequestStatus status, String targetRefName) Gets all pull requests from a project.Gets all pull requests from a project.getPullRequestStatus
(int pullRequestId, String repositoryId, int statusId) Get the specific pull request status by ID.getPullRequestStatuses
(int pullRequestId, String repositoryId) Get all the statuses associated with a pull request.getPullRequestWorkItems
(int pullRequestId, String repositoryName) Retrieve a list of work items associated with a pull request.Retrieves a particular push.Retrieves a particular push.Retrieves a particular push.Retrieves a particular push.getPushCommits
(String repositoryName, int pushId) Retrieve a list of commits associated with a particular push.getPushCommits
(String repositoryName, int pushId, boolean includeLinks, int top, int skip) Retrieve a list of commits associated with a particular push.Retrieves pushes associated with the specified repository.Retrieve soft-deleted git repositories from the recycle bin.Queries the provided repository for its refs and returns them.Queries the provided repository for its refs and returns them.Retrieve git repositories.getRepositories
(boolean includeHidden) Retrieve git repositories.getRepositories
(boolean includeLinks, boolean includeAllUrls) Retrieve git repositories.getRepositories
(boolean includeAllUrls, boolean includeLinks, boolean includeHidden) Retrieve git repositories.getRepository
(String repositoryName) Retrieve a git repository.restoreRepositoryFromRecycleBin
(String repositoryId, boolean deleted) Recover a soft-deleted Git repository.updateBranchLock
(String repositoryName, String branchName, boolean isLocked) Lock or Unlock a branch with repository name and branch name.updatePullRequest
(String repositoryId, int pullRequestId, Object body) Update a pull requestupdatePullRequestReviewer
(int pullRequestId, String repositoryName, String reviewerId, boolean isFlagged, boolean hasDeclined) Edit a reviewer entry.updatePullRequestStatuses
(int pullRequestId, String repositoryId, List<JsonPatchDocument> propertiesToUpdate) Update pull request statuses collection.Creating, updating, or deleting git ref.updateRepository
(String repositoryId, String repositoryName, String defaultBranchName) Updates the Git repository with either a new repo name or a new default branch.Methods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
GitApi
Pass the connection object to work with Git Api- Parameters:
connection
- Connection object
-
-
Method Details
-
createRepository
Create a git repository in a team project.- Specified by:
createRepository
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repositoryprojectId
- id of the project- Returns:
- git repository object
GitRepository
- Throws:
AzDException
- Default Api Exception handler.
-
deleteRepository
Delete a git repository- Specified by:
deleteRepository
in interfaceGitDetails
- Parameters:
repositoryId
- pass the repository id- Throws:
AzDException
- Default Api Exception handler.
-
deleteRepositoryFromRecycleBin
Destroy (hard delete) a soft-deleted Git repository.- Specified by:
deleteRepositoryFromRecycleBin
in interfaceGitDetails
- Parameters:
repositoryId
- pass the repository id- Throws:
AzDException
- Default Api Exception handler.
-
getDeletedRepositories
Retrieve deleted git repositories.- Specified by:
getDeletedRepositories
in interfaceGitDetails
- Returns:
- Git deleted repository object
- Throws:
AzDException
- Default Api Exception handler.
-
getRecycleBinRepositories
Retrieve soft-deleted git repositories from the recycle bin.- Specified by:
getRecycleBinRepositories
in interfaceGitDetails
- Returns:
- array of git deleted recycle bin repositories
- Throws:
AzDException
- Default Api Exception handler.
-
getRepository
Retrieve a git repository.- Specified by:
getRepository
in interfaceGitDetails
- Parameters:
repositoryName
- pass the repository name- Returns:
- git repository object
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
Retrieve git repositories.- Specified by:
getRepositories
in interfaceGitDetails
- Returns:
- array of git repositories
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
Retrieve git repositories.- Specified by:
getRepositories
in interfaceGitDetails
- Parameters:
includeHidden
- If true then includes hidden repositories.- Returns:
- array of git repositories
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
public Repositories getRepositories(boolean includeLinks, boolean includeAllUrls) throws AzDException Retrieve git repositories.- Specified by:
getRepositories
in interfaceGitDetails
- Parameters:
includeLinks
- Set this value to true to include reference links.includeAllUrls
- If true then includes all remote URLs.- Returns:
- array of git repositories
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
public Repositories getRepositories(boolean includeAllUrls, boolean includeLinks, boolean includeHidden) throws AzDException Retrieve git repositories.- Specified by:
getRepositories
in interfaceGitDetails
- Parameters:
includeAllUrls
- If true then includes all remote URLs.includeLinks
- Set this value to true to include reference links.includeHidden
- If true then includes hidden repositories.- Returns:
- array of git repositories
- Throws:
AzDException
- Default Api Exception handler.
-
restoreRepositoryFromRecycleBin
public GitRepository restoreRepositoryFromRecycleBin(String repositoryId, boolean deleted) throws AzDException Recover a soft-deleted Git repository. Recently deleted repositories go into a soft-delete state for a period of time before they are hard deleted and become unrecoverable.- Specified by:
restoreRepositoryFromRecycleBin
in interfaceGitDetails
- Parameters:
repositoryId
- pass the repository iddeleted
- Setting to false will undo earlier deletion and restore the repository.- Returns:
- object of git repository
GitRepository
- Throws:
AzDException
- Default Api Exception handler.
-
updateRepository
public GitRepository updateRepository(String repositoryId, String repositoryName, String defaultBranchName) throws AzDException Updates the Git repository with either a new repo name or a new default branch.- Specified by:
updateRepository
in interfaceGitDetails
- Parameters:
repositoryId
- provide the repository idrepositoryName
- pass the repository name to renamedefaultBranchName
- pass the default branch name to set- Returns:
- repository object
- Throws:
AzDException
- Default Api Exception handler.
-
createPullRequest
public GitPullRequest createPullRequest(String repositoryId, String sourceRefName, String targetRefName, String title, String description, String[] reviewers) throws AzDException Create a pull request.- Specified by:
createPullRequest
in interfaceGitDetails
- Parameters:
repositoryId
- The repository ID of the pull request's target branch.sourceRefName
- The name of the source branch of the pull request.targetRefName
- The name of the target branch of the pull request.title
- The title of the pull request.description
- The description of the pull request.reviewers
- A list of reviewers on the pull request along with the state of their votes.- Returns:
- an object of git pull request
GitPullRequest
- Throws:
AzDException
- Default Api Exception handler.
-
createPullRequest
public GitPullRequest createPullRequest(String repositoryId, String sourceRefName, String targetRefName, String title, String description, boolean isDraft) throws AzDException Create a pull request and optionally make it a draft. You can specify only the source branch name such as develop and target branch name such as master.- Specified by:
createPullRequest
in interfaceGitDetails
- Parameters:
repositoryId
- The repository ID of the pull request's target branch.sourceRefName
- The name of the source branch of the pull request.targetRefName
- The name of the target branch of the pull request.title
- The title of the pull request.description
- The description of the pull request.isDraft
- if set to true the pull request will be in draft mode.- Returns:
- an object of git pull request
GitPullRequest
- Throws:
AzDException
- Default Api Exception handler.
-
createPullRequest
Create a pull request.- Specified by:
createPullRequest
in interfaceGitDetails
- Parameters:
gitPullRequest
- aGitPullRequest
object.- Returns:
- an object of git pull request
GitPullRequest
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequest
Retrieve a pull request.- Specified by:
getPullRequest
in interfaceGitDetails
- 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.
-
getPullRequest
public GitPullRequest getPullRequest(String repositoryName, int pullRequestId, boolean includeCommits) throws AzDException Retrieve a pull request.- Specified by:
getPullRequest
in interfaceGitDetails
- Parameters:
repositoryName
- The repository name of the pull request's target branch.pullRequestId
- The ID of the pull request to retrieve.includeCommits
- If true, the pull request will be returned with the associated commits.- Returns:
GitPullRequest
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequest
public GitPullRequest getPullRequest(String repositoryName, int pullRequestId, boolean includeCommits, boolean includeWorkItemRefs) throws AzDException Retrieve a pull request.- Specified by:
getPullRequest
in interfaceGitDetails
- Parameters:
repositoryName
- The repository name of the pull request's target branch.pullRequestId
- The ID of the pull request to retrieve.includeCommits
- If true, the pull request will be returned with the associated commits.includeWorkItemRefs
- If true, the pull request will be returned with the associated work item references.- Returns:
GitPullRequest
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestById
Retrieve a pull request.- Specified by:
getPullRequestById
in interfaceGitDetails
- Parameters:
pullRequestId
- The ID of the pull request to retrieve.- Returns:
GitPullRequest
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository name- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository nametop
- The number of pull requests to retrieve.- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository nametop
- The number of pull requests to retrieve.skip
- The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
public PullRequests getPullRequests(String repositoryName, int top, int skip, String creatorId) throws AzDException Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository nametop
- The number of pull requests to retrieve.skip
- The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.creatorId
- If set, search for pull requests that were created by this identity.- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
public PullRequests getPullRequests(String repositoryName, boolean includeLinks) throws AzDException Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository nameincludeLinks
- Whether to include the _links field on the shallow references.- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
public PullRequests getPullRequests(String repositoryName, PullRequestStatus status) throws AzDException Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository namestatus
- If set, search for pull requests that are in this state. Defaults to Active if unset.- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequests
public PullRequests getPullRequests(String repositoryName, GitPullRequestQueryParameters gitPullRequestQueryParameters) throws AzDException Retrieve all pull requests from a repository- Specified by:
getPullRequests
in interfaceGitDetails
- Parameters:
repositoryName
- specify the repository namegitPullRequestQueryParameters
- Property bag of query parameters pertaining to the pull requests.- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestsByProject
Gets all pull requests from a project. To get the pull requests from non-default project you have to call setProject method fromConnection
.- Specified by:
getPullRequestsByProject
in interfaceGitDetails
- Returns:
PullRequests
object- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestsByProject
Gets all pull requests from a project. To get the pull requests from non-default project you have to call setProject method fromConnection
.- Specified by:
getPullRequestsByProject
in interfaceGitDetails
- Parameters:
top
- The number of pull requests to retrieve.- Returns:
PullRequests
PullRequest- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestsByProject
Gets all pull requests from a project. To get the pull requests from non-default project you have to call setProject method fromConnection
.- Specified by:
getPullRequestsByProject
in interfaceGitDetails
- Parameters:
status
- If set, search for pull requests that are in this state. Defaults to Active if unset.- Returns:
PullRequests
PullRequest- Throws:
AzDException
- Default Api Exception handler.
-
updatePullRequest
public GitPullRequest updatePullRequest(String repositoryId, int pullRequestId, Object body) throws AzDException Update a pull requestThese 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.
- Specified by:
updatePullRequest
in interfaceGitDetails
- Parameters:
repositoryId
- The repository ID of the pull request's target branch.pullRequestId
- ID of the pull request to update.- Returns:
- GitPullRequest Object
GitPullRequest
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestsByProject
public PullRequests getPullRequestsByProject(int skip, int top, String creatorId, boolean includeLinks, String repositoryId, String reviewerId, String sourceRefName, String sourceRepositoryId, PullRequestStatus status, String targetRefName) throws AzDException Gets all pull requests from a project. To get the pull requests from non-default project you have to call setProject method fromConnection
.- Specified by:
getPullRequestsByProject
in interfaceGitDetails
- Parameters:
skip
- The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100.top
- The number of pull requests to retrieve.creatorId
- If set, search for pull requests that were created by this identity.includeLinks
- Whether to include the _links field on the shallow referencesrepositoryId
- If set, search for pull requests whose target branch is in this repository.reviewerId
- If set, search for pull requests that have this identity as a reviewer.sourceRefName
- If set, search for pull requests from this branch.sourceRepositoryId
- If set, search for pull requests whose source branch is in this repository.status
- If set, search for pull requests that are in this state. Defaults to Active if unset.targetRefName
- If set, search for pull requests into this branch.- Returns:
PullRequests
PullRequest- Throws:
AzDException
- Default Api Exception handler.
-
getBranch
Get a specific branch from a repository.- Specified by:
getBranch
in interfaceGitDetails
- Parameters:
repositoryName
- The name of the repository.branchName
- The name of the branch.- Returns:
- The branch as a
GitRef
object. - Throws:
AzDException
- Default Api Exception handler.
-
getBranches
Get the branches from a repository.- Specified by:
getBranches
in interfaceGitDetails
- Parameters:
repositoryName
- The name of the repository.- Returns:
- The
GitRefs
with the branches. - Throws:
AzDException
- Default Api Exception handler.
-
updateBranchLock
public GitRef updateBranchLock(String repositoryName, String branchName, boolean isLocked) throws AzDException Lock or Unlock a branch with repository name and branch name.- Specified by:
updateBranchLock
in interfaceGitDetails
- Parameters:
repositoryName
- The name or ID of the repository.branchName
- The name of the branch to lock/unlockisLocked
- true to lock the branch and false to unlock.- Returns:
- GitRef
GitRef
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestWorkItems
public ResourceRefs getPullRequestWorkItems(int pullRequestId, String repositoryName) throws AzDException Retrieve a list of work items associated with a pull request.- Specified by:
getPullRequestWorkItems
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryName
- ID or name of the repository.- Returns:
- ResourceRefs
ResourceRefs
- Throws:
AzDException
- Default Api Exception handler.
-
createPullRequestLabel
public WebApiTagDefinition createPullRequestLabel(String repositoryName, int pullRequestId, String labelName) throws AzDException Create a label for a specified pull request. The only required field is the name of the new label.- Specified by:
createPullRequestLabel
in interfaceGitDetails
- Parameters:
repositoryName
- The repository name of the pull request’s target branch.pullRequestId
- ID of the pull request.labelName
- tag/label name- Returns:
- WebApi tag object
WebApiTagDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
deletePullRequestLabel
public Void deletePullRequestLabel(String repositoryName, int pullRequestId, String labelName) throws AzDException Removes a label from the set of those assigned to the pull request.- Specified by:
deletePullRequestLabel
in interfaceGitDetails
- Parameters:
repositoryName
- The repository name of the pull request’s target branch.pullRequestId
- ID of the pull request.labelName
- tag/label name- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestLabel
public WebApiTagDefinition getPullRequestLabel(String repositoryName, int pullRequestId, String labelName) throws AzDException Retrieves a single label that has been assigned to a pull request.- Specified by:
getPullRequestLabel
in interfaceGitDetails
- Parameters:
repositoryName
- The repository name of the pull request’s target branch.pullRequestId
- ID of the pull request.labelName
- tag/label name- Returns:
- WebApi tag object
WebApiTagDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestLabels
public WebApiTagDefinitions getPullRequestLabels(String repositoryName, int pullRequestId) throws AzDException Get all the labels assigned to a pull request.- Specified by:
getPullRequestLabels
in interfaceGitDetails
- Parameters:
repositoryName
- The repository name of the pull request’s target branch.pullRequestId
- ID of the pull request.- Returns:
- List of WebApi tag object
WebApiTagDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
createPullRequestReviewer
public IdentityRefWithVote createPullRequestReviewer(int pullRequestId, String repositoryName, String reviewerId, int vote, boolean isRequired) throws AzDException Add a reviewer to a pull request or cast a vote.- Specified by:
createPullRequestReviewer
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryName
- The repository name of the pull request's target branch.reviewerId
- ID of the reviewer.vote
- Vote on a pull request: 10 - approved 5 - approved with suggestions 0 - no vote -5 - waiting for author -10 - rejectedisRequired
- Indicates if this is a required reviewer for this pull request.- Returns:
- PullRequestReviewer
IdentityRefWithVote
- Throws:
AzDException
- Default Api Exception handler.
-
deletePullRequestReviewer
public Void deletePullRequestReviewer(int pullRequestId, String repositoryName, String reviewerId) throws AzDException Remove a reviewer from a pull request.- Specified by:
deletePullRequestReviewer
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryName
- The repository name of the pull request's target branch.reviewerId
- ID of the reviewer.- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestReviewer
public IdentityRefWithVote getPullRequestReviewer(int pullRequestId, String repositoryName, String reviewerId) throws AzDException Retrieve information about a particular reviewer on a pull request- Specified by:
getPullRequestReviewer
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryName
- The repository name of the pull request's target branch.reviewerId
- ID of the reviewer.- Returns:
- PullRequestReviewer
IdentityRefWithVote
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestReviewers
public PullRequestReviewers getPullRequestReviewers(int pullRequestId, String repositoryName) throws AzDException Retrieve the reviewers for a pull request- Specified by:
getPullRequestReviewers
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryName
- The repository name of the pull request's target branch.- Returns:
- List of PullRequestReviewer
PullRequestReviewers
- Throws:
AzDException
- Default Api Exception handler.
-
updatePullRequestReviewer
public IdentityRefWithVote updatePullRequestReviewer(int pullRequestId, String repositoryName, String reviewerId, boolean isFlagged, boolean hasDeclined) throws AzDException Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined- Specified by:
updatePullRequestReviewer
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryName
- The repository name of the pull request's target branch.reviewerId
- ID of the reviewer.isFlagged
- Indicates if this reviewer is flagged for attention on this pull request.hasDeclined
- Indicates if this reviewer has declined to review this pull request.- Returns:
- PullRequestReviewer
IdentityRefWithVote
- Throws:
AzDException
- Default Api Exception handler.
-
createAnnotatedTag
public GitAnnotatedTag createAnnotatedTag(String repositoryName, String tagName, String objectId, String message) throws AzDException Create an annotated tag.- Specified by:
createAnnotatedTag
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.tagName
- The name of the annotated tag.objectId
- The objectId (Sha1Id) of the tag.message
- The tagging Message.- Returns:
- A Git annotated tag object
GitAnnotatedTag
. - Throws:
AzDException
- Default Api Exception handler.
-
getAnnotatedTag
Get an annotated tag.- Specified by:
getAnnotatedTag
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.objectId
- ObjectId (Sha1Id) of tag to get.- Returns:
- A Git annotated tag object
GitAnnotatedTag
. - Throws:
AzDException
- Default Api Exception handler.
-
getCommit
Retrieve a particular commit.- Specified by:
getCommit
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.commitId
- The id of the commit.- Returns:
- Git commit object
GitCommit
- Throws:
AzDException
- Default Api Exception handler.
-
getCommit
public GitCommit getCommit(String repositoryName, String commitId, int changeCount) throws AzDException Retrieve a particular commit.- Specified by:
getCommit
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.commitId
- The id of the commit.changeCount
- The number of changes to include in the result.- Returns:
- Git commit object
GitCommit
- Throws:
AzDException
- Default Api Exception handler.
-
getChanges
Retrieve changes for a particular commit.- Specified by:
getChanges
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.commitId
- The id of the commit.- Returns:
- Git commit changes object
GitCommitChanges
- Throws:
AzDException
- Default Api Exception handler.
-
getChanges
public GitCommitChanges getChanges(String repositoryName, String commitId, int top, int skip) throws AzDException Retrieve changes for a particular commit.- Specified by:
getChanges
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.commitId
- The id of the commit.top
- The maximum number of changes to return.skip
- The number of changes to skip.- Returns:
- Git commit changes object
GitCommitChanges
- Throws:
AzDException
- Default Api Exception handler.
-
getCommits
Retrieve git commits for a project.- Specified by:
getCommits
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.- Returns:
- Array Git commit object
GitCommits
- Throws:
AzDException
- Default Api Exception handler.
-
getCommits
Retrieve git commits for a project.- Specified by:
getCommits
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.top
- Maximum number of entries to retrieve- Returns:
- Array Git commit object
GitCommits
- Throws:
AzDException
- Default Api Exception handler.
-
getCommits
Retrieve git commits for a project.- Specified by:
getCommits
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.ids
- If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.- Returns:
- Array Git commit object
GitCommits
- Throws:
AzDException
- Default Api Exception handler.
-
getCommits
public GitCommits getCommits(String repositoryName, int top, int skip, String author, String version, GitVersionOptions versionOptions, GitVersionType versionType, boolean excludeDeletes, String fromCommitId, String toCommitId, String fromDate, String toDate, GitHistoryMode historyMode, List<String> ids, boolean includeLinks, boolean includePushData, boolean includeUserImageUrl, boolean includeWorkItems, String itemPath, boolean showOldestCommitsFirst, String user, String itemVersion, GitVersionOptions itemVersionOptions, GitVersionType itemVersionType) throws AzDException Retrieve git commits for a project.- Specified by:
getCommits
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.top
- Maximum number of entries to retrieve.skip
- Number of entries to skip.author
- Alias or display name of the author.version
- Version string identifier (name of tag/branch, SHA1 of commit).versionOptions
- Version options - Specify additional modifiers to version (e.g Previous).versionType
- Version type (branch, tag, or commit). Determines how Id is interpreted.excludeDeletes
- Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path.fromCommitId
- If provided, a lower bound for filtering commits alphabetically.toCommitId
- If provided, an upper bound for filtering commits alphabeticallyfromDate
- If provided, only include history entries created after this date (string).toDate
- If provided, only include history entries created before this date (string)historyMode
- What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified.ids
- If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.includeLinks
- Whether to include the _links field on the shallow referencesincludePushData
- Whether to include the push informationincludeUserImageUrl
- Whether to include the image Url for committers and authorsincludeWorkItems
- Whether to include linked work itemsitemPath
- Path of item to search undershowOldestCommitsFirst
- If enabled, this option will ignore the itemVersion and compareVersion parameters.user
- Alias or display name of the committeritemVersion
- Version string identifier (name of tag/branch, SHA1 of commit)itemVersionOptions
- Version options - Specify additional modifiers to version (e.g Previous)itemVersionType
- Version type (branch, tag, or commit). Determines how Id is interpreted- Returns:
- Array Git commit object
GitCommits
- Throws:
AzDException
- Default Api Exception handler.
-
getPushCommits
Retrieve a list of commits associated with a particular push.- Specified by:
getPushCommits
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.pushId
- The id of the push.- Returns:
- Array Git commit object
GitCommits
- Throws:
AzDException
- Default Api Exception handler.
-
getPushCommits
public GitCommits getPushCommits(String repositoryName, int pushId, boolean includeLinks, int top, int skip) throws AzDException Retrieve a list of commits associated with a particular push.- Specified by:
getPushCommits
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.pushId
- The id of the push.includeLinks
- Set to false to avoid including REST Url links for resources. Defaults to true.top
- The maximum number of commits to return ("get the top x commits").skip
- The number of commits to skip.- Returns:
- Array Git commit object
GitCommits
- Throws:
AzDException
- Default Api Exception handler.
-
getCommitsBatch
public GitCommitRefs getCommitsBatch(String repositoryId, GitCommitsBatch gitCommitsBatch) throws AzDException Retrieve git commits for a project matching the search criteria.- Specified by:
getCommitsBatch
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.gitCommitsBatch
- request bodyGitCommitsBatch
.- Returns:
- GitCommitRefs object
GitCommitRefs
. - Throws:
AzDException
- Default Api exception handler.
-
getRefs
Queries the provided repository for its refs and returns them.- Specified by:
getRefs
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.- Returns:
- Array Git ref object
GitRefs
- Throws:
AzDException
- Default Api Exception handler.
-
getRefs
Queries the provided repository for its refs and returns them.- Specified by:
getRefs
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.filter
- A filter to apply to the refs (starts with).- Returns:
- Array Git ref object
GitRefs
- Throws:
AzDException
- Default Api Exception handler.
-
updateRef
public GitRefUpdateResult updateRef(String repositoryName, String refName, String oldObjectId, String newObjectId) throws AzDException Creating, updating, or deleting git ref.- Specified by:
updateRef
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.refName
- The ref to create, update, or delete.oldObjectId
- The old object id of the ref.(SHA)newObjectId
- The new object id of the ref.(SHA)- Returns:
- Array Git update result object
GitRefUpdateResults
- Throws:
AzDException
- Default Api Exception handler.
-
createTag
public GitRefUpdateResult createTag(String repositoryName, String tagName, String ref) throws AzDException Creates a new tag in the repository that points to the supplied ref.- Specified by:
createTag
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.tagName
- The name of the tag.ref
- Create tag using commit SHA, another tag name, or branch name- Returns:
- Git update result object
GitRefUpdateResult
- Throws:
AzDException
- Default Api Exception handler.
-
deleteTag
Deletes a tag of a repository with given name.- Specified by:
deleteTag
in interfaceGitDetails
- Parameters:
repositoryName
- Name of the repository.tagName
- The name of the tag.- Returns:
- Array Git update result object
GitRefUpdateResults
- Throws:
AzDException
- Default Api Exception handler.
-
getBlob
Get a single blob.- Specified by:
getBlob
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.sha1
- SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.- Returns:
- GitBlobRef Object
GitBlobRef
- Throws:
AzDException
- Default Api Exception handler.
-
getBlob
public GitBlobRef getBlob(String repositoryId, String sha1, String fileName, boolean resolveLfs) throws AzDException Get a single blob.- Specified by:
getBlob
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.sha1
- SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint.fileName
- Provide a fileName to use for a download.resolveLfs
- If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types- Returns:
- GitBlobRef Object
GitBlobRef
- Throws:
AzDException
- Default Api Exception handler.
-
getBlobContent
public String getBlobContent(String repositoryId, String sha1, boolean download, String fileName, boolean resolveLfs) throws AzDException Get a single blob content.- Specified by:
getBlobContent
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.sha1
- SHA1 hash of the file. You can get the SHA1 of a file using the getItems() method.download
- If true, download the text. You can useStreamHelper
to download the file.fileName
- Provide a fileName to use for a download.resolveLfs
- If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types- Returns:
- String contents of the file.
- Throws:
AzDException
- Default Api Exception handler.
-
getBlobContentAsZip
public InputStream getBlobContentAsZip(String repositoryId, String sha1, boolean download, String fileName, boolean resolveLfs) throws AzDException Get a single blob as zip of input stream. UseStreamHelper
to download the file.- Specified by:
getBlobContentAsZip
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.sha1
- SHA1 hash of the file. You can get the SHA1 of a file using the getItems() method.download
- If true, download the text. You can useStreamHelper
to download the file.fileName
- Provide a fileName to use for a download.resolveLfs
- If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types- Returns:
- Input stream for zip download. This gets the stream of a single file.
- Throws:
AzDException
- Default Api Exception handler.
-
getBlobContentAsStream
public InputStream getBlobContentAsStream(String repositoryId, String sha1, boolean download, String fileName, boolean resolveLfs) throws AzDException Get a single blob content as input stream. UseStreamHelper
to download the file.- Specified by:
getBlobContentAsStream
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.sha1
- SHA1 hash of the file. You can get the SHA1 of a file using the getItems() method.download
- If true, download the text. You can useStreamHelper
to download the file.fileName
- Provide a fileName to use for a download.resolveLfs
- If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types- Returns:
- Input stream for zip download. This gets the stream of a single file.
- Throws:
AzDException
- Default Api Exception handler.
-
getBlobsZip
Gets one or more blobs in a zip file download.- Specified by:
getBlobsZip
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.- Throws:
AzDException
- Default Api Exception handler.
-
getBlobsZip
public InputStream getBlobsZip(String repositoryId, String fileName, List<String> sha1) throws AzDException Gets one or more blobs in a zip file download.- Specified by:
getBlobsZip
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.fileName
- Name of the file.- Throws:
AzDException
- Default Api Exception handler.
-
getItems
Get Item Metadata and/or Content for a collection of items.- Specified by:
getItems
in interfaceGitDetails
- Parameters:
repositoryName
- The name or ID of the repository.- Returns:
- GitItem Object
GitItem
- Throws:
AzDException
- Default Api Exception handler.
-
getItems
public GitItems getItems(String repositoryName, VersionControlRecursionType recursionType) throws AzDException Get Item Metadata and/or Content for a collection of items.- Specified by:
getItems
in interfaceGitDetails
- Parameters:
repositoryName
- The name or ID of the repository.recursionType
- The recursion level of this request. The default is 'none', no recursion.- Returns:
- GitItem Object
GitItem
- Throws:
AzDException
- Default Api Exception handler.
-
getItems
public GitItems getItems(String repositoryName, boolean includeContentMetadata, boolean includeLinks, boolean latestProcessedChange, VersionControlRecursionType recursionType, String scopePath) throws AzDException Get Item Metadata and/or Content for a collection of items.- Specified by:
getItems
in interfaceGitDetails
- Parameters:
repositoryName
- The name or ID of the repository.includeContentMetadata
- Set to true to include content metadata. Default is false.includeLinks
- Set to true to include links to items. Default is false.latestProcessedChange
- Set to true to include the latest changes. Default is false.recursionType
- The recursion level of this request. The default is 'none', no recursion.scopePath
- The path scope. The default is null.- Returns:
- GitItem Object
GitItem
- Throws:
AzDException
- Default Api Exception handler.
-
getItems
public GitItems getItems(String repositoryName, boolean includeContentMetadata, boolean includeLinks, boolean latestProcessedChange, VersionControlRecursionType recursionType, String scopePath, String version, GitVersionOptions versionOptions, GitVersionType versionType) throws AzDException Get Item Metadata and/or Content for a collection of items.- Specified by:
getItems
in interfaceGitDetails
- Parameters:
repositoryName
- The name or ID of the repository.includeContentMetadata
- Set to true to include content metadata. Default is false.includeLinks
- Set to true to include links to items. Default is false.latestProcessedChange
- Set to true to include the latest changes. Default is false.recursionType
- The recursion level of this request. The default is 'none', no recursion.scopePath
- The path scope. The default is null.version
- Version string identifier (name of tag/branch, SHA1 of commit)versionOptions
- Version options - Specify additional modifiers to version (e.g Previous)versionType
- Version type (branch, tag, or commit). Determines how Id is interpreted- Returns:
- GitItem Object
GitItem
- 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.- Specified by:
createForkSyncRequest
in interfaceGitDetails
- 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.- Specified by:
createForkSyncRequest
in interfaceGitDetails
- 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.- Specified by:
getForkSyncRequest
in interfaceGitDetails
- 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.- Specified by:
getForkSyncRequests
in interfaceGitDetails
- 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.
-
getForks
public GitRepositoryRefs getForks(String repositoryName, String collectionId, boolean includeLinks) throws AzDException Retrieve all forks of a repository in the collection.- Specified by:
getForks
in interfaceGitDetails
- Parameters:
repositoryName
- The name or ID of the repository.collectionId
- Team project collection ID.includeLinks
- Set to true to include links to items. Default is false.- Returns:
- GitRepositoryRefs Object
GitRepositoryRefs
- Throws:
AzDException
- Default Api Exception handler.
-
createPush
Push changes to the repository.- Specified by:
createPush
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.- Returns:
- GitPush Object
GitPush
- Throws:
AzDException
- Default Api Exception handler.
-
getPush
Retrieves a particular push.- Specified by:
getPush
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.pushId
- ID of the push.- Returns:
- GitPush Object
GitPush
- Throws:
AzDException
- Default Api Exception handler.
-
getPush
Retrieves a particular push.- Specified by:
getPush
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.pushId
- ID of the push.includeCommits
- The number of commits to include in the result.- Returns:
- GitPush Object
GitPush
- Throws:
AzDException
- Default Api Exception handler.
-
getPush
public GitPush getPush(String repositoryId, int pushId, boolean includeRefUpdates) throws AzDException Retrieves a particular push.- Specified by:
getPush
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.pushId
- ID of the push.includeRefUpdates
- If true, include the list of refs that were updated by the push.- Returns:
- GitPush Object
GitPush
- Throws:
AzDException
- Default Api Exception handler.
-
getPush
public GitPush getPush(String repositoryId, int pushId, int includeCommits, boolean includeRefUpdates) throws AzDException Retrieves a particular push.- Specified by:
getPush
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.pushId
- ID of the push.includeCommits
- The number of commits to include in the result.includeRefUpdates
- If true, include the list of refs that were updated by the push.- Returns:
- GitPush Object
GitPush
- Throws:
AzDException
- Default Api Exception handler.
-
getPushes
Retrieves pushes associated with the specified repository.- Specified by:
getPushes
in interfaceGitDetails
- Parameters:
repositoryId
- The name or ID of the repository.- Returns:
- GitPush Object
GitPush
- Throws:
AzDException
- Default Api Exception handler.
-
createPullRequestStatus
public GitStatus createPullRequestStatus(int pullRequestId, String repositoryId, 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.- Specified by:
createPullRequestStatus
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryId
- The repository ID of the pull request’s target branch.gitPullRequestStatus
- Request body to create a new pull request status.- Returns:
- GitStatus Object
GitStatus
- Throws:
AzDException
- Default Api Exception handler.
-
deletePullRequestStatus
public Void deletePullRequestStatus(int pullRequestId, String repositoryId, int statusId) throws AzDException Delete pull request status. You can remove multiple statuses in one call by using Update operation.- Specified by:
deletePullRequestStatus
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryId
- The repository ID of the pull request’s target branch.statusId
- ID of the pull request status.- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestStatus
public GitStatus getPullRequestStatus(int pullRequestId, String repositoryId, int statusId) throws AzDException Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.- Specified by:
getPullRequestStatus
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryId
- The repository ID of the pull request’s target branch.statusId
- ID of the pull request status.- Returns:
- GitStatus Object
GitStatus
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequestStatuses
public GitStatuses getPullRequestStatuses(int pullRequestId, String repositoryId) throws AzDException Get all the statuses associated with a pull request.- Specified by:
getPullRequestStatuses
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryId
- The repository ID of the pull request’s target branch.- Returns:
- GitStatuses Object
GitStatuses
- Throws:
AzDException
- Default Api Exception handler.
-
updatePullRequestStatuses
public Void updatePullRequestStatuses(int pullRequestId, String repositoryId, 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.- Specified by:
updatePullRequestStatuses
in interfaceGitDetails
- Parameters:
pullRequestId
- ID of the pull request.repositoryId
- The repository ID of the pull request’s target branch.propertiesToUpdate
- Collection of properties to update. E.g., [ { "op": "remove", "path": "/1", "from": null, "value": null }, { "op": "remove", "path": "/2", "from": null, "value": null } ]- Throws:
AzDException
- Default Api Exception handler.
-
createForkRepository
public GitRepository createForkRepository(String repositoryName, String projectId, String parentProjectId, String parentRepositoryId) throws AzDException Create a fork of a parent repository- Specified by:
createForkRepository
in interfaceGitDetails
- 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- Specified by:
createForkRepository
in interfaceGitDetails
- 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- Specified by:
createForkRepositoryWithComplete
in interfaceGitDetails
- 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.
-