// 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.ImageModelDistributionSettings;
import org.junit.jupiter.api.Assertions;

public final class ImageModelDistributionSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ImageModelDistributionSettings model =
            BinaryData
                .fromString(
                    "{\"amsGradient\":\"v\",\"augmentations\":\"i\",\"beta1\":\"qzlgcndhzxrrfcfs\",\"beta2\":\"khgsnxuwwkpphefs\",\"distributed\":\"xlb\",\"earlyStopping\":\"omeikjcl\",\"earlyStoppingDelay\":\"acnmwpfsuqtaaz\",\"earlyStoppingPatience\":\"bxyxoy\",\"enableOnnxNormalization\":\"uqqiqezxlhd\",\"evaluationFrequency\":\"qdcadwvps\",\"gradientAccumulationStep\":\"j\",\"layersToFreeze\":\"hjriyb\",\"learningRate\":\"zo\",\"learningRateScheduler\":\"nxwdvwnjkg\",\"modelName\":\"nmx\",\"momentum\":\"rsqftib\",\"nesterov\":\"ibuyvpirf\",\"numberOfEpochs\":\"pnqn\",\"numberOfWorkers\":\"w\",\"optimizer\":\"edenrexkxbhxv\",\"randomSeed\":\"nul\",\"stepLRGamma\":\"nhj\",\"stepLRStepSize\":\"dyznfajsvks\",\"trainingBatchSize\":\"qozzkivyhjrliizj\",\"validationBatchSize\":\"lqfhefkwabs\",\"warmupCosineLRCycles\":\"ron\",\"warmupCosineLRWarmupEpochs\":\"lmgnlqxsjx\",\"weightDecay\":\"lexhv\"}")
                .toObject(ImageModelDistributionSettings.class);
        Assertions.assertEquals("v", model.amsGradient());
        Assertions.assertEquals("i", model.augmentations());
        Assertions.assertEquals("qzlgcndhzxrrfcfs", model.beta1());
        Assertions.assertEquals("khgsnxuwwkpphefs", model.beta2());
        Assertions.assertEquals("xlb", model.distributed());
        Assertions.assertEquals("omeikjcl", model.earlyStopping());
        Assertions.assertEquals("acnmwpfsuqtaaz", model.earlyStoppingDelay());
        Assertions.assertEquals("bxyxoy", model.earlyStoppingPatience());
        Assertions.assertEquals("uqqiqezxlhd", model.enableOnnxNormalization());
        Assertions.assertEquals("qdcadwvps", model.evaluationFrequency());
        Assertions.assertEquals("j", model.gradientAccumulationStep());
        Assertions.assertEquals("hjriyb", model.layersToFreeze());
        Assertions.assertEquals("zo", model.learningRate());
        Assertions.assertEquals("nxwdvwnjkg", model.learningRateScheduler());
        Assertions.assertEquals("nmx", model.modelName());
        Assertions.assertEquals("rsqftib", model.momentum());
        Assertions.assertEquals("ibuyvpirf", model.nesterov());
        Assertions.assertEquals("pnqn", model.numberOfEpochs());
        Assertions.assertEquals("w", model.numberOfWorkers());
        Assertions.assertEquals("edenrexkxbhxv", model.optimizer());
        Assertions.assertEquals("nul", model.randomSeed());
        Assertions.assertEquals("nhj", model.stepLRGamma());
        Assertions.assertEquals("dyznfajsvks", model.stepLRStepSize());
        Assertions.assertEquals("qozzkivyhjrliizj", model.trainingBatchSize());
        Assertions.assertEquals("lqfhefkwabs", model.validationBatchSize());
        Assertions.assertEquals("ron", model.warmupCosineLRCycles());
        Assertions.assertEquals("lmgnlqxsjx", model.warmupCosineLRWarmupEpochs());
        Assertions.assertEquals("lexhv", model.weightDecay());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ImageModelDistributionSettings model =
            new ImageModelDistributionSettings()
                .withAmsGradient("v")
                .withAugmentations("i")
                .withBeta1("qzlgcndhzxrrfcfs")
                .withBeta2("khgsnxuwwkpphefs")
                .withDistributed("xlb")
                .withEarlyStopping("omeikjcl")
                .withEarlyStoppingDelay("acnmwpfsuqtaaz")
                .withEarlyStoppingPatience("bxyxoy")
                .withEnableOnnxNormalization("uqqiqezxlhd")
                .withEvaluationFrequency("qdcadwvps")
                .withGradientAccumulationStep("j")
                .withLayersToFreeze("hjriyb")
                .withLearningRate("zo")
                .withLearningRateScheduler("nxwdvwnjkg")
                .withModelName("nmx")
                .withMomentum("rsqftib")
                .withNesterov("ibuyvpirf")
                .withNumberOfEpochs("pnqn")
                .withNumberOfWorkers("w")
                .withOptimizer("edenrexkxbhxv")
                .withRandomSeed("nul")
                .withStepLRGamma("nhj")
                .withStepLRStepSize("dyznfajsvks")
                .withTrainingBatchSize("qozzkivyhjrliizj")
                .withValidationBatchSize("lqfhefkwabs")
                .withWarmupCosineLRCycles("ron")
                .withWarmupCosineLRWarmupEpochs("lmgnlqxsjx")
                .withWeightDecay("lexhv");
        model = BinaryData.fromObject(model).toObject(ImageModelDistributionSettings.class);
        Assertions.assertEquals("v", model.amsGradient());
        Assertions.assertEquals("i", model.augmentations());
        Assertions.assertEquals("qzlgcndhzxrrfcfs", model.beta1());
        Assertions.assertEquals("khgsnxuwwkpphefs", model.beta2());
        Assertions.assertEquals("xlb", model.distributed());
        Assertions.assertEquals("omeikjcl", model.earlyStopping());
        Assertions.assertEquals("acnmwpfsuqtaaz", model.earlyStoppingDelay());
        Assertions.assertEquals("bxyxoy", model.earlyStoppingPatience());
        Assertions.assertEquals("uqqiqezxlhd", model.enableOnnxNormalization());
        Assertions.assertEquals("qdcadwvps", model.evaluationFrequency());
        Assertions.assertEquals("j", model.gradientAccumulationStep());
        Assertions.assertEquals("hjriyb", model.layersToFreeze());
        Assertions.assertEquals("zo", model.learningRate());
        Assertions.assertEquals("nxwdvwnjkg", model.learningRateScheduler());
        Assertions.assertEquals("nmx", model.modelName());
        Assertions.assertEquals("rsqftib", model.momentum());
        Assertions.assertEquals("ibuyvpirf", model.nesterov());
        Assertions.assertEquals("pnqn", model.numberOfEpochs());
        Assertions.assertEquals("w", model.numberOfWorkers());
        Assertions.assertEquals("edenrexkxbhxv", model.optimizer());
        Assertions.assertEquals("nul", model.randomSeed());
        Assertions.assertEquals("nhj", model.stepLRGamma());
        Assertions.assertEquals("dyznfajsvks", model.stepLRStepSize());
        Assertions.assertEquals("qozzkivyhjrliizj", model.trainingBatchSize());
        Assertions.assertEquals("lqfhefkwabs", model.validationBatchSize());
        Assertions.assertEquals("ron", model.warmupCosineLRCycles());
        Assertions.assertEquals("lmgnlqxsjx", model.warmupCosineLRWarmupEpochs());
        Assertions.assertEquals("lexhv", model.weightDecay());
    }
}
