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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.PrivateCloudInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.PrivateCloudList;
import com.azure.resourcemanager.vmwarecloudsimple.models.PrivateCloudResourceType;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class PrivateCloudListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateCloudList model =
            BinaryData
                .fromString(
                    "{\"nextLink\":\"wska\",\"value\":[{\"id\":\"zlcuiywgqywgndrv\",\"location\":\"hzgpphrcgyncocpe\",\"name\":\"vmmcoofs\",\"properties\":{\"availabilityZoneId\":\"evgbmqjq\",\"availabilityZoneName\":\"c\",\"clustersNumber\":591177451,\"createdBy\":\"vkwlzuvccfwnf\",\"createdOn\":\"2021-06-18T14:17:09Z\",\"dnsServers\":[],\"expires\":\"ionle\",\"nsxType\":\"etqgtzxdpnq\",\"placementGroupId\":\"qwxrjfeallnw\",\"placementGroupName\":\"bisnja\",\"privateCloudId\":\"9108d465-8d80-4752-82db-543b4be91369\",\"resourcePools\":[],\"state\":\"gnzscxaqwo\",\"totalCpuCores\":1004687873,\"totalNodes\":1989312604,\"totalRam\":999666517,\"totalStorage\":16.790741,\"type\":\"kvlrxnj\",\"vSphereVersion\":\"seiphe\",\"vcenterFqdn\":\"lokeyy\",\"vcenterRefid\":\"nj\",\"virtualMachineTemplates\":[],\"virtualNetworks\":[],\"vrOpsEnabled\":true},\"type\":\"Microsoft.VMwareCloudSimple/privateClouds\"},{\"id\":\"pdjpjumasxazjp\",\"location\":\"e\",\"name\":\"alhbx\",\"properties\":{\"availabilityZoneId\":\"jj\",\"availabilityZoneName\":\"v\",\"clustersNumber\":303390013,\"createdBy\":\"wdslfhotwmcy\",\"createdOn\":\"2021-07-29T20:13:33Z\",\"dnsServers\":[],\"expires\":\"jnpg\",\"nsxType\":\"ftadehxnltyfs\",\"placementGroupId\":\"pusuesn\",\"placementGroupName\":\"dejbavo\",\"privateCloudId\":\"b5efea1e-2922-45d1-b0c9-f68321fc75c7\",\"resourcePools\":[],\"state\":\"mohctb\",\"totalCpuCores\":1529084406,\"totalNodes\":1727666858,\"totalRam\":1758852414,\"totalStorage\":34.753197,\"type\":\"vo\",\"vSphereVersion\":\"ujjugwdkcglh\",\"vcenterFqdn\":\"azjdyggd\",\"vcenterRefid\":\"ixhbkuofqweykhm\",\"virtualMachineTemplates\":[],\"virtualNetworks\":[],\"vrOpsEnabled\":false},\"type\":\"Microsoft.VMwareCloudSimple/privateClouds\"},{\"id\":\"fwhybcibvy\",\"location\":\"c\",\"name\":\"tynnaamdectehfi\",\"properties\":{\"availabilityZoneId\":\"jeyp\",\"availabilityZoneName\":\"ezrkgqhcjrefo\",\"clustersNumber\":34828913,\"createdBy\":\"qsl\",\"createdOn\":\"2021-08-20T18:32:02Z\",\"dnsServers\":[],\"expires\":\"yqjpkcatt\",\"nsxType\":\"gjcrcczsqpjhvm\",\"placementGroupId\":\"jvnysounqe\",\"placementGroupName\":\"noae\",\"privateCloudId\":\"f3d0f493-2903-4a3b-928b-13b09712de9c\",\"resourcePools\":[],\"state\":\"yhltrpmopjmcm\",\"totalCpuCores\":61877127,\"totalNodes\":1605990961,\"totalRam\":607140678,\"totalStorage\":98.63335,\"type\":\"uaodsfcpk\",\"vSphereVersion\":\"odpuozmyzydag\",\"vcenterFqdn\":\"axbezyiuo\",\"vcenterRefid\":\"twhrdxwzywqsm\",\"virtualMachineTemplates\":[],\"virtualNetworks\":[],\"vrOpsEnabled\":false},\"type\":\"Microsoft.VMwareCloudSimple/privateClouds\"}]}")
                .toObject(PrivateCloudList.class);
        Assertions.assertEquals("wska", model.nextLink());
        Assertions.assertEquals("zlcuiywgqywgndrv", model.value().get(0).id());
        Assertions.assertEquals("hzgpphrcgyncocpe", model.value().get(0).location());
        Assertions.assertEquals("vmmcoofs", model.value().get(0).name());
        Assertions
            .assertEquals(
                PrivateCloudResourceType.MICROSOFT_VMWARE_CLOUD_SIMPLE_PRIVATE_CLOUDS, model.value().get(0).type());
        Assertions.assertEquals("evgbmqjq", model.value().get(0).availabilityZoneId());
        Assertions.assertEquals("c", model.value().get(0).availabilityZoneName());
        Assertions.assertEquals(591177451, model.value().get(0).clustersNumber());
        Assertions.assertEquals("vkwlzuvccfwnf", model.value().get(0).createdBy());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T14:17:09Z"), model.value().get(0).createdOn());
        Assertions.assertEquals("ionle", model.value().get(0).expires());
        Assertions.assertEquals("etqgtzxdpnq", model.value().get(0).nsxType());
        Assertions.assertEquals("qwxrjfeallnw", model.value().get(0).placementGroupId());
        Assertions.assertEquals("bisnja", model.value().get(0).placementGroupName());
        Assertions
            .assertEquals(
                UUID.fromString("9108d465-8d80-4752-82db-543b4be91369"), model.value().get(0).privateCloudId());
        Assertions.assertEquals("gnzscxaqwo", model.value().get(0).state());
        Assertions.assertEquals(1004687873, model.value().get(0).totalCpuCores());
        Assertions.assertEquals(1989312604, model.value().get(0).totalNodes());
        Assertions.assertEquals(999666517, model.value().get(0).totalRam());
        Assertions.assertEquals(16.790741F, model.value().get(0).totalStorage());
        Assertions.assertEquals("kvlrxnj", model.value().get(0).typePropertiesType());
        Assertions.assertEquals("seiphe", model.value().get(0).vSphereVersion());
        Assertions.assertEquals("lokeyy", model.value().get(0).vcenterFqdn());
        Assertions.assertEquals("nj", model.value().get(0).vcenterRefid());
        Assertions.assertEquals(true, model.value().get(0).vrOpsEnabled());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateCloudList model =
            new PrivateCloudList()
                .withNextLink("wska")
                .withValue(
                    Arrays
                        .asList(
                            new PrivateCloudInner()
                                .withId("zlcuiywgqywgndrv")
                                .withLocation("hzgpphrcgyncocpe")
                                .withName("vmmcoofs")
                                .withType(PrivateCloudResourceType.MICROSOFT_VMWARE_CLOUD_SIMPLE_PRIVATE_CLOUDS)
                                .withAvailabilityZoneId("evgbmqjq")
                                .withAvailabilityZoneName("c")
                                .withClustersNumber(591177451)
                                .withCreatedBy("vkwlzuvccfwnf")
                                .withCreatedOn(OffsetDateTime.parse("2021-06-18T14:17:09Z"))
                                .withDnsServers(Arrays.asList())
                                .withExpires("ionle")
                                .withNsxType("etqgtzxdpnq")
                                .withPlacementGroupId("qwxrjfeallnw")
                                .withPlacementGroupName("bisnja")
                                .withPrivateCloudId(UUID.fromString("9108d465-8d80-4752-82db-543b4be91369"))
                                .withResourcePools(Arrays.asList())
                                .withState("gnzscxaqwo")
                                .withTotalCpuCores(1004687873)
                                .withTotalNodes(1989312604)
                                .withTotalRam(999666517)
                                .withTotalStorage(16.790741F)
                                .withTypePropertiesType("kvlrxnj")
                                .withVSphereVersion("seiphe")
                                .withVcenterFqdn("lokeyy")
                                .withVcenterRefid("nj")
                                .withVirtualMachineTemplates(Arrays.asList())
                                .withVirtualNetworks(Arrays.asList())
                                .withVrOpsEnabled(true),
                            new PrivateCloudInner()
                                .withId("pdjpjumasxazjp")
                                .withLocation("e")
                                .withName("alhbx")
                                .withType(PrivateCloudResourceType.MICROSOFT_VMWARE_CLOUD_SIMPLE_PRIVATE_CLOUDS)
                                .withAvailabilityZoneId("jj")
                                .withAvailabilityZoneName("v")
                                .withClustersNumber(303390013)
                                .withCreatedBy("wdslfhotwmcy")
                                .withCreatedOn(OffsetDateTime.parse("2021-07-29T20:13:33Z"))
                                .withDnsServers(Arrays.asList())
                                .withExpires("jnpg")
                                .withNsxType("ftadehxnltyfs")
                                .withPlacementGroupId("pusuesn")
                                .withPlacementGroupName("dejbavo")
                                .withPrivateCloudId(UUID.fromString("b5efea1e-2922-45d1-b0c9-f68321fc75c7"))
                                .withResourcePools(Arrays.asList())
                                .withState("mohctb")
                                .withTotalCpuCores(1529084406)
                                .withTotalNodes(1727666858)
                                .withTotalRam(1758852414)
                                .withTotalStorage(34.753197F)
                                .withTypePropertiesType("vo")
                                .withVSphereVersion("ujjugwdkcglh")
                                .withVcenterFqdn("azjdyggd")
                                .withVcenterRefid("ixhbkuofqweykhm")
                                .withVirtualMachineTemplates(Arrays.asList())
                                .withVirtualNetworks(Arrays.asList())
                                .withVrOpsEnabled(false),
                            new PrivateCloudInner()
                                .withId("fwhybcibvy")
                                .withLocation("c")
                                .withName("tynnaamdectehfi")
                                .withType(PrivateCloudResourceType.MICROSOFT_VMWARE_CLOUD_SIMPLE_PRIVATE_CLOUDS)
                                .withAvailabilityZoneId("jeyp")
                                .withAvailabilityZoneName("ezrkgqhcjrefo")
                                .withClustersNumber(34828913)
                                .withCreatedBy("qsl")
                                .withCreatedOn(OffsetDateTime.parse("2021-08-20T18:32:02Z"))
                                .withDnsServers(Arrays.asList())
                                .withExpires("yqjpkcatt")
                                .withNsxType("gjcrcczsqpjhvm")
                                .withPlacementGroupId("jvnysounqe")
                                .withPlacementGroupName("noae")
                                .withPrivateCloudId(UUID.fromString("f3d0f493-2903-4a3b-928b-13b09712de9c"))
                                .withResourcePools(Arrays.asList())
                                .withState("yhltrpmopjmcm")
                                .withTotalCpuCores(61877127)
                                .withTotalNodes(1605990961)
                                .withTotalRam(607140678)
                                .withTotalStorage(98.63335F)
                                .withTypePropertiesType("uaodsfcpk")
                                .withVSphereVersion("odpuozmyzydag")
                                .withVcenterFqdn("axbezyiuo")
                                .withVcenterRefid("twhrdxwzywqsm")
                                .withVirtualMachineTemplates(Arrays.asList())
                                .withVirtualNetworks(Arrays.asList())
                                .withVrOpsEnabled(false)));
        model = BinaryData.fromObject(model).toObject(PrivateCloudList.class);
        Assertions.assertEquals("wska", model.nextLink());
        Assertions.assertEquals("zlcuiywgqywgndrv", model.value().get(0).id());
        Assertions.assertEquals("hzgpphrcgyncocpe", model.value().get(0).location());
        Assertions.assertEquals("vmmcoofs", model.value().get(0).name());
        Assertions
            .assertEquals(
                PrivateCloudResourceType.MICROSOFT_VMWARE_CLOUD_SIMPLE_PRIVATE_CLOUDS, model.value().get(0).type());
        Assertions.assertEquals("evgbmqjq", model.value().get(0).availabilityZoneId());
        Assertions.assertEquals("c", model.value().get(0).availabilityZoneName());
        Assertions.assertEquals(591177451, model.value().get(0).clustersNumber());
        Assertions.assertEquals("vkwlzuvccfwnf", model.value().get(0).createdBy());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T14:17:09Z"), model.value().get(0).createdOn());
        Assertions.assertEquals("ionle", model.value().get(0).expires());
        Assertions.assertEquals("etqgtzxdpnq", model.value().get(0).nsxType());
        Assertions.assertEquals("qwxrjfeallnw", model.value().get(0).placementGroupId());
        Assertions.assertEquals("bisnja", model.value().get(0).placementGroupName());
        Assertions
            .assertEquals(
                UUID.fromString("9108d465-8d80-4752-82db-543b4be91369"), model.value().get(0).privateCloudId());
        Assertions.assertEquals("gnzscxaqwo", model.value().get(0).state());
        Assertions.assertEquals(1004687873, model.value().get(0).totalCpuCores());
        Assertions.assertEquals(1989312604, model.value().get(0).totalNodes());
        Assertions.assertEquals(999666517, model.value().get(0).totalRam());
        Assertions.assertEquals(16.790741F, model.value().get(0).totalStorage());
        Assertions.assertEquals("kvlrxnj", model.value().get(0).typePropertiesType());
        Assertions.assertEquals("seiphe", model.value().get(0).vSphereVersion());
        Assertions.assertEquals("lokeyy", model.value().get(0).vcenterFqdn());
        Assertions.assertEquals("nj", model.value().get(0).vcenterRefid());
        Assertions.assertEquals(true, model.value().get(0).vrOpsEnabled());
    }
}
