// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.policyinsights.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The result of a non-compliant policy evaluation against the given resource content. */
@Immutable
public final class PolicyEvaluationResult {
    /*
     * The details of the policy that was evaluated.
     */
    @JsonProperty(value = "policyInfo", access = JsonProperty.Access.WRITE_ONLY)
    private PolicyReference policyInfo;

    /*
     * The result of the policy evaluation against the resource. This will typically be 'NonCompliant' but may contain
     * other values if errors were encountered.
     */
    @JsonProperty(value = "evaluationResult", access = JsonProperty.Access.WRITE_ONLY)
    private String evaluationResult;

    /*
     * The detailed results of the policy expressions and values that were evaluated.
     */
    @JsonProperty(value = "evaluationDetails", access = JsonProperty.Access.WRITE_ONLY)
    private PolicyEvaluationDetails evaluationDetails;

    /** Creates an instance of PolicyEvaluationResult class. */
    public PolicyEvaluationResult() {
    }

    /**
     * Get the policyInfo property: The details of the policy that was evaluated.
     *
     * @return the policyInfo value.
     */
    public PolicyReference policyInfo() {
        return this.policyInfo;
    }

    /**
     * Get the evaluationResult property: The result of the policy evaluation against the resource. This will typically
     * be 'NonCompliant' but may contain other values if errors were encountered.
     *
     * @return the evaluationResult value.
     */
    public String evaluationResult() {
        return this.evaluationResult;
    }

    /**
     * Get the evaluationDetails property: The detailed results of the policy expressions and values that were
     * evaluated.
     *
     * @return the evaluationDetails value.
     */
    public PolicyEvaluationDetails evaluationDetails() {
        return this.evaluationDetails;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (policyInfo() != null) {
            policyInfo().validate();
        }
        if (evaluationDetails() != null) {
            evaluationDetails().validate();
        }
    }
}
