"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.BotAnalyseProtectRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage waf bot analyse protect rule
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.waf.BotAnalyseProtectRule("foo", {
 *     accurateGroup: {
 *         accurateRules: [
 *             {
 *                 httpObj: "request.uri",
 *                 objType: 1,
 *                 opretar: 2,
 *                 property: 0,
 *                 valueString: "tf",
 *             },
 *             {
 *                 httpObj: "request.schema",
 *                 objType: 0,
 *                 opretar: 2,
 *                 property: 0,
 *                 valueString: "tf-2",
 *             },
 *         ],
 *         logic: 2,
 *     },
 *     actionAfterVerification: 1,
 *     actionType: 1,
 *     effectTime: 1000,
 *     enable: 1,
 *     exemptionTime: 60,
 *     field: "HEADER:User-Agent",
 *     host: "www.tf-test.com",
 *     path: "/mod",
 *     pathThreshold: 1000,
 *     projectName: "default",
 *     rulePriority: 3,
 *     singleProportion: 0.25,
 *     singleThreshold: 100,
 *     statisticalDuration: 50,
 *     statisticalType: 2,
 * });
 * ```
 *
 * ## Import
 *
 * WafBotAnalyseProtectRule can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:waf/botAnalyseProtectRule:BotAnalyseProtectRule default resource_id:bot_space:host
 * ```
 */
class BotAnalyseProtectRule extends pulumi.CustomResource {
    /**
     * Get an existing BotAnalyseProtectRule 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 BotAnalyseProtectRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of BotAnalyseProtectRule.  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'] === BotAnalyseProtectRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accurateGroup"] = state ? state.accurateGroup : undefined;
            resourceInputs["actionAfterVerification"] = state ? state.actionAfterVerification : undefined;
            resourceInputs["actionType"] = state ? state.actionType : undefined;
            resourceInputs["effectTime"] = state ? state.effectTime : undefined;
            resourceInputs["enable"] = state ? state.enable : undefined;
            resourceInputs["enableCount"] = state ? state.enableCount : undefined;
            resourceInputs["exemptionTime"] = state ? state.exemptionTime : undefined;
            resourceInputs["field"] = state ? state.field : undefined;
            resourceInputs["host"] = state ? state.host : undefined;
            resourceInputs["name"] = state ? state.name : undefined;
            resourceInputs["path"] = state ? state.path : undefined;
            resourceInputs["pathThreshold"] = state ? state.pathThreshold : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["ruleGroups"] = state ? state.ruleGroups : undefined;
            resourceInputs["rulePriority"] = state ? state.rulePriority : undefined;
            resourceInputs["singleProportion"] = state ? state.singleProportion : undefined;
            resourceInputs["singleThreshold"] = state ? state.singleThreshold : undefined;
            resourceInputs["statisticalDuration"] = state ? state.statisticalDuration : undefined;
            resourceInputs["statisticalType"] = state ? state.statisticalType : undefined;
            resourceInputs["totalCount"] = state ? state.totalCount : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.actionType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'actionType'");
            }
            if ((!args || args.effectTime === undefined) && !opts.urn) {
                throw new Error("Missing required property 'effectTime'");
            }
            if ((!args || args.enable === undefined) && !opts.urn) {
                throw new Error("Missing required property 'enable'");
            }
            if ((!args || args.field === undefined) && !opts.urn) {
                throw new Error("Missing required property 'field'");
            }
            if ((!args || args.host === undefined) && !opts.urn) {
                throw new Error("Missing required property 'host'");
            }
            if ((!args || args.path === undefined) && !opts.urn) {
                throw new Error("Missing required property 'path'");
            }
            if ((!args || args.rulePriority === undefined) && !opts.urn) {
                throw new Error("Missing required property 'rulePriority'");
            }
            if ((!args || args.singleThreshold === undefined) && !opts.urn) {
                throw new Error("Missing required property 'singleThreshold'");
            }
            if ((!args || args.statisticalDuration === undefined) && !opts.urn) {
                throw new Error("Missing required property 'statisticalDuration'");
            }
            if ((!args || args.statisticalType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'statisticalType'");
            }
            resourceInputs["accurateGroup"] = args ? args.accurateGroup : undefined;
            resourceInputs["actionAfterVerification"] = args ? args.actionAfterVerification : undefined;
            resourceInputs["actionType"] = args ? args.actionType : undefined;
            resourceInputs["effectTime"] = args ? args.effectTime : undefined;
            resourceInputs["enable"] = args ? args.enable : undefined;
            resourceInputs["exemptionTime"] = args ? args.exemptionTime : undefined;
            resourceInputs["field"] = args ? args.field : undefined;
            resourceInputs["host"] = args ? args.host : undefined;
            resourceInputs["name"] = args ? args.name : undefined;
            resourceInputs["path"] = args ? args.path : undefined;
            resourceInputs["pathThreshold"] = args ? args.pathThreshold : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["rulePriority"] = args ? args.rulePriority : undefined;
            resourceInputs["singleProportion"] = args ? args.singleProportion : undefined;
            resourceInputs["singleThreshold"] = args ? args.singleThreshold : undefined;
            resourceInputs["statisticalDuration"] = args ? args.statisticalDuration : undefined;
            resourceInputs["statisticalType"] = args ? args.statisticalType : undefined;
            resourceInputs["enableCount"] = undefined /*out*/;
            resourceInputs["ruleGroups"] = undefined /*out*/;
            resourceInputs["totalCount"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(BotAnalyseProtectRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BotAnalyseProtectRule = BotAnalyseProtectRule;
/** @internal */
BotAnalyseProtectRule.__pulumiType = 'volcengine:waf/botAnalyseProtectRule:BotAnalyseProtectRule';
//# sourceMappingURL=botAnalyseProtectRule.js.map