// 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.InputDeliveryMode;
import com.azure.resourcemanager.machinelearning.models.MLTableJobInput;
import com.azure.resourcemanager.machinelearning.models.NlpVertical;
import com.azure.resourcemanager.machinelearning.models.NlpVerticalFeaturizationSettings;
import com.azure.resourcemanager.machinelearning.models.NlpVerticalLimitSettings;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;

public final class NlpVerticalTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NlpVertical model =
            BinaryData
                .fromString(
                    "{\"featurizationSettings\":{\"datasetLanguage\":\"ubmomsgvvjh\"},\"limitSettings\":{\"maxConcurrentTrials\":1113718862,\"maxTrials\":1386794835,\"timeout\":\"PT207H58M31S\"},\"validationData\":{\"jobInputType\":\"mltable\",\"mode\":\"EvalDownload\",\"uri\":\"majnkd\",\"description\":\"q\"}}")
                .toObject(NlpVertical.class);
        Assertions.assertEquals("ubmomsgvvjh", model.featurizationSettings().datasetLanguage());
        Assertions.assertEquals(1113718862, model.limitSettings().maxConcurrentTrials());
        Assertions.assertEquals(1386794835, model.limitSettings().maxTrials());
        Assertions.assertEquals(Duration.parse("PT207H58M31S"), model.limitSettings().timeout());
        Assertions.assertEquals("q", model.validationData().description());
        Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode());
        Assertions.assertEquals("majnkd", model.validationData().uri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NlpVertical model =
            new NlpVertical()
                .withFeaturizationSettings(new NlpVerticalFeaturizationSettings().withDatasetLanguage("ubmomsgvvjh"))
                .withLimitSettings(
                    new NlpVerticalLimitSettings()
                        .withMaxConcurrentTrials(1113718862)
                        .withMaxTrials(1386794835)
                        .withTimeout(Duration.parse("PT207H58M31S")))
                .withValidationData(
                    new MLTableJobInput()
                        .withDescription("q")
                        .withMode(InputDeliveryMode.EVAL_DOWNLOAD)
                        .withUri("majnkd"));
        model = BinaryData.fromObject(model).toObject(NlpVertical.class);
        Assertions.assertEquals("ubmomsgvvjh", model.featurizationSettings().datasetLanguage());
        Assertions.assertEquals(1113718862, model.limitSettings().maxConcurrentTrials());
        Assertions.assertEquals(1386794835, model.limitSettings().maxTrials());
        Assertions.assertEquals(Duration.parse("PT207H58M31S"), model.limitSettings().timeout());
        Assertions.assertEquals("q", model.validationData().description());
        Assertions.assertEquals(InputDeliveryMode.EVAL_DOWNLOAD, model.validationData().mode());
        Assertions.assertEquals("majnkd", model.validationData().uri());
    }
}
