// 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. */
@Immutable
public final class Control {
    /*
     * The Id of the control. e.g. "Operational Security#10"
     */
    @JsonProperty(value = "controlId", access = JsonProperty.Access.WRITE_ONLY)
    private String controlId;

    /*
     * The short name of the control. e.g. "Unsupported OS and Software."
     */
    @JsonProperty(value = "controlShortName", access = JsonProperty.Access.WRITE_ONLY)
    private String controlShortName;

    /*
     * The full name of the control. e.g. "Validate that unsupported operating systems and software components are not
     * in use."
     */
    @JsonProperty(value = "controlFullName", access = JsonProperty.Access.WRITE_ONLY)
    private String controlFullName;

    /*
     * The control type
     */
    @JsonProperty(value = "controlType", access = JsonProperty.Access.WRITE_ONLY)
    private ControlType controlType;

    /*
     * The control's description
     */
    @JsonProperty(value = "controlDescription", access = JsonProperty.Access.WRITE_ONLY)
    private String controlDescription;

    /*
     * The hyper link to the control's description'.
     */
    @JsonProperty(value = "controlDescriptionHyperLink", access = JsonProperty.Access.WRITE_ONLY)
    private String controlDescriptionHyperLink;

    /*
     * Control status.
     */
    @JsonProperty(value = "controlStatus", access = JsonProperty.Access.WRITE_ONLY)
    private ControlStatus controlStatus;

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

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

    /**
     * Get the controlId property: The Id of the control. e.g. "Operational Security#10".
     *
     * @return the controlId value.
     */
    public String controlId() {
        return this.controlId;
    }

    /**
     * Get the controlShortName property: The short name of the control. e.g. "Unsupported OS and Software.".
     *
     * @return the controlShortName value.
     */
    public String controlShortName() {
        return this.controlShortName;
    }

    /**
     * Get the controlFullName property: The full name of the control. e.g. "Validate that unsupported operating systems
     * and software components are not in use.".
     *
     * @return the controlFullName value.
     */
    public String controlFullName() {
        return this.controlFullName;
    }

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

    /**
     * Get the controlDescription property: The control's description.
     *
     * @return the controlDescription value.
     */
    public String controlDescription() {
        return this.controlDescription;
    }

    /**
     * Get the controlDescriptionHyperLink property: The hyper link to the control's description'.
     *
     * @return the controlDescriptionHyperLink value.
     */
    public String controlDescriptionHyperLink() {
        return this.controlDescriptionHyperLink;
    }

    /**
     * Get the controlStatus property: Control status.
     *
     * @return the controlStatus value.
     */
    public ControlStatus controlStatus() {
        return this.controlStatus;
    }

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

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