// 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.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** The IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem model. */
@Fluent
public final class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem {
    /*
     * Aggregation of IoT Security solution device alert metrics by date.
     */
    @JsonProperty(value = "date")
    private OffsetDateTime date;

    /*
     * Device alert count by severity.
     */
    @JsonProperty(value = "devicesMetrics")
    private IoTSeverityMetrics devicesMetrics;

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

    /**
     * Get the date property: Aggregation of IoT Security solution device alert metrics by date.
     *
     * @return the date value.
     */
    public OffsetDateTime date() {
        return this.date;
    }

    /**
     * Set the date property: Aggregation of IoT Security solution device alert metrics by date.
     *
     * @param date the date value to set.
     * @return the IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem object itself.
     */
    public IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem withDate(OffsetDateTime date) {
        this.date = date;
        return this;
    }

    /**
     * Get the devicesMetrics property: Device alert count by severity.
     *
     * @return the devicesMetrics value.
     */
    public IoTSeverityMetrics devicesMetrics() {
        return this.devicesMetrics;
    }

    /**
     * Set the devicesMetrics property: Device alert count by severity.
     *
     * @param devicesMetrics the devicesMetrics value to set.
     * @return the IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem object itself.
     */
    public IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem withDevicesMetrics(
        IoTSeverityMetrics devicesMetrics) {
        this.devicesMetrics = devicesMetrics;
        return this;
    }

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