"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.AppCheckDebugToken = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A debug token is a secret used during the development or integration testing of
 * an app. It essentially allows the development or integration testing to bypass
 * app attestation while still allowing App Check to enforce protection on supported
 * production Firebase services.
 *
 * To get more information about DebugToken, see:
 *
 * * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.debugTokens)
 * * How-to Guides
 *     * [Official Documentation](https://firebase.google.com/docs/app-check)
 *
 * ## Example Usage
 *
 * ### Firebase App Check Debug Token Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as time from "@pulumiverse/time";
 *
 * const _default = new gcp.firebase.WebApp("default", {
 *     project: "my-project-name",
 *     displayName: "Web App for debug token",
 * });
 * // It takes a while for App Check to recognize the new app
 * // If your app already exists, you don't have to wait 30 seconds.
 * const wait30s = new time.Sleep("wait_30s", {createDuration: "30s"}, {
 *     dependsOn: [_default],
 * });
 * const defaultAppCheckDebugToken = new gcp.firebase.AppCheckDebugToken("default", {
 *     project: "my-project-name",
 *     appId: _default.appId,
 *     displayName: "Debug Token",
 *     token: "00000000-AAAA-BBBB-CCCC-000000000000",
 * }, {
 *     dependsOn: [wait30s],
 * });
 * ```
 *
 * ## Import
 *
 * DebugToken can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}}`
 *
 * * `{{project}}/{{app_id}}/{{debug_token_id}}`
 *
 * * `{{app_id}}/{{debug_token_id}}`
 *
 * When using the `pulumi import` command, DebugToken can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default {{project}}/{{app_id}}/{{debug_token_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default {{app_id}}/{{debug_token_id}}
 * ```
 */
class AppCheckDebugToken extends pulumi.CustomResource {
    /**
     * Get an existing AppCheckDebugToken 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 AppCheckDebugToken(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of AppCheckDebugToken.  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'] === AppCheckDebugToken.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["appId"] = state?.appId;
            resourceInputs["debugTokenId"] = state?.debugTokenId;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["project"] = state?.project;
            resourceInputs["token"] = state?.token;
        }
        else {
            const args = argsOrState;
            if (args?.appId === undefined && !opts.urn) {
                throw new Error("Missing required property 'appId'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.token === undefined && !opts.urn) {
                throw new Error("Missing required property 'token'");
            }
            resourceInputs["appId"] = args?.appId;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["project"] = args?.project;
            resourceInputs["token"] = args?.token ? pulumi.secret(args.token) : undefined;
            resourceInputs["debugTokenId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["token"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(AppCheckDebugToken.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AppCheckDebugToken = AppCheckDebugToken;
/** @internal */
AppCheckDebugToken.__pulumiType = 'gcp:firebase/appCheckDebugToken:AppCheckDebugToken';
//# sourceMappingURL=appCheckDebugToken.js.map