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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackResourceUpdateProperties;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class GlobalRulestackResourceUpdatePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        GlobalRulestackResourceUpdateProperties model =
            BinaryData
                .fromString(
                    "{\"panEtag\":\"wisdkft\",\"panLocation\":\"xmnteiwaop\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"c\",\"mxdcufufsrp\",\"mzidnsezcxtb\",\"sgfyccsnew\"],\"description\":\"wzjeiach\",\"defaultMode\":\"FIREWALL\",\"minAppIdVersion\":\"flnrosfqpteehzz\",\"securityServices\":{\"vulnerabilityProfile\":\"yqrimzin\",\"antiSpywareProfile\":\"swjdkirso\",\"antiVirusProfile\":\"qxhcrmn\",\"urlFilteringProfile\":\"jtckwhdso\",\"fileBlockingProfile\":\"iy\",\"dnsSubscription\":\"jxsqwpgrjbz\",\"outboundUnTrustCertificate\":\"rcjxvsnbyxqabn\",\"outboundTrustCertificate\":\"cpc\"}}")
                .toObject(GlobalRulestackResourceUpdateProperties.class);
        Assertions.assertEquals("wisdkft", model.panEtag());
        Assertions.assertEquals("xmnteiwaop", model.panLocation());
        Assertions.assertEquals(ScopeType.GLOBAL, model.scope());
        Assertions.assertEquals("c", model.associatedSubscriptions().get(0));
        Assertions.assertEquals("wzjeiach", model.description());
        Assertions.assertEquals(DefaultMode.FIREWALL, model.defaultMode());
        Assertions.assertEquals("flnrosfqpteehzz", model.minAppIdVersion());
        Assertions.assertEquals("yqrimzin", model.securityServices().vulnerabilityProfile());
        Assertions.assertEquals("swjdkirso", model.securityServices().antiSpywareProfile());
        Assertions.assertEquals("qxhcrmn", model.securityServices().antiVirusProfile());
        Assertions.assertEquals("jtckwhdso", model.securityServices().urlFilteringProfile());
        Assertions.assertEquals("iy", model.securityServices().fileBlockingProfile());
        Assertions.assertEquals("jxsqwpgrjbz", model.securityServices().dnsSubscription());
        Assertions.assertEquals("rcjxvsnbyxqabn", model.securityServices().outboundUnTrustCertificate());
        Assertions.assertEquals("cpc", model.securityServices().outboundTrustCertificate());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        GlobalRulestackResourceUpdateProperties model =
            new GlobalRulestackResourceUpdateProperties()
                .withPanEtag("wisdkft")
                .withPanLocation("xmnteiwaop")
                .withScope(ScopeType.GLOBAL)
                .withAssociatedSubscriptions(Arrays.asList("c", "mxdcufufsrp", "mzidnsezcxtb", "sgfyccsnew"))
                .withDescription("wzjeiach")
                .withDefaultMode(DefaultMode.FIREWALL)
                .withMinAppIdVersion("flnrosfqpteehzz")
                .withSecurityServices(
                    new SecurityServices()
                        .withVulnerabilityProfile("yqrimzin")
                        .withAntiSpywareProfile("swjdkirso")
                        .withAntiVirusProfile("qxhcrmn")
                        .withUrlFilteringProfile("jtckwhdso")
                        .withFileBlockingProfile("iy")
                        .withDnsSubscription("jxsqwpgrjbz")
                        .withOutboundUnTrustCertificate("rcjxvsnbyxqabn")
                        .withOutboundTrustCertificate("cpc"));
        model = BinaryData.fromObject(model).toObject(GlobalRulestackResourceUpdateProperties.class);
        Assertions.assertEquals("wisdkft", model.panEtag());
        Assertions.assertEquals("xmnteiwaop", model.panLocation());
        Assertions.assertEquals(ScopeType.GLOBAL, model.scope());
        Assertions.assertEquals("c", model.associatedSubscriptions().get(0));
        Assertions.assertEquals("wzjeiach", model.description());
        Assertions.assertEquals(DefaultMode.FIREWALL, model.defaultMode());
        Assertions.assertEquals("flnrosfqpteehzz", model.minAppIdVersion());
        Assertions.assertEquals("yqrimzin", model.securityServices().vulnerabilityProfile());
        Assertions.assertEquals("swjdkirso", model.securityServices().antiSpywareProfile());
        Assertions.assertEquals("qxhcrmn", model.securityServices().antiVirusProfile());
        Assertions.assertEquals("jtckwhdso", model.securityServices().urlFilteringProfile());
        Assertions.assertEquals("iy", model.securityServices().fileBlockingProfile());
        Assertions.assertEquals("jxsqwpgrjbz", model.securityServices().dnsSubscription());
        Assertions.assertEquals("rcjxvsnbyxqabn", model.securityServices().outboundUnTrustCertificate());
        Assertions.assertEquals("cpc", model.securityServices().outboundTrustCertificate());
    }
}
