// 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.SensitivityLabelUpdateInner;
import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateKind;
import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SensitivityLabelUpdateListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SensitivityLabelUpdateList model =
            BinaryData
                .fromString(
                    "{\"operations\":[{\"properties\":{\"op\":\"set\",\"schema\":\"mncwsobqwcsdb\",\"table\":\"wdcfhucqdpfuv\",\"column\":\"lsbjjcanvxbv\"},\"id\":\"udutnco\",\"name\":\"mr\",\"type\":\"xqtvcofu\"},{\"properties\":{\"op\":\"set\",\"schema\":\"vkg\",\"table\":\"u\",\"column\":\"gdknnqv\"},\"id\":\"znqntoru\",\"name\":\"sgsahmkycgr\",\"type\":\"uwjuetaeburuvdmo\"},{\"properties\":{\"op\":\"set\",\"schema\":\"zlxwabmqoefkifr\",\"table\":\"tpuqujmq\",\"column\":\"gkfbtndoaong\"},\"id\":\"cn\",\"name\":\"ujitcjedftww\",\"type\":\"ezkojvdcp\"}]}")
                .toObject(SensitivityLabelUpdateList.class);
        Assertions.assertEquals(SensitivityLabelUpdateKind.SET, model.operations().get(0).op());
        Assertions.assertEquals("mncwsobqwcsdb", model.operations().get(0).schema());
        Assertions.assertEquals("wdcfhucqdpfuv", model.operations().get(0).table());
        Assertions.assertEquals("lsbjjcanvxbv", model.operations().get(0).column());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SensitivityLabelUpdateList model =
            new SensitivityLabelUpdateList()
                .withOperations(
                    Arrays
                        .asList(
                            new SensitivityLabelUpdateInner()
                                .withOp(SensitivityLabelUpdateKind.SET)
                                .withSchema("mncwsobqwcsdb")
                                .withTable("wdcfhucqdpfuv")
                                .withColumn("lsbjjcanvxbv"),
                            new SensitivityLabelUpdateInner()
                                .withOp(SensitivityLabelUpdateKind.SET)
                                .withSchema("vkg")
                                .withTable("u")
                                .withColumn("gdknnqv"),
                            new SensitivityLabelUpdateInner()
                                .withOp(SensitivityLabelUpdateKind.SET)
                                .withSchema("zlxwabmqoefkifr")
                                .withTable("tpuqujmq")
                                .withColumn("gkfbtndoaong")));
        model = BinaryData.fromObject(model).toObject(SensitivityLabelUpdateList.class);
        Assertions.assertEquals(SensitivityLabelUpdateKind.SET, model.operations().get(0).op());
        Assertions.assertEquals("mncwsobqwcsdb", model.operations().get(0).schema());
        Assertions.assertEquals("wdcfhucqdpfuv", model.operations().get(0).table());
        Assertions.assertEquals("lsbjjcanvxbv", model.operations().get(0).column());
    }
}
