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

package com.azure.resourcemanager.security.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice;
import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert;
import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation;
import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem;
import com.azure.resourcemanager.security.models.IoTSeverityMetrics;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Security analytics properties of your IoT Security solution. */
@Fluent
public final class IoTSecuritySolutionAnalyticsModelProperties {
    /*
     * Security analytics of your IoT Security solution.
     */
    @JsonProperty(value = "metrics", access = JsonProperty.Access.WRITE_ONLY)
    private IoTSeverityMetrics metrics;

    /*
     * Number of unhealthy devices within your IoT Security solution.
     */
    @JsonProperty(value = "unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY)
    private Long unhealthyDeviceCount;

    /*
     * List of device metrics by the aggregation date.
     */
    @JsonProperty(value = "devicesMetrics", access = JsonProperty.Access.WRITE_ONLY)
    private List<IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem> devicesMetrics;

    /*
     * List of the 3 devices with the most alerts.
     */
    @JsonProperty(value = "topAlertedDevices")
    private List<IoTSecurityAlertedDevice> topAlertedDevices;

    /*
     * List of the 3 most prevalent device alerts.
     */
    @JsonProperty(value = "mostPrevalentDeviceAlerts")
    private List<IoTSecurityDeviceAlert> mostPrevalentDeviceAlerts;

    /*
     * List of the 3 most prevalent device recommendations.
     */
    @JsonProperty(value = "mostPrevalentDeviceRecommendations")
    private List<IoTSecurityDeviceRecommendation> mostPrevalentDeviceRecommendations;

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

    /**
     * Get the metrics property: Security analytics of your IoT Security solution.
     *
     * @return the metrics value.
     */
    public IoTSeverityMetrics metrics() {
        return this.metrics;
    }

    /**
     * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution.
     *
     * @return the unhealthyDeviceCount value.
     */
    public Long unhealthyDeviceCount() {
        return this.unhealthyDeviceCount;
    }

    /**
     * Get the devicesMetrics property: List of device metrics by the aggregation date.
     *
     * @return the devicesMetrics value.
     */
    public List<IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem> devicesMetrics() {
        return this.devicesMetrics;
    }

    /**
     * Get the topAlertedDevices property: List of the 3 devices with the most alerts.
     *
     * @return the topAlertedDevices value.
     */
    public List<IoTSecurityAlertedDevice> topAlertedDevices() {
        return this.topAlertedDevices;
    }

    /**
     * Set the topAlertedDevices property: List of the 3 devices with the most alerts.
     *
     * @param topAlertedDevices the topAlertedDevices value to set.
     * @return the IoTSecuritySolutionAnalyticsModelProperties object itself.
     */
    public IoTSecuritySolutionAnalyticsModelProperties withTopAlertedDevices(
        List<IoTSecurityAlertedDevice> topAlertedDevices) {
        this.topAlertedDevices = topAlertedDevices;
        return this;
    }

    /**
     * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts.
     *
     * @return the mostPrevalentDeviceAlerts value.
     */
    public List<IoTSecurityDeviceAlert> mostPrevalentDeviceAlerts() {
        return this.mostPrevalentDeviceAlerts;
    }

    /**
     * Set the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts.
     *
     * @param mostPrevalentDeviceAlerts the mostPrevalentDeviceAlerts value to set.
     * @return the IoTSecuritySolutionAnalyticsModelProperties object itself.
     */
    public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceAlerts(
        List<IoTSecurityDeviceAlert> mostPrevalentDeviceAlerts) {
        this.mostPrevalentDeviceAlerts = mostPrevalentDeviceAlerts;
        return this;
    }

    /**
     * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations.
     *
     * @return the mostPrevalentDeviceRecommendations value.
     */
    public List<IoTSecurityDeviceRecommendation> mostPrevalentDeviceRecommendations() {
        return this.mostPrevalentDeviceRecommendations;
    }

    /**
     * Set the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations.
     *
     * @param mostPrevalentDeviceRecommendations the mostPrevalentDeviceRecommendations value to set.
     * @return the IoTSecuritySolutionAnalyticsModelProperties object itself.
     */
    public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceRecommendations(
        List<IoTSecurityDeviceRecommendation> mostPrevalentDeviceRecommendations) {
        this.mostPrevalentDeviceRecommendations = mostPrevalentDeviceRecommendations;
        return this;
    }

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