// 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.PrivateCloudProperties;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.ResourcePoolInner;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.VirtualMachineTemplateInner;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.VirtualNetworkInner;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class PrivateCloudPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateCloudProperties model =
            BinaryData
                .fromString(
                    "{\"availabilityZoneId\":\"c\",\"availabilityZoneName\":\"ahfn\",\"clustersNumber\":1999582411,\"createdBy\":\"qxj\",\"createdOn\":\"2021-01-29T11:34:22Z\",\"dnsServers\":[\"gidokgjljyoxgvcl\",\"bgsncghkjeszzhb\",\"jhtxfvgxbfsmxne\"],\"expires\":\"pvecxgodeb\",\"nsxType\":\"kk\",\"placementGroupId\":\"mpukgriw\",\"placementGroupName\":\"zlfbxzpuzycispnq\",\"privateCloudId\":\"e9b44036-a4e1-40b8-9263-98ef55aa8ab6\",\"resourcePools\":[{\"id\":\"gkbrpyyd\",\"location\":\"bnuqqkpik\",\"name\":\"rgvtqag\",\"privateCloudId\":\"uynhijg\",\"properties\":{\"fullName\":\"bfs\"},\"type\":\"rbu\"},{\"id\":\"rcvpnazzmhjrunmp\",\"location\":\"tdbhrbnla\",\"name\":\"xmyskp\",\"privateCloudId\":\"enbtkcxywny\",\"properties\":{\"fullName\":\"synlqidybyxczfc\"},\"type\":\"aaxdbabphlwrq\"},{\"id\":\"fkts\",\"location\":\"sucocmnyyazttbtw\",\"name\":\"qpuedckzywbiex\",\"privateCloudId\":\"eyueaxibxujwb\",\"properties\":{\"fullName\":\"almuzyoxaepdkzja\"},\"type\":\"ux\"},{\"id\":\"hdwbavxbniwdjs\",\"location\":\"tsdbpgn\",\"name\":\"txhp\",\"privateCloudId\":\"bzpfzab\",\"properties\":{\"fullName\":\"uhxwtctyqiklbbov\"},\"type\":\"wzbhvgyugu\"}],\"state\":\"vmkfssxqu\",\"totalCpuCores\":571824104,\"totalNodes\":89011603,\"totalRam\":434688137,\"totalStorage\":90.44488,\"type\":\"nkjzkdeslpvlop\",\"vSphereVersion\":\"yighxpk\",\"vcenterFqdn\":\"zb\",\"vcenterRefid\":\"uebbaumnyqup\",\"virtualMachineTemplates\":[{\"id\":\"jn\",\"location\":\"ckhsmtxpsieb\",\"name\":\"hvpesapskrdqm\",\"properties\":{\"amountOfRam\":136140206,\"controllers\":[],\"description\":\"ldwkyzxuutkn\",\"disks\":[],\"exposeToGuestVM\":true,\"guestOS\":\"svlxotogtwrup\",\"guestOSType\":\"xvnmicykvceov\",\"nics\":[],\"numberOfCores\":2060505199,\"path\":\"notyfjfcnjbkcn\",\"privateCloudId\":\"dhbt\",\"vSphereNetworks\":[],\"vSphereTags\":[],\"vmwaretools\":\"ywpnvjt\"},\"type\":\"nermcl\"},{\"id\":\"lphox\",\"location\":\"crpab\",\"name\":\"epsbjtazqu\",\"properties\":{\"amountOfRam\":2007801220,\"controllers\":[],\"description\":\"ueefjzwfqkqu\",\"disks\":[],\"exposeToGuestVM\":true,\"guestOS\":\"yonobgl\",\"guestOSType\":\"cq\",\"nics\":[],\"numberOfCores\":1581079817,\"path\":\"g\",\"privateCloudId\":\"udxytlmoyrx\",\"vSphereNetworks\":[],\"vSphereTags\":[],\"vmwaretools\":\"dw\"},\"type\":\"ntxhdzhlrqjbhck\"}],\"virtualNetworks\":[{\"assignable\":false,\"id\":\"xsbkyvpyca\",\"location\":\"z\",\"name\":\"zka\",\"properties\":{\"privateCloudId\":\"wbcrnwbmehhseyv\"},\"type\":\"srtslhspkdeem\"},{\"assignable\":false,\"id\":\"mx\",\"location\":\"kv\",\"name\":\"elmqk\",\"properties\":{\"privateCloudId\":\"hvljuahaquh\"},\"type\":\"hmdua\"},{\"assignable\":false,\"id\":\"xqpvfadmw\",\"location\":\"crgvxpvgom\",\"name\":\"fmisg\",\"properties\":{\"privateCloudId\":\"b\"},\"type\":\"ldawkzbaliourqha\"}],\"vrOpsEnabled\":true}")
                .toObject(PrivateCloudProperties.class);
        Assertions.assertEquals("c", model.availabilityZoneId());
        Assertions.assertEquals("ahfn", model.availabilityZoneName());
        Assertions.assertEquals(1999582411, model.clustersNumber());
        Assertions.assertEquals("qxj", model.createdBy());
        Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T11:34:22Z"), model.createdOn());
        Assertions.assertEquals("gidokgjljyoxgvcl", model.dnsServers().get(0));
        Assertions.assertEquals("pvecxgodeb", model.expires());
        Assertions.assertEquals("kk", model.nsxType());
        Assertions.assertEquals("mpukgriw", model.placementGroupId());
        Assertions.assertEquals("zlfbxzpuzycispnq", model.placementGroupName());
        Assertions.assertEquals(UUID.fromString("e9b44036-a4e1-40b8-9263-98ef55aa8ab6"), model.privateCloudId());
        Assertions.assertEquals("gkbrpyyd", model.resourcePools().get(0).id());
        Assertions.assertEquals("vmkfssxqu", model.state());
        Assertions.assertEquals(571824104, model.totalCpuCores());
        Assertions.assertEquals(89011603, model.totalNodes());
        Assertions.assertEquals(434688137, model.totalRam());
        Assertions.assertEquals(90.44488F, model.totalStorage());
        Assertions.assertEquals("nkjzkdeslpvlop", model.type());
        Assertions.assertEquals("yighxpk", model.vSphereVersion());
        Assertions.assertEquals("zb", model.vcenterFqdn());
        Assertions.assertEquals("uebbaumnyqup", model.vcenterRefid());
        Assertions.assertEquals("ckhsmtxpsieb", model.virtualMachineTemplates().get(0).location());
        Assertions.assertEquals(136140206, model.virtualMachineTemplates().get(0).amountOfRam());
        Assertions.assertEquals("ldwkyzxuutkn", model.virtualMachineTemplates().get(0).description());
        Assertions.assertEquals(true, model.virtualMachineTemplates().get(0).exposeToGuestVM());
        Assertions.assertEquals(2060505199, model.virtualMachineTemplates().get(0).numberOfCores());
        Assertions.assertEquals("notyfjfcnjbkcn", model.virtualMachineTemplates().get(0).path());
        Assertions.assertEquals("dhbt", model.virtualMachineTemplates().get(0).privateCloudId());
        Assertions.assertEquals("xsbkyvpyca", model.virtualNetworks().get(0).id());
        Assertions.assertEquals(true, model.vrOpsEnabled());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateCloudProperties model =
            new PrivateCloudProperties()
                .withAvailabilityZoneId("c")
                .withAvailabilityZoneName("ahfn")
                .withClustersNumber(1999582411)
                .withCreatedBy("qxj")
                .withCreatedOn(OffsetDateTime.parse("2021-01-29T11:34:22Z"))
                .withDnsServers(Arrays.asList("gidokgjljyoxgvcl", "bgsncghkjeszzhb", "jhtxfvgxbfsmxne"))
                .withExpires("pvecxgodeb")
                .withNsxType("kk")
                .withPlacementGroupId("mpukgriw")
                .withPlacementGroupName("zlfbxzpuzycispnq")
                .withPrivateCloudId(UUID.fromString("e9b44036-a4e1-40b8-9263-98ef55aa8ab6"))
                .withResourcePools(
                    Arrays
                        .asList(
                            new ResourcePoolInner().withId("gkbrpyyd"),
                            new ResourcePoolInner().withId("rcvpnazzmhjrunmp"),
                            new ResourcePoolInner().withId("fkts"),
                            new ResourcePoolInner().withId("hdwbavxbniwdjs")))
                .withState("vmkfssxqu")
                .withTotalCpuCores(571824104)
                .withTotalNodes(89011603)
                .withTotalRam(434688137)
                .withTotalStorage(90.44488F)
                .withType("nkjzkdeslpvlop")
                .withVSphereVersion("yighxpk")
                .withVcenterFqdn("zb")
                .withVcenterRefid("uebbaumnyqup")
                .withVirtualMachineTemplates(
                    Arrays
                        .asList(
                            new VirtualMachineTemplateInner()
                                .withLocation("ckhsmtxpsieb")
                                .withAmountOfRam(136140206)
                                .withControllers(Arrays.asList())
                                .withDescription("ldwkyzxuutkn")
                                .withDisks(Arrays.asList())
                                .withExposeToGuestVM(true)
                                .withNics(Arrays.asList())
                                .withNumberOfCores(2060505199)
                                .withPath("notyfjfcnjbkcn")
                                .withPrivateCloudId("dhbt")
                                .withVSphereNetworks(Arrays.asList())
                                .withVSphereTags(Arrays.asList()),
                            new VirtualMachineTemplateInner()
                                .withLocation("crpab")
                                .withAmountOfRam(2007801220)
                                .withControllers(Arrays.asList())
                                .withDescription("ueefjzwfqkqu")
                                .withDisks(Arrays.asList())
                                .withExposeToGuestVM(true)
                                .withNics(Arrays.asList())
                                .withNumberOfCores(1581079817)
                                .withPath("g")
                                .withPrivateCloudId("udxytlmoyrx")
                                .withVSphereNetworks(Arrays.asList())
                                .withVSphereTags(Arrays.asList())))
                .withVirtualNetworks(
                    Arrays
                        .asList(
                            new VirtualNetworkInner().withId("xsbkyvpyca"),
                            new VirtualNetworkInner().withId("mx"),
                            new VirtualNetworkInner().withId("xqpvfadmw")))
                .withVrOpsEnabled(true);
        model = BinaryData.fromObject(model).toObject(PrivateCloudProperties.class);
        Assertions.assertEquals("c", model.availabilityZoneId());
        Assertions.assertEquals("ahfn", model.availabilityZoneName());
        Assertions.assertEquals(1999582411, model.clustersNumber());
        Assertions.assertEquals("qxj", model.createdBy());
        Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T11:34:22Z"), model.createdOn());
        Assertions.assertEquals("gidokgjljyoxgvcl", model.dnsServers().get(0));
        Assertions.assertEquals("pvecxgodeb", model.expires());
        Assertions.assertEquals("kk", model.nsxType());
        Assertions.assertEquals("mpukgriw", model.placementGroupId());
        Assertions.assertEquals("zlfbxzpuzycispnq", model.placementGroupName());
        Assertions.assertEquals(UUID.fromString("e9b44036-a4e1-40b8-9263-98ef55aa8ab6"), model.privateCloudId());
        Assertions.assertEquals("gkbrpyyd", model.resourcePools().get(0).id());
        Assertions.assertEquals("vmkfssxqu", model.state());
        Assertions.assertEquals(571824104, model.totalCpuCores());
        Assertions.assertEquals(89011603, model.totalNodes());
        Assertions.assertEquals(434688137, model.totalRam());
        Assertions.assertEquals(90.44488F, model.totalStorage());
        Assertions.assertEquals("nkjzkdeslpvlop", model.type());
        Assertions.assertEquals("yighxpk", model.vSphereVersion());
        Assertions.assertEquals("zb", model.vcenterFqdn());
        Assertions.assertEquals("uebbaumnyqup", model.vcenterRefid());
        Assertions.assertEquals("ckhsmtxpsieb", model.virtualMachineTemplates().get(0).location());
        Assertions.assertEquals(136140206, model.virtualMachineTemplates().get(0).amountOfRam());
        Assertions.assertEquals("ldwkyzxuutkn", model.virtualMachineTemplates().get(0).description());
        Assertions.assertEquals(true, model.virtualMachineTemplates().get(0).exposeToGuestVM());
        Assertions.assertEquals(2060505199, model.virtualMachineTemplates().get(0).numberOfCores());
        Assertions.assertEquals("notyfjfcnjbkcn", model.virtualMachineTemplates().get(0).path());
        Assertions.assertEquals("dhbt", model.virtualMachineTemplates().get(0).privateCloudId());
        Assertions.assertEquals("xsbkyvpyca", model.virtualNetworks().get(0).id());
        Assertions.assertEquals(true, model.vrOpsEnabled());
    }
}
