// 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.AutoMLVertical;
import com.azure.resourcemanager.machinelearning.models.InputDeliveryMode;
import com.azure.resourcemanager.machinelearning.models.LogVerbosity;
import com.azure.resourcemanager.machinelearning.models.MLTableJobInput;
import org.junit.jupiter.api.Assertions;

public final class AutoMLVerticalTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AutoMLVertical model =
            BinaryData
                .fromString(
                    "{\"taskType\":\"AutoMLVertical\",\"logVerbosity\":\"Critical\",\"targetColumnName\":\"eocnhzqrottj\",\"trainingData\":{\"jobInputType\":\"mltable\",\"mode\":\"Download\",\"uri\":\"yjzp\",\"description\":\"rl\"}}")
                .toObject(AutoMLVertical.class);
        Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity());
        Assertions.assertEquals("eocnhzqrottj", model.targetColumnName());
        Assertions.assertEquals("rl", model.trainingData().description());
        Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode());
        Assertions.assertEquals("yjzp", model.trainingData().uri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AutoMLVertical model =
            new AutoMLVertical()
                .withLogVerbosity(LogVerbosity.CRITICAL)
                .withTargetColumnName("eocnhzqrottj")
                .withTrainingData(
                    new MLTableJobInput().withDescription("rl").withMode(InputDeliveryMode.DOWNLOAD).withUri("yjzp"));
        model = BinaryData.fromObject(model).toObject(AutoMLVertical.class);
        Assertions.assertEquals(LogVerbosity.CRITICAL, model.logVerbosity());
        Assertions.assertEquals("eocnhzqrottj", model.targetColumnName());
        Assertions.assertEquals("rl", model.trainingData().description());
        Assertions.assertEquals(InputDeliveryMode.DOWNLOAD, model.trainingData().mode());
        Assertions.assertEquals("yjzp", model.trainingData().uri());
    }
}
