"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.Alarm = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage tls alarm
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.tls.Alarm("foo", {
 *     alarmName: "test-terraform-tf",
 *     alarmNotifyGroups: ["bf3ecf26-2081-4e27-ae18-f44dbe5c6138"],
 *     alarmPeriodDetail: {
 *         email: 20,
 *         generalWebhook: 20,
 *         phone: 20,
 *         sms: 20,
 *     },
 *     projectId: "88d31abb-62c7-40f5-998e-889747c2a116",
 *     queryRequests: [{
 *         endTimeOffset: 0,
 *         endTimeOffsetUnit: "Minute",
 *         number: 1,
 *         query: "Failed | select count(*) as errNum",
 *         startTimeOffset: -15,
 *         startTimeOffsetUnit: "Minute",
 *         timeSpanType: "Relative",
 *         topicId: "a690a9b8-72c1-40a3-b8c6-f89a81d3748e",
 *         truncatedTime: "Minute",
 *     }],
 *     requestCycle: {
 *         time: 20,
 *         type: "Period",
 *     },
 *     sendResolved: false,
 *     status: true,
 *     triggerConditions: [{
 *         condition: "$1.errNum>0",
 *         countCondition: "__count__ > 0",
 *         noData: false,
 *         severity: "critical",
 *     }],
 *     triggerPeriod: 2,
 *     userDefineMsg: "test for terraform-modify",
 * });
 * ```
 *
 * ## Import
 *
 * tls alarm can be imported using the id and project id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:tls/alarm:Alarm default projectId:fc************
 * ```
 */
class Alarm extends pulumi.CustomResource {
    /**
     * Get an existing Alarm 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 Alarm(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Alarm.  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'] === Alarm.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["alarmId"] = state ? state.alarmId : undefined;
            resourceInputs["alarmName"] = state ? state.alarmName : undefined;
            resourceInputs["alarmNotifyGroups"] = state ? state.alarmNotifyGroups : undefined;
            resourceInputs["alarmPeriod"] = state ? state.alarmPeriod : undefined;
            resourceInputs["alarmPeriodDetail"] = state ? state.alarmPeriodDetail : undefined;
            resourceInputs["condition"] = state ? state.condition : undefined;
            resourceInputs["joinConfigurations"] = state ? state.joinConfigurations : undefined;
            resourceInputs["projectId"] = state ? state.projectId : undefined;
            resourceInputs["queryRequests"] = state ? state.queryRequests : undefined;
            resourceInputs["requestCycle"] = state ? state.requestCycle : undefined;
            resourceInputs["sendResolved"] = state ? state.sendResolved : undefined;
            resourceInputs["severity"] = state ? state.severity : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["triggerConditions"] = state ? state.triggerConditions : undefined;
            resourceInputs["triggerPeriod"] = state ? state.triggerPeriod : undefined;
            resourceInputs["userDefineMsg"] = state ? state.userDefineMsg : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.alarmName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'alarmName'");
            }
            if ((!args || args.alarmNotifyGroups === undefined) && !opts.urn) {
                throw new Error("Missing required property 'alarmNotifyGroups'");
            }
            if ((!args || args.projectId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'projectId'");
            }
            if ((!args || args.queryRequests === undefined) && !opts.urn) {
                throw new Error("Missing required property 'queryRequests'");
            }
            if ((!args || args.requestCycle === undefined) && !opts.urn) {
                throw new Error("Missing required property 'requestCycle'");
            }
            if ((!args || args.triggerPeriod === undefined) && !opts.urn) {
                throw new Error("Missing required property 'triggerPeriod'");
            }
            resourceInputs["alarmName"] = args ? args.alarmName : undefined;
            resourceInputs["alarmNotifyGroups"] = args ? args.alarmNotifyGroups : undefined;
            resourceInputs["alarmPeriod"] = args ? args.alarmPeriod : undefined;
            resourceInputs["alarmPeriodDetail"] = args ? args.alarmPeriodDetail : undefined;
            resourceInputs["condition"] = args ? args.condition : undefined;
            resourceInputs["joinConfigurations"] = args ? args.joinConfigurations : undefined;
            resourceInputs["projectId"] = args ? args.projectId : undefined;
            resourceInputs["queryRequests"] = args ? args.queryRequests : undefined;
            resourceInputs["requestCycle"] = args ? args.requestCycle : undefined;
            resourceInputs["sendResolved"] = args ? args.sendResolved : undefined;
            resourceInputs["severity"] = args ? args.severity : undefined;
            resourceInputs["status"] = args ? args.status : undefined;
            resourceInputs["triggerConditions"] = args ? args.triggerConditions : undefined;
            resourceInputs["triggerPeriod"] = args ? args.triggerPeriod : undefined;
            resourceInputs["userDefineMsg"] = args ? args.userDefineMsg : undefined;
            resourceInputs["alarmId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Alarm.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Alarm = Alarm;
/** @internal */
Alarm.__pulumiType = 'volcengine:tls/alarm:Alarm';
//# sourceMappingURL=alarm.js.map