"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.NotifyPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage vmp notify policy
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooContact = new volcengine.vmp.Contact("fooContact", {
 *     email: "acctest1@tftest.com",
 *     webhook: {
 *         address: "https://www.acctest1.com",
 *     },
 *     larkBotWebhook: {
 *         address: "https://www.acctest1.com",
 *     },
 *     dingTalkBotWebhook: {
 *         address: "https://www.dingacctest1.com",
 *         atMobiles: ["18046891812"],
 *     },
 *     phoneNumber: {
 *         countryCode: "+86",
 *         number: "18310101010",
 *     },
 * });
 * const foo1Contact = new volcengine.vmp.Contact("foo1Contact", {
 *     email: "acctest2@tftest.com",
 *     webhook: {
 *         address: "https://www.acctest2.com",
 *     },
 *     larkBotWebhook: {
 *         address: "https://www.acctest2.com",
 *     },
 *     dingTalkBotWebhook: {
 *         address: "https://www.dingacctest2.com",
 *         atMobiles: ["18046891813"],
 *     },
 *     phoneNumber: {
 *         countryCode: "+86",
 *         number: "18310101011",
 *     },
 * });
 * const fooContactGroup = new volcengine.vmp.ContactGroup("fooContactGroup", {contactIds: [fooContact.id]});
 * const foo1ContactGroup = new volcengine.vmp.ContactGroup("foo1ContactGroup", {contactIds: [foo1Contact.id]});
 * const fooNotifyPolicy = new volcengine.vmp.NotifyPolicy("fooNotifyPolicy", {
 *     description: "acc-test-1",
 *     levels: [
 *         {
 *             level: "P1",
 *             contactGroupIds: [fooContactGroup.id],
 *             channels: [
 *                 "Email",
 *                 "Webhook",
 *             ],
 *         },
 *         {
 *             level: "P0",
 *             contactGroupIds: [foo1ContactGroup.id],
 *             channels: ["LarkBotWebhook"],
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * VMP Notify Policy can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vmp/notifyPolicy:NotifyPolicy default 60dde3ca-951c-4c05-8777-e5a7caa07ad6
 * ```
 */
class NotifyPolicy extends pulumi.CustomResource {
    /**
     * Get an existing NotifyPolicy 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 NotifyPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of NotifyPolicy.  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'] === NotifyPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["channelNotifyTemplateIds"] = state ? state.channelNotifyTemplateIds : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["levels"] = state ? state.levels : undefined;
            resourceInputs["name"] = state ? state.name : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.levels === undefined) && !opts.urn) {
                throw new Error("Missing required property 'levels'");
            }
            resourceInputs["channelNotifyTemplateIds"] = args ? args.channelNotifyTemplateIds : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["levels"] = args ? args.levels : undefined;
            resourceInputs["name"] = args ? args.name : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NotifyPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NotifyPolicy = NotifyPolicy;
/** @internal */
NotifyPolicy.__pulumiType = 'volcengine:vmp/notifyPolicy:NotifyPolicy';
//# sourceMappingURL=notifyPolicy.js.map