"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationChannel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A NotificationChannel is a medium through which an alert is delivered
 * when a policy violation is detected. Examples of channels include email, SMS,
 * and third-party messaging applications. Fields containing sensitive information
 * like authentication tokens or contact info are only partially populated on retrieval.
 *
 * Notification Channels are designed to be flexible and are made up of a supported `type`
 * and labels to configure that channel. Each `type` has specific labels that need to be
 * present for that channel to be correctly configured. The labels that are required to be
 * present for one channel `type` are often different than those required for another.
 * Due to these loose constraints it's often best to set up a channel through the UI
 * and import it to the provider when setting up a brand new channel type to determine which
 * labels are required.
 *
 * A list of supported channels per project the `list` endpoint can be
 * accessed programmatically or through the api explorer at  https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.notificationChannelDescriptors/list .
 * This provides the channel type and all of the required labels that must be passed.
 *
 * To get more information about NotificationChannel, see:
 *
 * * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.notificationChannels)
 * * How-to Guides
 *     * [Monitoring API Documentation](https://cloud.google.com/monitoring/api/v3/)
 *     * [Notification Options](https://cloud.google.com/monitoring/support/notification-options)
 *
 * ## Example Usage
 *
 * ### Notification Channel Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basic = new gcp.monitoring.NotificationChannel("basic", {
 *     displayName: "Test Notification Channel",
 *     type: "email",
 *     labels: {
 *         email_address: "fake_email@blahblah.com",
 *     },
 *     forceDelete: false,
 * });
 * ```
 * ### Notification Channel Sensitive
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.monitoring.NotificationChannel("default", {
 *     displayName: "Test Slack Channel",
 *     type: "slack",
 *     labels: {
 *         channel_name: "#foobar",
 *     },
 *     sensitiveLabels: {
 *         authToken: "one",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * NotificationChannel can be imported using any of these accepted formats:
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, NotificationChannel can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:monitoring/notificationChannel:NotificationChannel default {{name}}
 * ```
 */
class NotificationChannel extends pulumi.CustomResource {
    /**
     * Get an existing NotificationChannel 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 NotificationChannel(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of NotificationChannel.  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'] === NotificationChannel.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["forceDelete"] = state?.forceDelete;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["sensitiveLabels"] = state?.sensitiveLabels;
            resourceInputs["type"] = state?.type;
            resourceInputs["userLabels"] = state?.userLabels;
            resourceInputs["verificationStatus"] = state?.verificationStatus;
        }
        else {
            const args = argsOrState;
            if (args?.type === undefined && !opts.urn) {
                throw new Error("Missing required property 'type'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["forceDelete"] = args?.forceDelete;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["project"] = args?.project;
            resourceInputs["sensitiveLabels"] = args?.sensitiveLabels;
            resourceInputs["type"] = args?.type;
            resourceInputs["userLabels"] = args?.userLabels;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["verificationStatus"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NotificationChannel.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NotificationChannel = NotificationChannel;
/** @internal */
NotificationChannel.__pulumiType = 'gcp:monitoring/notificationChannel:NotificationChannel';
//# sourceMappingURL=notificationChannel.js.map