"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.Monitor = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog monitor resource. This can be used to create and manage Datadog monitors.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * const foo = new datadog.Monitor("foo", {
 *     name: "Name for monitor foo",
 *     type: "metric alert",
 *     message: "Monitor triggered. Notify: @hipchat-channel",
 *     escalationMessage: "Escalation message @pagerduty",
 *     query: "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo} by {host} > 4",
 *     monitorThresholds: {
 *         warning: "2",
 *         critical: "4",
 *     },
 *     includeTags: true,
 *     tags: [
 *         "foo:bar",
 *         "team:fooBar",
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * ```sh
 * $ pulumi import datadog:index/monitor:Monitor bytes_received_localhost 2081
 * ```
 */
class Monitor extends pulumi.CustomResource {
    /**
     * Get an existing Monitor 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 Monitor(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/monitor:Monitor';
    /**
     * Returns true if the given object is an instance of Monitor.  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'] === Monitor.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["assets"] = state?.assets;
            resourceInputs["draftStatus"] = state?.draftStatus;
            resourceInputs["enableLogsSample"] = state?.enableLogsSample;
            resourceInputs["enableSamples"] = state?.enableSamples;
            resourceInputs["escalationMessage"] = state?.escalationMessage;
            resourceInputs["evaluationDelay"] = state?.evaluationDelay;
            resourceInputs["forceDelete"] = state?.forceDelete;
            resourceInputs["groupRetentionDuration"] = state?.groupRetentionDuration;
            resourceInputs["groupbySimpleMonitor"] = state?.groupbySimpleMonitor;
            resourceInputs["includeTags"] = state?.includeTags;
            resourceInputs["message"] = state?.message;
            resourceInputs["monitorThresholdWindows"] = state?.monitorThresholdWindows;
            resourceInputs["monitorThresholds"] = state?.monitorThresholds;
            resourceInputs["name"] = state?.name;
            resourceInputs["newGroupDelay"] = state?.newGroupDelay;
            resourceInputs["newHostDelay"] = state?.newHostDelay;
            resourceInputs["noDataTimeframe"] = state?.noDataTimeframe;
            resourceInputs["notificationPresetName"] = state?.notificationPresetName;
            resourceInputs["notifyAudit"] = state?.notifyAudit;
            resourceInputs["notifyBies"] = state?.notifyBies;
            resourceInputs["notifyNoData"] = state?.notifyNoData;
            resourceInputs["onMissingData"] = state?.onMissingData;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["query"] = state?.query;
            resourceInputs["renotifyInterval"] = state?.renotifyInterval;
            resourceInputs["renotifyOccurrences"] = state?.renotifyOccurrences;
            resourceInputs["renotifyStatuses"] = state?.renotifyStatuses;
            resourceInputs["requireFullWindow"] = state?.requireFullWindow;
            resourceInputs["restrictedRoles"] = state?.restrictedRoles;
            resourceInputs["schedulingOptions"] = state?.schedulingOptions;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["timeoutH"] = state?.timeoutH;
            resourceInputs["type"] = state?.type;
            resourceInputs["validate"] = state?.validate;
            resourceInputs["variables"] = state?.variables;
        }
        else {
            const args = argsOrState;
            if (args?.message === undefined && !opts.urn) {
                throw new Error("Missing required property 'message'");
            }
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            if (args?.query === undefined && !opts.urn) {
                throw new Error("Missing required property 'query'");
            }
            if (args?.type === undefined && !opts.urn) {
                throw new Error("Missing required property 'type'");
            }
            resourceInputs["assets"] = args?.assets;
            resourceInputs["draftStatus"] = args?.draftStatus;
            resourceInputs["enableLogsSample"] = args?.enableLogsSample;
            resourceInputs["enableSamples"] = args?.enableSamples;
            resourceInputs["escalationMessage"] = args?.escalationMessage;
            resourceInputs["evaluationDelay"] = args?.evaluationDelay;
            resourceInputs["forceDelete"] = args?.forceDelete;
            resourceInputs["groupRetentionDuration"] = args?.groupRetentionDuration;
            resourceInputs["groupbySimpleMonitor"] = args?.groupbySimpleMonitor;
            resourceInputs["includeTags"] = args?.includeTags;
            resourceInputs["message"] = args?.message;
            resourceInputs["monitorThresholdWindows"] = args?.monitorThresholdWindows;
            resourceInputs["monitorThresholds"] = args?.monitorThresholds;
            resourceInputs["name"] = args?.name;
            resourceInputs["newGroupDelay"] = args?.newGroupDelay;
            resourceInputs["newHostDelay"] = args?.newHostDelay;
            resourceInputs["noDataTimeframe"] = args?.noDataTimeframe;
            resourceInputs["notificationPresetName"] = args?.notificationPresetName;
            resourceInputs["notifyAudit"] = args?.notifyAudit;
            resourceInputs["notifyBies"] = args?.notifyBies;
            resourceInputs["notifyNoData"] = args?.notifyNoData;
            resourceInputs["onMissingData"] = args?.onMissingData;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["query"] = args?.query;
            resourceInputs["renotifyInterval"] = args?.renotifyInterval;
            resourceInputs["renotifyOccurrences"] = args?.renotifyOccurrences;
            resourceInputs["renotifyStatuses"] = args?.renotifyStatuses;
            resourceInputs["requireFullWindow"] = args?.requireFullWindow;
            resourceInputs["restrictedRoles"] = args?.restrictedRoles;
            resourceInputs["schedulingOptions"] = args?.schedulingOptions;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["timeoutH"] = args?.timeoutH;
            resourceInputs["type"] = args?.type;
            resourceInputs["validate"] = args?.validate;
            resourceInputs["variables"] = args?.variables;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Monitor.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Monitor = Monitor;
//# sourceMappingURL=monitor.js.map