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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus;
import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource;
import org.junit.jupiter.api.Assertions;

public final class SharedPrivateLinkResourceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SharedPrivateLinkResource model =
            BinaryData
                .fromString(
                    "{\"name\":\"bwjzr\",\"properties\":{\"privateLinkResourceId\":\"gxg\",\"groupId\":\"pemvtzfkufubljof\",\"requestMessage\":\"eofjaeqjh\",\"status\":\"Pending\"}}")
                .toObject(SharedPrivateLinkResource.class);
        Assertions.assertEquals("bwjzr", model.name());
        Assertions.assertEquals("gxg", model.privateLinkResourceId());
        Assertions.assertEquals("pemvtzfkufubljof", model.groupId());
        Assertions.assertEquals("eofjaeqjh", model.requestMessage());
        Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SharedPrivateLinkResource model =
            new SharedPrivateLinkResource()
                .withName("bwjzr")
                .withPrivateLinkResourceId("gxg")
                .withGroupId("pemvtzfkufubljof")
                .withRequestMessage("eofjaeqjh")
                .withStatus(PrivateEndpointServiceConnectionStatus.PENDING);
        model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResource.class);
        Assertions.assertEquals("bwjzr", model.name());
        Assertions.assertEquals("gxg", model.privateLinkResourceId());
        Assertions.assertEquals("pemvtzfkufubljof", model.groupId());
        Assertions.assertEquals("eofjaeqjh", model.requestMessage());
        Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status());
    }
}
