"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.CustomPage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage waf custom page
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.waf.CustomPage("foo", {
 *     accurate: {
 *         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,
 *     },
 *     advanced: 1,
 *     body: "tf-test-body",
 *     clientIp: "ALL",
 *     code: 403,
 *     contentType: "text/html",
 *     description: "tf-test",
 *     enable: 1,
 *     host: "www.123.com",
 *     pageMode: 1,
 *     policy: 1,
 *     projectName: "default",
 *     redirectUrl: "/test/tf/path",
 *     url: "/tf-test",
 * });
 * ```
 *
 * ## Import
 *
 * WafCustomPage can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:waf/customPage:CustomPage default resource_id:Host
 * ```
 */
class CustomPage extends pulumi.CustomResource {
    /**
     * Get an existing CustomPage 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 CustomPage(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of CustomPage.  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'] === CustomPage.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accurate"] = state ? state.accurate : undefined;
            resourceInputs["advanced"] = state ? state.advanced : undefined;
            resourceInputs["body"] = state ? state.body : undefined;
            resourceInputs["clientIp"] = state ? state.clientIp : undefined;
            resourceInputs["code"] = state ? state.code : undefined;
            resourceInputs["contentType"] = state ? state.contentType : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["enable"] = state ? state.enable : undefined;
            resourceInputs["groupId"] = state ? state.groupId : undefined;
            resourceInputs["header"] = state ? state.header : undefined;
            resourceInputs["host"] = state ? state.host : undefined;
            resourceInputs["isolationId"] = state ? state.isolationId : undefined;
            resourceInputs["name"] = state ? state.name : undefined;
            resourceInputs["pageMode"] = state ? state.pageMode : undefined;
            resourceInputs["policy"] = state ? state.policy : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["redirectUrl"] = state ? state.redirectUrl : undefined;
            resourceInputs["ruleTag"] = state ? state.ruleTag : undefined;
            resourceInputs["updateTime"] = state ? state.updateTime : undefined;
            resourceInputs["url"] = state ? state.url : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.clientIp === undefined) && !opts.urn) {
                throw new Error("Missing required property 'clientIp'");
            }
            if ((!args || args.code === undefined) && !opts.urn) {
                throw new Error("Missing required property 'code'");
            }
            if ((!args || args.enable === undefined) && !opts.urn) {
                throw new Error("Missing required property 'enable'");
            }
            if ((!args || args.host === undefined) && !opts.urn) {
                throw new Error("Missing required property 'host'");
            }
            if ((!args || args.pageMode === undefined) && !opts.urn) {
                throw new Error("Missing required property 'pageMode'");
            }
            if ((!args || args.policy === undefined) && !opts.urn) {
                throw new Error("Missing required property 'policy'");
            }
            if ((!args || args.url === undefined) && !opts.urn) {
                throw new Error("Missing required property 'url'");
            }
            resourceInputs["accurate"] = args ? args.accurate : undefined;
            resourceInputs["advanced"] = args ? args.advanced : undefined;
            resourceInputs["body"] = args ? args.body : undefined;
            resourceInputs["clientIp"] = args ? args.clientIp : undefined;
            resourceInputs["code"] = args ? args.code : undefined;
            resourceInputs["contentType"] = args ? args.contentType : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["enable"] = args ? args.enable : undefined;
            resourceInputs["host"] = args ? args.host : undefined;
            resourceInputs["name"] = args ? args.name : undefined;
            resourceInputs["pageMode"] = args ? args.pageMode : undefined;
            resourceInputs["policy"] = args ? args.policy : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["redirectUrl"] = args ? args.redirectUrl : undefined;
            resourceInputs["url"] = args ? args.url : undefined;
            resourceInputs["groupId"] = undefined /*out*/;
            resourceInputs["header"] = undefined /*out*/;
            resourceInputs["isolationId"] = undefined /*out*/;
            resourceInputs["ruleTag"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CustomPage.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CustomPage = CustomPage;
/** @internal */
CustomPage.__pulumiType = 'volcengine:waf/customPage:CustomPage';
//# sourceMappingURL=customPage.js.map