Package org.azd.git.pullrequest
Class PullRequestStatusRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.git.pullrequest.PullRequestStatusRequestBuilder
Request builder to manage pull request statuses Api.
-
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
ConstructorDescriptionPullRequestStatusRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptionCreate a pull request status.createAsync
(String repositoryId, int pullRequestId, GitStatus gitPullRequestStatus) Create a pull request status.Delete pull request status.deleteAsync
(String repositoryId, int pullRequestId, int statusId) Delete pull request status.Get the specific pull request status by ID.Get the specific pull request status by ID.Get all the statuses associated with a pull request.Get all the statuses associated with a pull request.update
(String repositoryId, int pullRequestId, List<JsonPatchDocument> propertiesToUpdate) Update pull request statuses collection.updateAsync
(String repositoryId, int pullRequestId, List<JsonPatchDocument> propertiesToUpdate) Update pull request statuses collection.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
PullRequestStatusRequestBuilder
public PullRequestStatusRequestBuilder(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<GitStatus> createAsync(String repositoryId, int pullRequestId, 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.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.gitPullRequestStatus
- Request body to create a new pull request status.- Returns:
- GitStatus Object
GitStatus
- Throws:
AzDException
- Default Api Exception handler.
-
deleteAsync
public CompletableFuture<Void> deleteAsync(String repositoryId, int pullRequestId, int statusId) throws AzDException Delete pull request status. You can remove multiple statuses in one call by using Update operation.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.statusId
- ID of the pull request status.- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
public CompletableFuture<GitStatus> getAsync(String repositoryId, int pullRequestId, int statusId) throws AzDException Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.statusId
- ID of the pull request status.- Returns:
- GitStatus Object
GitStatus
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
public CompletableFuture<GitStatuses> listAsync(String repositoryId, int pullRequestId) throws AzDException Get all the statuses associated with a pull request.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.- Returns:
- GitStatuses Object
GitStatuses
- Throws:
AzDException
- Default Api Exception handler.
-
updateAsync
public CompletableFuture<Void> updateAsync(String repositoryId, int pullRequestId, 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.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.propertiesToUpdate
- Collection of properties to update.[ { "op": "remove", "path": "/1", "from": null, "value": null }, { "op": "remove", "path": "/2", "from": null, "value": null } ]
- Throws:
AzDException
- Default Api Exception handler.
-
create
public GitStatus create(String repositoryId, int pullRequestId, 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.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.gitPullRequestStatus
- Request body to create a new pull request status.- Returns:
- GitStatus Object
GitStatus
- Throws:
AzDException
- Default Api Exception handler.
-
delete
Delete pull request status. You can remove multiple statuses in one call by using Update operation.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.statusId
- ID of the pull request status.- Throws:
AzDException
- Default Api Exception handler.
-
get
Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.statusId
- ID of the pull request status.- Returns:
- GitStatus Object
GitStatus
- Throws:
AzDException
- Default Api Exception handler.
-
list
Get all the statuses associated with a pull request.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.- Returns:
- GitStatuses Object
GitStatuses
- Throws:
AzDException
- Default Api Exception handler.
-
update
public Void update(String repositoryId, int pullRequestId, 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.- Parameters:
repositoryId
- The repository ID of the pull request’s target branch.pullRequestId
- ID of the pull request.propertiesToUpdate
- Collection of properties to update.[ { "op": "remove", "path": "/1", "from": null, "value": null }, { "op": "remove", "path": "/2", "from": null, "value": null } ]
- Throws:
AzDException
- Default Api Exception handler.
-