"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.EventRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage cloud monitor event rule
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.cloud_monitor.EventRule("foo", {
 *     contactGroupIds: [
 *         "1737941730782699520",
 *         "1737940985502777344",
 *     ],
 *     contactMethods: [
 *         "Phone",
 *         "TLS",
 *         "MQ",
 *     ],
 *     effectiveTime: {
 *         endTime: "22:00",
 *         startTime: "01:00",
 *     },
 *     eventSource: "ecs",
 *     eventTypes: ["ecs:Disk:DiskError.Redeploy.Canceled"],
 *     filterPattern: {
 *         source: "ecs",
 *         types: ["ecs:Disk:DiskError.Redeploy.Canceled"],
 *     },
 *     level: "notice",
 *     messageQueues: [{
 *         instanceId: "kafka-cnoe4rfrsqfb1d64",
 *         region: "*****",
 *         topic: "tftest",
 *         type: "kafka",
 *         vpcId: "vpc-2d68hz41j7qio58ozfd6jxgtb",
 *     }],
 *     ruleName: "tftest1",
 *     status: "enable",
 *     tlsTargets: [{
 *         projectId: "17ba378d-de43-495e-8906-03ae6567b376",
 *         projectName: "tf-test",
 *         regionNameCn: "*****",
 *         regionNameEn: "*****",
 *         topicId: "7ce12237-6670-44a7-9d79-2e36961586e6",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * CloudMonitorEventRule can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:cloud_monitor/eventRule:EventRule default rule_id
 * ```
 */
class EventRule extends pulumi.CustomResource {
    /**
     * Get an existing EventRule 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 EventRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of EventRule.  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'] === EventRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["contactGroupIds"] = state ? state.contactGroupIds : undefined;
            resourceInputs["contactMethods"] = state ? state.contactMethods : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["effectiveTime"] = state ? state.effectiveTime : undefined;
            resourceInputs["endpoint"] = state ? state.endpoint : undefined;
            resourceInputs["eventSource"] = state ? state.eventSource : undefined;
            resourceInputs["eventTypes"] = state ? state.eventTypes : undefined;
            resourceInputs["filterPattern"] = state ? state.filterPattern : undefined;
            resourceInputs["level"] = state ? state.level : undefined;
            resourceInputs["messageQueues"] = state ? state.messageQueues : undefined;
            resourceInputs["ruleName"] = state ? state.ruleName : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["tlsTargets"] = state ? state.tlsTargets : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.contactMethods === undefined) && !opts.urn) {
                throw new Error("Missing required property 'contactMethods'");
            }
            if ((!args || args.effectiveTime === undefined) && !opts.urn) {
                throw new Error("Missing required property 'effectiveTime'");
            }
            if ((!args || args.eventSource === undefined) && !opts.urn) {
                throw new Error("Missing required property 'eventSource'");
            }
            if ((!args || args.filterPattern === undefined) && !opts.urn) {
                throw new Error("Missing required property 'filterPattern'");
            }
            if ((!args || args.level === undefined) && !opts.urn) {
                throw new Error("Missing required property 'level'");
            }
            if ((!args || args.ruleName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'ruleName'");
            }
            resourceInputs["contactGroupIds"] = args ? args.contactGroupIds : undefined;
            resourceInputs["contactMethods"] = args ? args.contactMethods : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["effectiveTime"] = args ? args.effectiveTime : undefined;
            resourceInputs["endpoint"] = args ? args.endpoint : undefined;
            resourceInputs["eventSource"] = args ? args.eventSource : undefined;
            resourceInputs["eventTypes"] = args ? args.eventTypes : undefined;
            resourceInputs["filterPattern"] = args ? args.filterPattern : undefined;
            resourceInputs["level"] = args ? args.level : undefined;
            resourceInputs["messageQueues"] = args ? args.messageQueues : undefined;
            resourceInputs["ruleName"] = args ? args.ruleName : undefined;
            resourceInputs["status"] = args ? args.status : undefined;
            resourceInputs["tlsTargets"] = args ? args.tlsTargets : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(EventRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.EventRule = EventRule;
/** @internal */
EventRule.__pulumiType = 'volcengine:cloud_monitor/eventRule:EventRule';
//# sourceMappingURL=eventRule.js.map