// 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 compliance result. */
@Immutable
public final class ComplianceResult {
    /*
     * The name of the compliance. e.g. "M365"
     */
    @JsonProperty(value = "complianceName", access = JsonProperty.Access.WRITE_ONLY)
    private String complianceName;

    /*
     * List of categories.
     */
    @JsonProperty(value = "categories", access = JsonProperty.Access.WRITE_ONLY)
    private List<Category> categories;

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

    /**
     * Get the complianceName property: The name of the compliance. e.g. "M365".
     *
     * @return the complianceName value.
     */
    public String complianceName() {
        return this.complianceName;
    }

    /**
     * Get the categories property: List of categories.
     *
     * @return the categories value.
     */
    public List<Category> categories() {
        return this.categories;
    }

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