"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.IncidentNotificationRule = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog incident notification rule resource. This can be used to create and manage Datadog incident notification rules.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * const example = new datadog.IncidentType("example", {
 *     name: "My Incident Type",
 *     description: "Incident type for critical production issues",
 * });
 * const exampleIncidentNotificationTemplate = new datadog.IncidentNotificationTemplate("example", {
 *     name: "My Notification Template",
 *     subject: "SEV-1 Incident: {{incident.title}}",
 *     content: `An incident has been declared.
 *
 * Title: {{incident.title}}
 * Severity: {{incident.severity}}
 * Status: {{incident.status}}
 *
 * Please join the incident channel for updates.
 * `,
 *     category: "alert",
 *     incidentType: example.id,
 * });
 * const exampleIncidentNotificationRule = new datadog.IncidentNotificationRule("example", {
 *     enabled: true,
 *     trigger: "incident_created_trigger",
 *     visibility: "organization",
 *     handles: [
 *         "@team-email@company.com",
 *         "@slack-channel-alerts",
 *         "@pagerduty-service",
 *     ],
 *     conditions: [
 *         {
 *             field: "severity",
 *             values: [
 *                 "SEV-1",
 *                 "SEV-2",
 *             ],
 *         },
 *         {
 *             field: "services",
 *             values: [
 *                 "web-service",
 *                 "api-service",
 *                 "database-service",
 *             ],
 *         },
 *     ],
 *     renotifyOns: [
 *         "status",
 *         "severity",
 *     ],
 *     incidentType: example.id,
 *     notificationTemplate: exampleIncidentNotificationTemplate.id,
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * ```sh
 * $ pulumi import datadog:index/incidentNotificationRule:IncidentNotificationRule example "00000000-0000-0000-0000-000000000000"
 * ```
 */
class IncidentNotificationRule extends pulumi.CustomResource {
    /**
     * Get an existing IncidentNotificationRule 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 IncidentNotificationRule(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/incidentNotificationRule:IncidentNotificationRule';
    /**
     * Returns true if the given object is an instance of IncidentNotificationRule.  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'] === IncidentNotificationRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["conditions"] = state?.conditions;
            resourceInputs["created"] = state?.created;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["handles"] = state?.handles;
            resourceInputs["incidentType"] = state?.incidentType;
            resourceInputs["modified"] = state?.modified;
            resourceInputs["notificationTemplate"] = state?.notificationTemplate;
            resourceInputs["renotifyOns"] = state?.renotifyOns;
            resourceInputs["trigger"] = state?.trigger;
            resourceInputs["visibility"] = state?.visibility;
        }
        else {
            const args = argsOrState;
            if (args?.handles === undefined && !opts.urn) {
                throw new Error("Missing required property 'handles'");
            }
            if (args?.incidentType === undefined && !opts.urn) {
                throw new Error("Missing required property 'incidentType'");
            }
            if (args?.trigger === undefined && !opts.urn) {
                throw new Error("Missing required property 'trigger'");
            }
            resourceInputs["conditions"] = args?.conditions;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["handles"] = args?.handles;
            resourceInputs["incidentType"] = args?.incidentType;
            resourceInputs["notificationTemplate"] = args?.notificationTemplate;
            resourceInputs["renotifyOns"] = args?.renotifyOns;
            resourceInputs["trigger"] = args?.trigger;
            resourceInputs["visibility"] = args?.visibility;
            resourceInputs["created"] = undefined /*out*/;
            resourceInputs["modified"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(IncidentNotificationRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.IncidentNotificationRule = IncidentNotificationRule;
//# sourceMappingURL=incidentNotificationRule.js.map