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

package com.azure.resourcemanager.databox.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databox.models.AzureFileFilterDetails;
import com.azure.resourcemanager.databox.models.BlobFilterDetails;
import com.azure.resourcemanager.databox.models.DataAccountType;
import com.azure.resourcemanager.databox.models.FilterFileDetails;
import com.azure.resourcemanager.databox.models.FilterFileType;
import com.azure.resourcemanager.databox.models.TransferConfigurationTransferFilterDetails;
import com.azure.resourcemanager.databox.models.TransferFilterDetails;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class TransferConfigurationTransferFilterDetailsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TransferConfigurationTransferFilterDetails model =
            BinaryData
                .fromString(
                    "{\"include\":{\"dataAccountType\":\"ManagedDisk\",\"blobFilterDetails\":{\"blobPrefixList\":[\"ddtocjjxhvp\",\"o\"],\"blobPathList\":[\"hd\",\"xibqeojnx\",\"bzv\",\"dntwndeicbtw\"],\"containerList\":[\"aoqvuh\"]},\"azureFileFilterDetails\":{\"filePrefixList\":[\"fcyddg\"],\"filePathList\":[\"t\",\"jqkwpyeicx\",\"qciwqvhkhixuigdt\"],\"fileShareList\":[\"objoghmewu\"]},\"filterFileDetails\":[{\"filterFileType\":\"AzureFile\",\"filterFilePath\":\"hrzayvvtpgvdf\"}]}}")
                .toObject(TransferConfigurationTransferFilterDetails.class);
        Assertions.assertEquals(DataAccountType.MANAGED_DISK, model.include().dataAccountType());
        Assertions.assertEquals("ddtocjjxhvp", model.include().blobFilterDetails().blobPrefixList().get(0));
        Assertions.assertEquals("hd", model.include().blobFilterDetails().blobPathList().get(0));
        Assertions.assertEquals("aoqvuh", model.include().blobFilterDetails().containerList().get(0));
        Assertions.assertEquals("fcyddg", model.include().azureFileFilterDetails().filePrefixList().get(0));
        Assertions.assertEquals("t", model.include().azureFileFilterDetails().filePathList().get(0));
        Assertions.assertEquals("objoghmewu", model.include().azureFileFilterDetails().fileShareList().get(0));
        Assertions.assertEquals(FilterFileType.AZURE_FILE, model.include().filterFileDetails().get(0).filterFileType());
        Assertions.assertEquals("hrzayvvtpgvdf", model.include().filterFileDetails().get(0).filterFilePath());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TransferConfigurationTransferFilterDetails model =
            new TransferConfigurationTransferFilterDetails()
                .withInclude(
                    new TransferFilterDetails()
                        .withDataAccountType(DataAccountType.MANAGED_DISK)
                        .withBlobFilterDetails(
                            new BlobFilterDetails()
                                .withBlobPrefixList(Arrays.asList("ddtocjjxhvp", "o"))
                                .withBlobPathList(Arrays.asList("hd", "xibqeojnx", "bzv", "dntwndeicbtw"))
                                .withContainerList(Arrays.asList("aoqvuh")))
                        .withAzureFileFilterDetails(
                            new AzureFileFilterDetails()
                                .withFilePrefixList(Arrays.asList("fcyddg"))
                                .withFilePathList(Arrays.asList("t", "jqkwpyeicx", "qciwqvhkhixuigdt"))
                                .withFileShareList(Arrays.asList("objoghmewu")))
                        .withFilterFileDetails(
                            Arrays
                                .asList(
                                    new FilterFileDetails()
                                        .withFilterFileType(FilterFileType.AZURE_FILE)
                                        .withFilterFilePath("hrzayvvtpgvdf"))));
        model = BinaryData.fromObject(model).toObject(TransferConfigurationTransferFilterDetails.class);
        Assertions.assertEquals(DataAccountType.MANAGED_DISK, model.include().dataAccountType());
        Assertions.assertEquals("ddtocjjxhvp", model.include().blobFilterDetails().blobPrefixList().get(0));
        Assertions.assertEquals("hd", model.include().blobFilterDetails().blobPathList().get(0));
        Assertions.assertEquals("aoqvuh", model.include().blobFilterDetails().containerList().get(0));
        Assertions.assertEquals("fcyddg", model.include().azureFileFilterDetails().filePrefixList().get(0));
        Assertions.assertEquals("t", model.include().azureFileFilterDetails().filePathList().get(0));
        Assertions.assertEquals("objoghmewu", model.include().azureFileFilterDetails().fileShareList().get(0));
        Assertions.assertEquals(FilterFileType.AZURE_FILE, model.include().filterFileDetails().get(0).filterFileType());
        Assertions.assertEquals("hrzayvvtpgvdf", model.include().filterFileDetails().get(0).filterFilePath());
    }
}
