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

package com.azure.resourcemanager.appcomplianceautomation.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** A class represent the assessment. */
@Immutable
public final class Assessment {
    /*
     * The name of the assessment.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The severity level of this assessment.
     */
    @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY)
    private AssessmentSeverity severity;

    /*
     * The description of the assessment.
     */
    @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY)
    private String description;

    /*
     * The remediation of the assessment.
     */
    @JsonProperty(value = "remediation", access = JsonProperty.Access.WRITE_ONLY)
    private String remediation;

    /*
     * Indicates whether all the resource(s) are compliant.
     */
    @JsonProperty(value = "isPass", access = JsonProperty.Access.WRITE_ONLY)
    private IsPass isPass;

    /*
     * The policy id mapping to this assessment.
     */
    @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY)
    private String policyId;

    /*
     * List of resource assessments.
     */
    @JsonProperty(value = "resourceList", access = JsonProperty.Access.WRITE_ONLY)
    private List<AssessmentResource> resourceList;

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

    /**
     * Get the name property: The name of the assessment.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the severity property: The severity level of this assessment.
     *
     * @return the severity value.
     */
    public AssessmentSeverity severity() {
        return this.severity;
    }

    /**
     * Get the description property: The description of the assessment.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Get the remediation property: The remediation of the assessment.
     *
     * @return the remediation value.
     */
    public String remediation() {
        return this.remediation;
    }

    /**
     * Get the isPass property: Indicates whether all the resource(s) are compliant.
     *
     * @return the isPass value.
     */
    public IsPass isPass() {
        return this.isPass;
    }

    /**
     * Get the policyId property: The policy id mapping to this assessment.
     *
     * @return the policyId value.
     */
    public String policyId() {
        return this.policyId;
    }

    /**
     * Get the resourceList property: List of resource assessments.
     *
     * @return the resourceList value.
     */
    public List<AssessmentResource> resourceList() {
        return this.resourceList;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (resourceList() != null) {
            resourceList().forEach(e -> e.validate());
        }
    }
}
