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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner;
import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionProperties;
import com.azure.resourcemanager.synapse.models.PrivateEndpoint;
import com.azure.resourcemanager.synapse.models.PrivateLinkServiceConnectionState;
import org.junit.jupiter.api.Assertions;

public final class PrivateEndpointConnectionForPrivateLinkHubInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateEndpointConnectionForPrivateLinkHubInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"ipazyxoegukgjnpi\",\"type\":\"gygev\",\"id\":\"ntypmrbpizcdrqj\",\"properties\":{\"privateEndpoint\":{\"id\":\"dnfyhxdeoejzicwi\"},\"privateLinkServiceConnectionState\":{\"status\":\"ttgzfbis\",\"description\":\"bkh\",\"actionsRequired\":\"deyeamdphagalpbu\"},\"provisioningState\":\"gipwhonowkg\"}}")
                .toObject(PrivateEndpointConnectionForPrivateLinkHubInner.class);
        Assertions.assertEquals("ntypmrbpizcdrqj", model.id());
        Assertions.assertEquals("ttgzfbis", model.properties().privateLinkServiceConnectionState().status());
        Assertions.assertEquals("bkh", model.properties().privateLinkServiceConnectionState().description());
        Assertions.assertEquals("ipazyxoegukgjnpi", model.name());
        Assertions.assertEquals("gygev", model.type());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateEndpointConnectionForPrivateLinkHubInner model =
            new PrivateEndpointConnectionForPrivateLinkHubInner()
                .withId("ntypmrbpizcdrqj")
                .withProperties(
                    new PrivateEndpointConnectionProperties()
                        .withPrivateEndpoint(new PrivateEndpoint())
                        .withPrivateLinkServiceConnectionState(
                            new PrivateLinkServiceConnectionState().withStatus("ttgzfbis").withDescription("bkh")))
                .withName("ipazyxoegukgjnpi")
                .withType("gygev");
        model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionForPrivateLinkHubInner.class);
        Assertions.assertEquals("ntypmrbpizcdrqj", model.id());
        Assertions.assertEquals("ttgzfbis", model.properties().privateLinkServiceConnectionState().status());
        Assertions.assertEquals("bkh", model.properties().privateLinkServiceConnectionState().description());
        Assertions.assertEquals("ipazyxoegukgjnpi", model.name());
        Assertions.assertEquals("gygev", model.type());
    }
}
