// 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.resourcemanager.paloaltonetworks.ngfw.models.ActionEnum;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Category;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DecryptionRuleTypeEnum;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DestinationAddr;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo;
import java.util.Arrays;

/** Samples for LocalRules CreateOrUpdate. */
public final class LocalRulesCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_CreateOrUpdate_MinimumSet_Gen.json
     */
    /**
     * Sample code: LocalRules_CreateOrUpdate_MinimumSet_Gen.
     *
     * @param manager Entry point to PaloAltoNetworksNgfwManager.
     */
    public static void localRulesCreateOrUpdateMinimumSetGen(
        com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) {
        manager
            .localRules()
            .define("1")
            .withExistingLocalRulestack("firewall-rg", "lrs1")
            .withRuleName("localRule1")
            .create();
    }

    /*
     * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2022-08-29/examples/LocalRules_CreateOrUpdate_MaximumSet_Gen.json
     */
    /**
     * Sample code: LocalRules_CreateOrUpdate_MaximumSet_Gen.
     *
     * @param manager Entry point to PaloAltoNetworksNgfwManager.
     */
    public static void localRulesCreateOrUpdateMaximumSetGen(
        com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) {
        manager
            .localRules()
            .define("1")
            .withExistingLocalRulestack("firewall-rg", "lrs1")
            .withRuleName("localRule1")
            .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value")))
            .withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0")
            .withDescription("description of local rule")
            .withRuleState(StateEnum.DISABLED)
            .withSource(
                new SourceAddr()
                    .withCidrs(Arrays.asList("1.0.0.1/10"))
                    .withCountries(Arrays.asList("India"))
                    .withFeeds(Arrays.asList("feed"))
                    .withPrefixLists(Arrays.asList("PL1")))
            .withNegateSource(BooleanEnum.TRUE)
            .withDestination(
                new DestinationAddr()
                    .withCidrs(Arrays.asList("1.0.0.1/10"))
                    .withCountries(Arrays.asList("India"))
                    .withFeeds(Arrays.asList("feed"))
                    .withPrefixLists(Arrays.asList("PL1"))
                    .withFqdnLists(Arrays.asList("FQDN1")))
            .withNegateDestination(BooleanEnum.TRUE)
            .withApplications(Arrays.asList("app1"))
            .withCategory(
                new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed")))
            .withProtocol("HTTP")
            .withProtocolPortList(Arrays.asList("80"))
            .withInboundInspectionCertificate("cert1")
            .withAuditComment("example comment")
            .withActionType(ActionEnum.ALLOW)
            .withEnableLogging(StateEnum.DISABLED)
            .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION)
            .create();
    }
}
