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

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner;
import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice;
import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert;
import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation;
import java.util.Arrays;

public final class IoTSecuritySolutionAnalyticsModelInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IoTSecuritySolutionAnalyticsModelInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"metrics\":{\"high\":4021445942662392747,\"medium\":4294667967107007677,\"low\":7036117632331754318},\"unhealthyDeviceCount\":2795086805451114111,\"devicesMetrics\":[{\"date\":\"2021-06-07T11:11Z\"}],\"topAlertedDevices\":[{\"deviceId\":\"lbbovplw\",\"alertsCount\":3734794049628665607},{\"deviceId\":\"yuguosvmkfssx\",\"alertsCount\":5126500575476383860},{\"deviceId\":\"plgmgsxnk\",\"alertsCount\":2541322280404196409}],\"mostPrevalentDeviceAlerts\":[{\"alertDisplayName\":\"pvlopwiyighxpkd\",\"reportedSeverity\":\"Medium\",\"alertsCount\":1775218219583343661},{\"alertDisplayName\":\"bbaumnyquped\",\"reportedSeverity\":\"Informational\",\"alertsCount\":533974290165093237}],\"mostPrevalentDeviceRecommendations\":[{\"recommendationDisplayName\":\"smtxpsieb\",\"reportedSeverity\":\"High\",\"devicesCount\":6627631118472357246},{\"recommendationDisplayName\":\"apskrdqm\",\"reportedSeverity\":\"Medium\",\"devicesCount\":6206046747227637327},{\"recommendationDisplayName\":\"dwkyzxuu\",\"reportedSeverity\":\"High\",\"devicesCount\":1186103723197260996}]},\"id\":\"cwsvlxotog\",\"name\":\"wrupqsxvnmicykvc\",\"type\":\"o\"}")
                .toObject(IoTSecuritySolutionAnalyticsModelInner.class);
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IoTSecuritySolutionAnalyticsModelInner model =
            new IoTSecuritySolutionAnalyticsModelInner()
                .withTopAlertedDevices(
                    Arrays
                        .asList(
                            new IoTSecurityAlertedDevice(),
                            new IoTSecurityAlertedDevice(),
                            new IoTSecurityAlertedDevice()))
                .withMostPrevalentDeviceAlerts(
                    Arrays.asList(new IoTSecurityDeviceAlert(), new IoTSecurityDeviceAlert()))
                .withMostPrevalentDeviceRecommendations(
                    Arrays
                        .asList(
                            new IoTSecurityDeviceRecommendation(),
                            new IoTSecurityDeviceRecommendation(),
                            new IoTSecurityDeviceRecommendation()));
        model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelInner.class);
    }
}
