"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.Contact = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A contact that will receive notifications from Google Cloud.
 *
 * To get more information about Contact, see:
 *
 * * [API documentation](https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest/v1/projects.contacts)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/resource-manager/docs/managing-notification-contacts)
 *
 * > **Warning:** If you are using User ADCs (Application Default Credentials) with this resource,
 * you must specify a `billingProject` and set `userProjectOverride` to true
 * in the provider configuration. Otherwise the Essential Contacts API will return a 403 error.
 * Your account must have the `serviceusage.services.use` permission on the
 * `billingProject` you defined.
 *
 * ## Example Usage
 *
 * ### Essential Contact
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const contact = new gcp.essentialcontacts.Contact("contact", {
 *     parent: project.then(project => project.id),
 *     email: "foo@bar.com",
 *     languageTag: "en-GB",
 *     notificationCategorySubscriptions: ["ALL"],
 * });
 * ```
 *
 * ## Import
 *
 * Contact can be imported using any of these accepted formats:
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Contact can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:essentialcontacts/contact:Contact default {{name}}
 * ```
 */
class Contact extends pulumi.CustomResource {
    /**
     * Get an existing Contact 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 Contact(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Contact.  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'] === Contact.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["email"] = state?.email;
            resourceInputs["languageTag"] = state?.languageTag;
            resourceInputs["name"] = state?.name;
            resourceInputs["notificationCategorySubscriptions"] = state?.notificationCategorySubscriptions;
            resourceInputs["parent"] = state?.parent;
        }
        else {
            const args = argsOrState;
            if (args?.email === undefined && !opts.urn) {
                throw new Error("Missing required property 'email'");
            }
            if (args?.languageTag === undefined && !opts.urn) {
                throw new Error("Missing required property 'languageTag'");
            }
            if (args?.notificationCategorySubscriptions === undefined && !opts.urn) {
                throw new Error("Missing required property 'notificationCategorySubscriptions'");
            }
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            resourceInputs["email"] = args?.email;
            resourceInputs["languageTag"] = args?.languageTag;
            resourceInputs["notificationCategorySubscriptions"] = args?.notificationCategorySubscriptions;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Contact.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Contact = Contact;
/** @internal */
Contact.__pulumiType = 'gcp:essentialcontacts/contact:Contact';
//# sourceMappingURL=contact.js.map