Class EvaluationsRequestBuilder

java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.policy.evaluations.EvaluationsRequestBuilder

public class EvaluationsRequestBuilder extends BaseRequestBuilder
Provides functionality to work with Policy Evaluations Api.
  • Constructor Details

    • EvaluationsRequestBuilder

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

    • getAsync

      public CompletableFuture<PolicyEvaluationRecord> getAsync(String evaluationId) throws AzDException
      Gets the present evaluation state of a policy.


      Each policy which applies to a pull request will have an evaluation state which is specific to that policy running in the context of that pull request. Each evaluation is uniquely identified via a Guid. You can find all the policy evaluations for a specific pull request using the List operation of this controller.

      Parameters:
      evaluationId - ID of the policy evaluation to be retrieved.
      Returns:
      PolicyEvaluationRecord Object PolicyEvaluationRecord
      Throws:
      AzDException - Default Api Exception handler.
    • listAsync

      Retrieves a list of all the policy evaluation statuses for a specific pull request.


      Evaluations are retrieved using an artifact ID which uniquely identifies the pull request. To generate an artifact ID for a pull request, use this template:

      
       vstfs:///CodeReview/CodeReviewId/{projectId}/{pullRequestId}
       
      Parameters:
      requestConfiguration - Represents the query parameters.
      Returns:
      Collection of evaluation records PolicyEvaluationRecords
      Throws:
      AzDException - Default Api Exception handler.
    • requeueAsync

      public CompletableFuture<PolicyEvaluationRecord> requeueAsync(String evaluationId) throws AzDException
      Requeue the policy evaluation.


      Some policies define a "requeue" action which performs some policy-specific operation. You can trigger this operation by updating an existing policy evaluation and setting the PolicyEvaluationRecord.Status field to Queued. Although any policy evaluation can be requeued, at present only build policies perform any action in response. Requeueing a build policy will queue a new build to run (cancelling any existing build which is running).

      Parameters:
      evaluationId - ID of the policy evaluation to be retrieved.
      Returns:
      PolicyEvaluationRecord Object PolicyEvaluationRecord
      Throws:
      AzDException - Default Api Exception handler.
    • get

      public PolicyEvaluationRecord get(String evaluationId) throws AzDException
      Gets the present evaluation state of a policy.


      Each policy which applies to a pull request will have an evaluation state which is specific to that policy running in the context of that pull request. Each evaluation is uniquely identified via a Guid. You can find all the policy evaluations for a specific pull request using the List operation of this controller.

      Parameters:
      evaluationId - ID of the policy evaluation to be retrieved.
      Returns:
      PolicyEvaluationRecord Object PolicyEvaluationRecord
      Throws:
      AzDException - Default Api Exception handler.
    • list

      Retrieves a list of all the policy evaluation statuses for a specific pull request.


      Evaluations are retrieved using an artifact ID which uniquely identifies the pull request. To generate an artifact ID for a pull request, use this template:

      
       vstfs:///CodeReview/CodeReviewId/{projectId}/{pullRequestId}
       
      Parameters:
      requestConfiguration - Represents the query parameters.
      Returns:
      Collection of evaluation records PolicyEvaluationRecords
      Throws:
      AzDException - Default Api Exception handler.
    • requeue

      public PolicyEvaluationRecord requeue(String evaluationId) throws AzDException
      Requeue the policy evaluation.


      Some policies define a "requeue" action which performs some policy-specific operation. You can trigger this operation by updating an existing policy evaluation and setting the PolicyEvaluationRecord.Status field to Queued. Although any policy evaluation can be requeued, at present only build policies perform any action in response. Requeueing a build policy will queue a new build to run (cancelling any existing build which is running).

      Parameters:
      evaluationId - ID of the policy evaluation to be retrieved.
      Returns:
      PolicyEvaluationRecord Object PolicyEvaluationRecord
      Throws:
      AzDException - Default Api Exception handler.