// 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 control family. */
@Immutable
public final class ControlFamily {
    /*
     * The name of the control family. e.g. "Malware Protection - Anti-Virus"
     */
    @JsonProperty(value = "familyName", access = JsonProperty.Access.WRITE_ONLY)
    private String familyName;

    /*
     * The control family type
     */
    @JsonProperty(value = "familyType", access = JsonProperty.Access.WRITE_ONLY)
    private ControlFamilyType familyType;

    /*
     * Control family status.
     */
    @JsonProperty(value = "familyStatus", access = JsonProperty.Access.WRITE_ONLY)
    private ControlFamilyStatus familyStatus;

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

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

    /**
     * Get the familyName property: The name of the control family. e.g. "Malware Protection - Anti-Virus".
     *
     * @return the familyName value.
     */
    public String familyName() {
        return this.familyName;
    }

    /**
     * Get the familyType property: The control family type.
     *
     * @return the familyType value.
     */
    public ControlFamilyType familyType() {
        return this.familyType;
    }

    /**
     * Get the familyStatus property: Control family status.
     *
     * @return the familyStatus value.
     */
    public ControlFamilyStatus familyStatus() {
        return this.familyStatus;
    }

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

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