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

package com.azure.resourcemanager.deviceupdate.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.deviceupdate.fluent.models.AccountProperties;
import com.azure.resourcemanager.deviceupdate.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.deviceupdate.models.PublicNetworkAccess;
import com.azure.resourcemanager.deviceupdate.models.Sku;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class AccountPropertiesTests {
    @Test
    public void testDeserialize() {
        AccountProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Deleted\",\"hostName\":\"y\",\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Succeeded\"},\"id\":\"vd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"}],\"sku\":\"Standard\",\"locations\":[{\"name\":\"cs\",\"role\":\"Primary\"}]}")
                .toObject(AccountProperties.class);
        Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess());
        Assertions.assertEquals(Sku.STANDARD, model.sku());
    }

    @Test
    public void testSerialize() {
        AccountProperties model =
            new AccountProperties()
                .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)
                .withPrivateEndpointConnections(
                    Arrays.asList(new PrivateEndpointConnectionInner().withGroupIds(Arrays.asList())))
                .withSku(Sku.STANDARD);
        model = BinaryData.fromObject(model).toObject(AccountProperties.class);
        Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess());
        Assertions.assertEquals(Sku.STANDARD, model.sku());
    }
}
