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

package com.azure.resourcemanager.iothub.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner;
import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner;
import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrivateLinkResourcesInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateLinkResourcesInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"kuwhh\",\"name\":\"ykojoxafnndlpic\",\"type\":\"o\",\"properties\":{\"groupId\":\"kcdyhbpk\",\"requiredMembers\":[],\"requiredZoneNames\":[]}},{\"id\":\"reqnovvqfov\",\"name\":\"xywsuws\",\"type\":\"s\",\"properties\":{\"groupId\":\"sytgadgvraea\",\"requiredMembers\":[],\"requiredZoneNames\":[]}}]}")
                .toObject(PrivateLinkResourcesInner.class);
        Assertions.assertEquals("kcdyhbpk", model.value().get(0).properties().groupId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateLinkResourcesInner model =
            new PrivateLinkResourcesInner()
                .withValue(
                    Arrays
                        .asList(
                            new GroupIdInformationInner()
                                .withProperties(
                                    new GroupIdInformationProperties()
                                        .withGroupId("kcdyhbpk")
                                        .withRequiredMembers(Arrays.asList())
                                        .withRequiredZoneNames(Arrays.asList())),
                            new GroupIdInformationInner()
                                .withProperties(
                                    new GroupIdInformationProperties()
                                        .withGroupId("sytgadgvraea")
                                        .withRequiredMembers(Arrays.asList())
                                        .withRequiredZoneNames(Arrays.asList()))));
        model = BinaryData.fromObject(model).toObject(PrivateLinkResourcesInner.class);
        Assertions.assertEquals("kcdyhbpk", model.value().get(0).properties().groupId());
    }
}
