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

package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner;
import com.azure.resourcemanager.hdinsight.models.BillingResources;
import com.azure.resourcemanager.hdinsight.models.FilterMode;
import com.azure.resourcemanager.hdinsight.models.OSType;
import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilterV2;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class BillingResponseListResultInnerTests {
    @Test
    public void testDeserialize() {
        BillingResponseListResultInner model =
            BinaryData
                .fromString(
                    "{\"vmSizes\":[\"ofwq\",\"zqalkrmnjijpx\",\"cqqudf\",\"byxbaaabjy\"],\"vmSizesWithEncryptionAtHost\":[\"ffimrzrtuzqogsex\",\"evfdnwnwm\",\"wzsyyceuzs\",\"i\"],\"vmSizeFilters\":[{\"filterMode\":\"Recommend\",\"regions\":[\"xtrthz\"],\"clusterFlavors\":[\"tdwkqbrq\"],\"nodeTypes\":[\"axhexiilivp\"],\"clusterVersions\":[\"irqtdqoa\",\"oruzfgsquyfxrxx\"],\"osType\":[\"Windows\",\"Linux\"],\"vmSizes\":[\"xje\",\"wlwnwxuqlcv\"],\"espApplied\":\"ypatdooaojkniod\",\"computeIsolationSupported\":\"oebwnujhemms\"}],\"vmSizeProperties\":[{\"name\":\"c\",\"cores\":1751076005,\"dataDiskStorageTier\":\"jinfw\",\"label\":\"fltkacjv\",\"maxDataDiskCount\":6490344131392989957,\"memoryInMb\":6193547240906523394,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":false,\"virtualMachineResourceDiskSizeInMb\":2710412149295788675,\"webWorkerResourceDiskSizeInMb\":9061986906029534156},{\"name\":\"wpu\",\"cores\":593695187,\"dataDiskStorageTier\":\"lyls\",\"label\":\"k\",\"maxDataDiskCount\":2784365804369972582,\"memoryInMb\":1128791944810811868,\"supportedByVirtualMachines\":false,\"supportedByWebWorkerRoles\":true,\"virtualMachineResourceDiskSizeInMb\":2466892292618671362,\"webWorkerResourceDiskSizeInMb\":1824695374727321161}],\"billingResources\":[{\"region\":\"psbzkfzbeyvpn\",\"billingMeters\":[],\"diskBillingMeters\":[]}]}")
                .toObject(BillingResponseListResultInner.class);
        Assertions.assertEquals("ofwq", model.vmSizes().get(0));
        Assertions.assertEquals("ffimrzrtuzqogsex", model.vmSizesWithEncryptionAtHost().get(0));
        Assertions.assertEquals(FilterMode.RECOMMEND, model.vmSizeFilters().get(0).filterMode());
        Assertions.assertEquals("xtrthz", model.vmSizeFilters().get(0).regions().get(0));
        Assertions.assertEquals("tdwkqbrq", model.vmSizeFilters().get(0).clusterFlavors().get(0));
        Assertions.assertEquals("axhexiilivp", model.vmSizeFilters().get(0).nodeTypes().get(0));
        Assertions.assertEquals("irqtdqoa", model.vmSizeFilters().get(0).clusterVersions().get(0));
        Assertions.assertEquals(OSType.WINDOWS, model.vmSizeFilters().get(0).osType().get(0));
        Assertions.assertEquals("xje", model.vmSizeFilters().get(0).vmSizes().get(0));
        Assertions.assertEquals("ypatdooaojkniod", model.vmSizeFilters().get(0).espApplied());
        Assertions.assertEquals("oebwnujhemms", model.vmSizeFilters().get(0).computeIsolationSupported());
        Assertions.assertEquals("psbzkfzbeyvpn", model.billingResources().get(0).region());
    }

    @Test
    public void testSerialize() {
        BillingResponseListResultInner model =
            new BillingResponseListResultInner()
                .withVmSizes(Arrays.asList("ofwq", "zqalkrmnjijpx", "cqqudf", "byxbaaabjy"))
                .withVmSizesWithEncryptionAtHost(Arrays.asList("ffimrzrtuzqogsex", "evfdnwnwm", "wzsyyceuzs", "i"))
                .withVmSizeFilters(
                    Arrays
                        .asList(
                            new VmSizeCompatibilityFilterV2()
                                .withFilterMode(FilterMode.RECOMMEND)
                                .withRegions(Arrays.asList("xtrthz"))
                                .withClusterFlavors(Arrays.asList("tdwkqbrq"))
                                .withNodeTypes(Arrays.asList("axhexiilivp"))
                                .withClusterVersions(Arrays.asList("irqtdqoa", "oruzfgsquyfxrxx"))
                                .withOsType(Arrays.asList(OSType.WINDOWS, OSType.LINUX))
                                .withVmSizes(Arrays.asList("xje", "wlwnwxuqlcv"))
                                .withEspApplied("ypatdooaojkniod")
                                .withComputeIsolationSupported("oebwnujhemms")))
                .withBillingResources(
                    Arrays
                        .asList(
                            new BillingResources()
                                .withRegion("psbzkfzbeyvpn")
                                .withBillingMeters(Arrays.asList())
                                .withDiskBillingMeters(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(BillingResponseListResultInner.class);
        Assertions.assertEquals("ofwq", model.vmSizes().get(0));
        Assertions.assertEquals("ffimrzrtuzqogsex", model.vmSizesWithEncryptionAtHost().get(0));
        Assertions.assertEquals(FilterMode.RECOMMEND, model.vmSizeFilters().get(0).filterMode());
        Assertions.assertEquals("xtrthz", model.vmSizeFilters().get(0).regions().get(0));
        Assertions.assertEquals("tdwkqbrq", model.vmSizeFilters().get(0).clusterFlavors().get(0));
        Assertions.assertEquals("axhexiilivp", model.vmSizeFilters().get(0).nodeTypes().get(0));
        Assertions.assertEquals("irqtdqoa", model.vmSizeFilters().get(0).clusterVersions().get(0));
        Assertions.assertEquals(OSType.WINDOWS, model.vmSizeFilters().get(0).osType().get(0));
        Assertions.assertEquals("xje", model.vmSizeFilters().get(0).vmSizes().get(0));
        Assertions.assertEquals("ypatdooaojkniod", model.vmSizeFilters().get(0).espApplied());
        Assertions.assertEquals("oebwnujhemms", model.vmSizeFilters().get(0).computeIsolationSupported());
        Assertions.assertEquals("psbzkfzbeyvpn", model.billingResources().get(0).region());
    }
}
