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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.models.SsisEnvironmentReference;
import com.azure.resourcemanager.synapse.models.SsisParameter;
import com.azure.resourcemanager.synapse.models.SsisProject;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SsisProjectTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SsisProject model =
            BinaryData
                .fromString(
                    "{\"type\":\"Project\",\"folderId\":5740210743517169719,\"version\":5762565506238596014,\"environmentRefs\":[{\"id\":5678973155741934160,\"environmentFolderName\":\"qba\",\"environmentName\":\"icqchygtv\",\"referenceType\":\"yjanepubdp\"},{\"id\":7570580498222762249,\"environmentFolderName\":\"gx\",\"environmentName\":\"od\",\"referenceType\":\"vohkxdxuws\"},{\"id\":8618235098095691375,\"environmentFolderName\":\"wnosbzlehgcvkbck\",\"environmentName\":\"olg\",\"referenceType\":\"yxpvelszerqze\"},{\"id\":301493278477517465,\"environmentFolderName\":\"intxwa\",\"environmentName\":\"glzoblqwa\",\"referenceType\":\"r\"}],\"parameters\":[{\"id\":2044046453123145189,\"name\":\"qb\",\"description\":\"vafjrqpjiyrqj\",\"dataType\":\"gaxwmzwdfkbnrzo\",\"required\":false,\"sensitive\":true,\"designDefaultValue\":\"qctqjfg\",\"defaultValue\":\"saetgzdgvpyig\",\"sensitiveDefaultValue\":\"qqil\",\"valueType\":\"cduwjoedx\",\"valueSet\":true,\"variable\":\"aifpaurwwgil\"}],\"id\":3426400212722100237,\"name\":\"cdmkxwxdcvjw\",\"description\":\"z\"}")
                .toObject(SsisProject.class);
        Assertions.assertEquals(3426400212722100237L, model.id());
        Assertions.assertEquals("cdmkxwxdcvjw", model.name());
        Assertions.assertEquals("z", model.description());
        Assertions.assertEquals(5740210743517169719L, model.folderId());
        Assertions.assertEquals(5762565506238596014L, model.version());
        Assertions.assertEquals(5678973155741934160L, model.environmentRefs().get(0).id());
        Assertions.assertEquals("qba", model.environmentRefs().get(0).environmentFolderName());
        Assertions.assertEquals("icqchygtv", model.environmentRefs().get(0).environmentName());
        Assertions.assertEquals("yjanepubdp", model.environmentRefs().get(0).referenceType());
        Assertions.assertEquals(2044046453123145189L, model.parameters().get(0).id());
        Assertions.assertEquals("qb", model.parameters().get(0).name());
        Assertions.assertEquals("vafjrqpjiyrqj", model.parameters().get(0).description());
        Assertions.assertEquals("gaxwmzwdfkbnrzo", model.parameters().get(0).dataType());
        Assertions.assertEquals(false, model.parameters().get(0).required());
        Assertions.assertEquals(true, model.parameters().get(0).sensitive());
        Assertions.assertEquals("qctqjfg", model.parameters().get(0).designDefaultValue());
        Assertions.assertEquals("saetgzdgvpyig", model.parameters().get(0).defaultValue());
        Assertions.assertEquals("qqil", model.parameters().get(0).sensitiveDefaultValue());
        Assertions.assertEquals("cduwjoedx", model.parameters().get(0).valueType());
        Assertions.assertEquals(true, model.parameters().get(0).valueSet());
        Assertions.assertEquals("aifpaurwwgil", model.parameters().get(0).variable());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SsisProject model =
            new SsisProject()
                .withId(3426400212722100237L)
                .withName("cdmkxwxdcvjw")
                .withDescription("z")
                .withFolderId(5740210743517169719L)
                .withVersion(5762565506238596014L)
                .withEnvironmentRefs(
                    Arrays
                        .asList(
                            new SsisEnvironmentReference()
                                .withId(5678973155741934160L)
                                .withEnvironmentFolderName("qba")
                                .withEnvironmentName("icqchygtv")
                                .withReferenceType("yjanepubdp"),
                            new SsisEnvironmentReference()
                                .withId(7570580498222762249L)
                                .withEnvironmentFolderName("gx")
                                .withEnvironmentName("od")
                                .withReferenceType("vohkxdxuws"),
                            new SsisEnvironmentReference()
                                .withId(8618235098095691375L)
                                .withEnvironmentFolderName("wnosbzlehgcvkbck")
                                .withEnvironmentName("olg")
                                .withReferenceType("yxpvelszerqze"),
                            new SsisEnvironmentReference()
                                .withId(301493278477517465L)
                                .withEnvironmentFolderName("intxwa")
                                .withEnvironmentName("glzoblqwa")
                                .withReferenceType("r")))
                .withParameters(
                    Arrays
                        .asList(
                            new SsisParameter()
                                .withId(2044046453123145189L)
                                .withName("qb")
                                .withDescription("vafjrqpjiyrqj")
                                .withDataType("gaxwmzwdfkbnrzo")
                                .withRequired(false)
                                .withSensitive(true)
                                .withDesignDefaultValue("qctqjfg")
                                .withDefaultValue("saetgzdgvpyig")
                                .withSensitiveDefaultValue("qqil")
                                .withValueType("cduwjoedx")
                                .withValueSet(true)
                                .withVariable("aifpaurwwgil")));
        model = BinaryData.fromObject(model).toObject(SsisProject.class);
        Assertions.assertEquals(3426400212722100237L, model.id());
        Assertions.assertEquals("cdmkxwxdcvjw", model.name());
        Assertions.assertEquals("z", model.description());
        Assertions.assertEquals(5740210743517169719L, model.folderId());
        Assertions.assertEquals(5762565506238596014L, model.version());
        Assertions.assertEquals(5678973155741934160L, model.environmentRefs().get(0).id());
        Assertions.assertEquals("qba", model.environmentRefs().get(0).environmentFolderName());
        Assertions.assertEquals("icqchygtv", model.environmentRefs().get(0).environmentName());
        Assertions.assertEquals("yjanepubdp", model.environmentRefs().get(0).referenceType());
        Assertions.assertEquals(2044046453123145189L, model.parameters().get(0).id());
        Assertions.assertEquals("qb", model.parameters().get(0).name());
        Assertions.assertEquals("vafjrqpjiyrqj", model.parameters().get(0).description());
        Assertions.assertEquals("gaxwmzwdfkbnrzo", model.parameters().get(0).dataType());
        Assertions.assertEquals(false, model.parameters().get(0).required());
        Assertions.assertEquals(true, model.parameters().get(0).sensitive());
        Assertions.assertEquals("qctqjfg", model.parameters().get(0).designDefaultValue());
        Assertions.assertEquals("saetgzdgvpyig", model.parameters().get(0).defaultValue());
        Assertions.assertEquals("qqil", model.parameters().get(0).sensitiveDefaultValue());
        Assertions.assertEquals("cduwjoedx", model.parameters().get(0).valueType());
        Assertions.assertEquals(true, model.parameters().get(0).valueSet());
        Assertions.assertEquals("aifpaurwwgil", model.parameters().get(0).variable());
    }
}
