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

package com.azure.resourcemanager.kusto.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kusto.models.DatabaseInviteFollowerRequest;
import com.azure.resourcemanager.kusto.models.TableLevelSharingProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DatabaseInviteFollowerRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DatabaseInviteFollowerRequest model =
            BinaryData
                .fromString(
                    "{\"inviteeEmail\":\"iebwwaloayqcgwrt\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"gwyzm\"],\"tablesToExclude\":[\"ongmtsa\",\"jcbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\"],\"externalTablesToInclude\":[\"xrmcqibycnojvk\",\"mefqsgzvahapjyzh\",\"vgqzcjrvxd\",\"zlmwlxkvugfhz\"],\"externalTablesToExclude\":[\"wjvzunluthnn\",\"rnxipei\",\"pjzu\",\"e\"],\"materializedViewsToInclude\":[\"ultskzbbtdz\",\"mv\"],\"materializedViewsToExclude\":[\"gpw\",\"zuhkfpbsjyof\"],\"functionsToInclude\":[\"uusdttouwa\"],\"functionsToExclude\":[\"kqvkelnsmvbxwyjs\",\"lh\"]}}")
                .toObject(DatabaseInviteFollowerRequest.class);
        Assertions.assertEquals("iebwwaloayqcgwrt", model.inviteeEmail());
        Assertions.assertEquals("gwyzm", model.tableLevelSharingProperties().tablesToInclude().get(0));
        Assertions.assertEquals("ongmtsa", model.tableLevelSharingProperties().tablesToExclude().get(0));
        Assertions.assertEquals("xrmcqibycnojvk", model.tableLevelSharingProperties().externalTablesToInclude().get(0));
        Assertions.assertEquals("wjvzunluthnn", model.tableLevelSharingProperties().externalTablesToExclude().get(0));
        Assertions.assertEquals("ultskzbbtdz", model.tableLevelSharingProperties().materializedViewsToInclude().get(0));
        Assertions.assertEquals("gpw", model.tableLevelSharingProperties().materializedViewsToExclude().get(0));
        Assertions.assertEquals("uusdttouwa", model.tableLevelSharingProperties().functionsToInclude().get(0));
        Assertions.assertEquals("kqvkelnsmvbxwyjs", model.tableLevelSharingProperties().functionsToExclude().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DatabaseInviteFollowerRequest model =
            new DatabaseInviteFollowerRequest()
                .withInviteeEmail("iebwwaloayqcgwrt")
                .withTableLevelSharingProperties(
                    new TableLevelSharingProperties()
                        .withTablesToInclude(Arrays.asList("gwyzm"))
                        .withTablesToExclude(Arrays.asList("ongmtsa", "jcbpwxqpsrknft", "uvriuhprwm", "yvxqtayriwwroy"))
                        .withExternalTablesToInclude(
                            Arrays.asList("xrmcqibycnojvk", "mefqsgzvahapjyzh", "vgqzcjrvxd", "zlmwlxkvugfhz"))
                        .withExternalTablesToExclude(Arrays.asList("wjvzunluthnn", "rnxipei", "pjzu", "e"))
                        .withMaterializedViewsToInclude(Arrays.asList("ultskzbbtdz", "mv"))
                        .withMaterializedViewsToExclude(Arrays.asList("gpw", "zuhkfpbsjyof"))
                        .withFunctionsToInclude(Arrays.asList("uusdttouwa"))
                        .withFunctionsToExclude(Arrays.asList("kqvkelnsmvbxwyjs", "lh")));
        model = BinaryData.fromObject(model).toObject(DatabaseInviteFollowerRequest.class);
        Assertions.assertEquals("iebwwaloayqcgwrt", model.inviteeEmail());
        Assertions.assertEquals("gwyzm", model.tableLevelSharingProperties().tablesToInclude().get(0));
        Assertions.assertEquals("ongmtsa", model.tableLevelSharingProperties().tablesToExclude().get(0));
        Assertions.assertEquals("xrmcqibycnojvk", model.tableLevelSharingProperties().externalTablesToInclude().get(0));
        Assertions.assertEquals("wjvzunluthnn", model.tableLevelSharingProperties().externalTablesToExclude().get(0));
        Assertions.assertEquals("ultskzbbtdz", model.tableLevelSharingProperties().materializedViewsToInclude().get(0));
        Assertions.assertEquals("gpw", model.tableLevelSharingProperties().materializedViewsToExclude().get(0));
        Assertions.assertEquals("uusdttouwa", model.tableLevelSharingProperties().functionsToInclude().get(0));
        Assertions.assertEquals("kqvkelnsmvbxwyjs", model.tableLevelSharingProperties().functionsToExclude().get(0));
    }
}
