"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppFirewallPolicy = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Web App Firewall Policy resource in Oracle Cloud Infrastructure Waf service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/waf/latest/WebAppFirewallPolicy
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/web_app_firewall
 *
 * Creates a new WebAppFirewallPolicy.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testWebAppFirewallPolicy = new oci.waf.AppFirewallPolicy("test_web_app_firewall_policy", {
 *     compartmentId: compartmentId,
 *     actions: [{
 *         name: webAppFirewallPolicyActionsName,
 *         type: webAppFirewallPolicyActionsType,
 *         body: {
 *             text: webAppFirewallPolicyActionsBodyText,
 *             type: webAppFirewallPolicyActionsBodyType,
 *         },
 *         code: Number(webAppFirewallPolicyActionsCode),
 *         headers: [{
 *             name: webAppFirewallPolicyActionsHeadersName,
 *             value: webAppFirewallPolicyActionsHeadersValue,
 *         }],
 *     }],
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     displayName: webAppFirewallPolicyDisplayName,
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     requestAccessControl: {
 *         defaultActionName: webAppFirewallPolicyRequestAccessControlDefaultActionName,
 *         rules: [{
 *             actionName: webAppFirewallPolicyRequestAccessControlRulesActionName,
 *             name: webAppFirewallPolicyRequestAccessControlRulesName,
 *             type: webAppFirewallPolicyRequestAccessControlRulesType,
 *             condition: webAppFirewallPolicyRequestAccessControlRulesCondition,
 *             conditionLanguage: webAppFirewallPolicyRequestAccessControlRulesConditionLanguage,
 *         }],
 *     },
 *     requestProtection: {
 *         bodyInspectionSizeLimitExceededActionName: webAppFirewallPolicyRequestProtectionBodyInspectionSizeLimitExceededActionName,
 *         bodyInspectionSizeLimitInBytes: Number(webAppFirewallPolicyRequestProtectionBodyInspectionSizeLimitInBytes),
 *         rules: [{
 *             actionName: webAppFirewallPolicyRequestProtectionRulesActionName,
 *             name: webAppFirewallPolicyRequestProtectionRulesName,
 *             protectionCapabilities: [{
 *                 key: webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesKey,
 *                 version: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesVersion),
 *                 actionName: webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesActionName,
 *                 collaborativeActionThreshold: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesCollaborativeActionThreshold),
 *                 collaborativeWeights: [{
 *                     key: webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesCollaborativeWeightsKey,
 *                     weight: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesCollaborativeWeightsWeight),
 *                 }],
 *                 exclusions: {
 *                     args: webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesExclusionsArgs,
 *                     requestCookies: webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitiesExclusionsRequestCookies,
 *                 },
 *             }],
 *             type: webAppFirewallPolicyRequestProtectionRulesType,
 *             condition: webAppFirewallPolicyRequestProtectionRulesCondition,
 *             conditionLanguage: webAppFirewallPolicyRequestProtectionRulesConditionLanguage,
 *             isBodyInspectionEnabled: webAppFirewallPolicyRequestProtectionRulesIsBodyInspectionEnabled === "true",
 *             protectionCapabilitySettings: {
 *                 allowedHttpMethods: webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitySettingsAllowedHttpMethods,
 *                 maxHttpRequestHeaderLength: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitySettingsMaxHttpRequestHeaderLength),
 *                 maxHttpRequestHeaders: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitySettingsMaxHttpRequestHeaders),
 *                 maxNumberOfArguments: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitySettingsMaxNumberOfArguments),
 *                 maxSingleArgumentLength: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitySettingsMaxSingleArgumentLength),
 *                 maxTotalArgumentLength: Number(webAppFirewallPolicyRequestProtectionRulesProtectionCapabilitySettingsMaxTotalArgumentLength),
 *             },
 *         }],
 *     },
 *     requestRateLimiting: {
 *         rules: [{
 *             actionName: webAppFirewallPolicyRequestRateLimitingRulesActionName,
 *             configurations: [{
 *                 periodInSeconds: Number(webAppFirewallPolicyRequestRateLimitingRulesConfigurationsPeriodInSeconds),
 *                 requestsLimit: Number(webAppFirewallPolicyRequestRateLimitingRulesConfigurationsRequestsLimit),
 *                 actionDurationInSeconds: Number(webAppFirewallPolicyRequestRateLimitingRulesConfigurationsActionDurationInSeconds),
 *             }],
 *             name: webAppFirewallPolicyRequestRateLimitingRulesName,
 *             type: webAppFirewallPolicyRequestRateLimitingRulesType,
 *             condition: webAppFirewallPolicyRequestRateLimitingRulesCondition,
 *             conditionLanguage: webAppFirewallPolicyRequestRateLimitingRulesConditionLanguage,
 *         }],
 *     },
 *     responseAccessControl: {
 *         rules: [{
 *             actionName: webAppFirewallPolicyResponseAccessControlRulesActionName,
 *             name: webAppFirewallPolicyResponseAccessControlRulesName,
 *             type: webAppFirewallPolicyResponseAccessControlRulesType,
 *             condition: webAppFirewallPolicyResponseAccessControlRulesCondition,
 *             conditionLanguage: webAppFirewallPolicyResponseAccessControlRulesConditionLanguage,
 *         }],
 *     },
 *     responseProtection: {
 *         rules: [{
 *             actionName: webAppFirewallPolicyResponseProtectionRulesActionName,
 *             name: webAppFirewallPolicyResponseProtectionRulesName,
 *             protectionCapabilities: [{
 *                 key: webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesKey,
 *                 version: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesVersion),
 *                 actionName: webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesActionName,
 *                 collaborativeActionThreshold: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesCollaborativeActionThreshold),
 *                 collaborativeWeights: [{
 *                     key: webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesCollaborativeWeightsKey,
 *                     weight: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesCollaborativeWeightsWeight),
 *                 }],
 *                 exclusions: {
 *                     args: webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesExclusionsArgs,
 *                     requestCookies: webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitiesExclusionsRequestCookies,
 *                 },
 *             }],
 *             type: webAppFirewallPolicyResponseProtectionRulesType,
 *             condition: webAppFirewallPolicyResponseProtectionRulesCondition,
 *             conditionLanguage: webAppFirewallPolicyResponseProtectionRulesConditionLanguage,
 *             isBodyInspectionEnabled: webAppFirewallPolicyResponseProtectionRulesIsBodyInspectionEnabled === "true",
 *             protectionCapabilitySettings: {
 *                 allowedHttpMethods: webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitySettingsAllowedHttpMethods,
 *                 maxHttpRequestHeaderLength: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitySettingsMaxHttpRequestHeaderLength),
 *                 maxHttpRequestHeaders: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitySettingsMaxHttpRequestHeaders),
 *                 maxNumberOfArguments: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitySettingsMaxNumberOfArguments),
 *                 maxSingleArgumentLength: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitySettingsMaxSingleArgumentLength),
 *                 maxTotalArgumentLength: Number(webAppFirewallPolicyResponseProtectionRulesProtectionCapabilitySettingsMaxTotalArgumentLength),
 *             },
 *         }],
 *     },
 *     systemTags: webAppFirewallPolicySystemTags,
 * });
 * ```
 *
 * ## Import
 *
 * WebAppFirewallPolicies can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Waf/appFirewallPolicy:AppFirewallPolicy test_web_app_firewall_policy "id"
 * ```
 */
class AppFirewallPolicy extends pulumi.CustomResource {
    /**
     * Get an existing AppFirewallPolicy resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new AppFirewallPolicy(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Waf/appFirewallPolicy:AppFirewallPolicy';
    /**
     * Returns true if the given object is an instance of AppFirewallPolicy.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === AppFirewallPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["actions"] = state?.actions;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["requestAccessControl"] = state?.requestAccessControl;
            resourceInputs["requestProtection"] = state?.requestProtection;
            resourceInputs["requestRateLimiting"] = state?.requestRateLimiting;
            resourceInputs["responseAccessControl"] = state?.responseAccessControl;
            resourceInputs["responseProtection"] = state?.responseProtection;
            resourceInputs["state"] = state?.state;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            resourceInputs["actions"] = args?.actions;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["requestAccessControl"] = args?.requestAccessControl;
            resourceInputs["requestProtection"] = args?.requestProtection;
            resourceInputs["requestRateLimiting"] = args?.requestRateLimiting;
            resourceInputs["responseAccessControl"] = args?.responseAccessControl;
            resourceInputs["responseProtection"] = args?.responseProtection;
            resourceInputs["systemTags"] = args?.systemTags;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(AppFirewallPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AppFirewallPolicy = AppFirewallPolicy;
//# sourceMappingURL=appFirewallPolicy.js.map