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

package com.azure.resourcemanager.hybridcompute.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkScopeValidationDetailsInner;
import com.azure.resourcemanager.hybridcompute.models.ConnectionDetail;
import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrivateLinkScopeValidationDetailsInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateLinkScopeValidationDetailsInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"pikad\",\"publicNetworkAccess\":\"Enabled\",\"connectionDetails\":[{\"id\":\"gnbuy\",\"privateIpAddress\":\"ijggmebfsiar\",\"linkIdentifier\":\"trcvpnazzmh\",\"groupId\":\"unmpxttd\",\"memberName\":\"rbnlankxmyskp\"},{\"id\":\"enbtkcxywny\",\"privateIpAddress\":\"rsyn\",\"linkIdentifier\":\"idybyxczf\",\"groupId\":\"haaxdbabphl\",\"memberName\":\"qlfktsths\"}]}")
                .toObject(PrivateLinkScopeValidationDetailsInner.class);
        Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateLinkScopeValidationDetailsInner model =
            new PrivateLinkScopeValidationDetailsInner()
                .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)
                .withConnectionDetails(Arrays.asList(new ConnectionDetail(), new ConnectionDetail()));
        model = BinaryData.fromObject(model).toObject(PrivateLinkScopeValidationDetailsInner.class);
        Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess());
    }
}
