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

package com.azure.resourcemanager.purview.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.purview.fluent.models.AccountProperties;
import com.azure.resourcemanager.purview.models.CloudConnectors;
import com.azure.resourcemanager.purview.models.PublicNetworkAccess;
import org.junit.jupiter.api.Assertions;

public final class AccountPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AccountProperties model =
            BinaryData
                .fromString(
                    "{\"cloudConnectors\":{\"awsExternalId\":\"ukjfkgiawxklr\"},\"createdAt\":\"2021-02-17T21:17:55Z\",\"createdBy\":\"ckbasyypndd\",\"createdByObjectId\":\"gcbacphejkot\",\"endpoints\":{\"catalog\":\"gou\",\"guardian\":\"ndlik\",\"scan\":\"qkgfgibma\"},\"friendlyName\":\"akeqs\",\"managedResourceGroupName\":\"yb\",\"managedResources\":{\"eventHubNamespace\":\"e\",\"resourceGroup\":\"ytb\",\"storageAccount\":\"qfou\"},\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"smodmgloug\"},\"id\":\"b\",\"name\":\"wtmutduq\",\"type\":\"ta\"},{\"properties\":{\"provisioningState\":\"cuertu\"},\"id\":\"kdosvqw\",\"name\":\"bmdg\",\"type\":\"bjf\"},{\"properties\":{\"provisioningState\":\"mbe\"},\"id\":\"ppbhtqqrolfp\",\"name\":\"psalgbqux\",\"type\":\"gjyjgzjaoyfhrtxi\"}],\"provisioningState\":\"Failed\",\"publicNetworkAccess\":\"Enabled\"}")
                .toObject(AccountProperties.class);
        Assertions.assertEquals("yb", model.managedResourceGroupName());
        Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AccountProperties model =
            new AccountProperties()
                .withCloudConnectors(new CloudConnectors())
                .withManagedResourceGroupName("yb")
                .withPublicNetworkAccess(PublicNetworkAccess.ENABLED);
        model = BinaryData.fromObject(model).toObject(AccountProperties.class);
        Assertions.assertEquals("yb", model.managedResourceGroupName());
        Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess());
    }
}
