"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.Ruleset = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * For more information, see:
 * * [Get started with Firebase Security Rules](https://firebase.google.com/docs/rules/get-started)
 * ## Example Usage
 *
 * ### Basic_ruleset
 * Creates a basic Firestore ruleset
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const primary = new gcp.firebaserules.Ruleset("primary", {
 *     source: {
 *         files: [{
 *             content: "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
 *             name: "firestore.rules",
 *             fingerprint: "",
 *         }],
 *         language: "",
 *     },
 *     project: "my-project-name",
 * });
 * ```
 * ### Minimal_ruleset
 * Creates a minimal Firestore ruleset
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const primary = new gcp.firebaserules.Ruleset("primary", {
 *     source: {
 *         files: [{
 *             content: "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
 *             name: "firestore.rules",
 *         }],
 *     },
 *     project: "my-project-name",
 * });
 * ```
 *
 * ## Import
 *
 * Ruleset can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/rulesets/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Ruleset can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:firebaserules/ruleset:Ruleset default projects/{{project}}/rulesets/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebaserules/ruleset:Ruleset default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebaserules/ruleset:Ruleset default {{name}}
 * ```
 */
class Ruleset extends pulumi.CustomResource {
    /**
     * Get an existing Ruleset 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 Ruleset(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Ruleset.  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'] === Ruleset.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["metadatas"] = state?.metadatas;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["source"] = state?.source;
        }
        else {
            const args = argsOrState;
            if (args?.source === undefined && !opts.urn) {
                throw new Error("Missing required property 'source'");
            }
            resourceInputs["project"] = args?.project;
            resourceInputs["source"] = args?.source;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["metadatas"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Ruleset.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Ruleset = Ruleset;
/** @internal */
Ruleset.__pulumiType = 'gcp:firebaserules/ruleset:Ruleset';
//# sourceMappingURL=ruleset.js.map