// 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.fluent.models.RulestackProperties;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode;
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 RulestackPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RulestackProperties model =
            BinaryData
                .fromString(
                    "{\"panEtag\":\"i\",\"panLocation\":\"ayhuy\",\"scope\":\"LOCAL\",\"associatedSubscriptions\":[\"depoog\",\"nuvamiheogna\",\"xzxtheo\"],\"description\":\"si\",\"defaultMode\":\"IPS\",\"minAppIdVersion\":\"cciqihnhungbwjz\",\"provisioningState\":\"Accepted\",\"securityServices\":{\"vulnerabilityProfile\":\"xgispemvtzfkufu\",\"antiSpywareProfile\":\"jofxqe\",\"antiVirusProfile\":\"jaeq\",\"urlFilteringProfile\":\"qjbasvms\",\"fileBlockingProfile\":\"qulngsntnbybkzgc\",\"dnsSubscription\":\"wclxxwrl\",\"outboundUnTrustCertificate\":\"ouskcqvkocrc\",\"outboundTrustCertificate\":\"kwt\"}}")
                .toObject(RulestackProperties.class);
        Assertions.assertEquals("i", model.panEtag());
        Assertions.assertEquals("ayhuy", model.panLocation());
        Assertions.assertEquals(ScopeType.LOCAL, model.scope());
        Assertions.assertEquals("depoog", model.associatedSubscriptions().get(0));
        Assertions.assertEquals("si", model.description());
        Assertions.assertEquals(DefaultMode.IPS, model.defaultMode());
        Assertions.assertEquals("cciqihnhungbwjz", model.minAppIdVersion());
        Assertions.assertEquals("xgispemvtzfkufu", model.securityServices().vulnerabilityProfile());
        Assertions.assertEquals("jofxqe", model.securityServices().antiSpywareProfile());
        Assertions.assertEquals("jaeq", model.securityServices().antiVirusProfile());
        Assertions.assertEquals("qjbasvms", model.securityServices().urlFilteringProfile());
        Assertions.assertEquals("qulngsntnbybkzgc", model.securityServices().fileBlockingProfile());
        Assertions.assertEquals("wclxxwrl", model.securityServices().dnsSubscription());
        Assertions.assertEquals("ouskcqvkocrc", model.securityServices().outboundUnTrustCertificate());
        Assertions.assertEquals("kwt", model.securityServices().outboundTrustCertificate());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RulestackProperties model =
            new RulestackProperties()
                .withPanEtag("i")
                .withPanLocation("ayhuy")
                .withScope(ScopeType.LOCAL)
                .withAssociatedSubscriptions(Arrays.asList("depoog", "nuvamiheogna", "xzxtheo"))
                .withDescription("si")
                .withDefaultMode(DefaultMode.IPS)
                .withMinAppIdVersion("cciqihnhungbwjz")
                .withSecurityServices(
                    new SecurityServices()
                        .withVulnerabilityProfile("xgispemvtzfkufu")
                        .withAntiSpywareProfile("jofxqe")
                        .withAntiVirusProfile("jaeq")
                        .withUrlFilteringProfile("qjbasvms")
                        .withFileBlockingProfile("qulngsntnbybkzgc")
                        .withDnsSubscription("wclxxwrl")
                        .withOutboundUnTrustCertificate("ouskcqvkocrc")
                        .withOutboundTrustCertificate("kwt"));
        model = BinaryData.fromObject(model).toObject(RulestackProperties.class);
        Assertions.assertEquals("i", model.panEtag());
        Assertions.assertEquals("ayhuy", model.panLocation());
        Assertions.assertEquals(ScopeType.LOCAL, model.scope());
        Assertions.assertEquals("depoog", model.associatedSubscriptions().get(0));
        Assertions.assertEquals("si", model.description());
        Assertions.assertEquals(DefaultMode.IPS, model.defaultMode());
        Assertions.assertEquals("cciqihnhungbwjz", model.minAppIdVersion());
        Assertions.assertEquals("xgispemvtzfkufu", model.securityServices().vulnerabilityProfile());
        Assertions.assertEquals("jofxqe", model.securityServices().antiSpywareProfile());
        Assertions.assertEquals("jaeq", model.securityServices().antiVirusProfile());
        Assertions.assertEquals("qjbasvms", model.securityServices().urlFilteringProfile());
        Assertions.assertEquals("qulngsntnbybkzgc", model.securityServices().fileBlockingProfile());
        Assertions.assertEquals("wclxxwrl", model.securityServices().dnsSubscription());
        Assertions.assertEquals("ouskcqvkocrc", model.securityServices().outboundUnTrustCertificate());
        Assertions.assertEquals("kwt", model.securityServices().outboundTrustCertificate());
    }
}
