"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.Repository = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A resource represents a Dataform Git repository
 *
 * To get more information about Repository, see:
 *
 * * [API documentation](https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dataform/docs/)
 *
 * ## Example Usage
 *
 * ### Dataform Repository
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const secret = new gcp.secretmanager.Secret("secret", {
 *     secretId: "my-secret",
 *     replication: {
 *         auto: {},
 *     },
 * });
 * const secretVersion = new gcp.secretmanager.SecretVersion("secret_version", {
 *     secret: secret.id,
 *     secretData: "secret-data",
 * });
 * const keyring = new gcp.kms.KeyRing("keyring", {
 *     name: "example-key-ring",
 *     location: "us-central1",
 * });
 * const exampleKey = new gcp.kms.CryptoKey("example_key", {
 *     name: "example-crypto-key-name",
 *     keyRing: keyring.id,
 * });
 * const cryptoKeyBinding = new gcp.kms.CryptoKeyIAMBinding("crypto_key_binding", {
 *     cryptoKeyId: exampleKey.id,
 *     role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     members: [`serviceAccount:service-${project.number}@gcp-sa-dataform.iam.gserviceaccount.com`],
 * });
 * const dataformRepository = new gcp.dataform.Repository("dataform_repository", {
 *     name: "dataform_repository",
 *     displayName: "dataform_repository",
 *     npmrcEnvironmentVariablesSecretVersion: secretVersion.id,
 *     kmsKeyName: exampleKey.id,
 *     deletionPolicy: "FORCE",
 *     labels: {
 *         label_foo1: "label-bar1",
 *     },
 *     gitRemoteSettings: {
 *         url: "https://github.com/OWNER/REPOSITORY.git",
 *         defaultBranch: "main",
 *         authenticationTokenSecretVersion: secretVersion.id,
 *     },
 *     workspaceCompilationOverrides: {
 *         defaultDatabase: "database",
 *         schemaSuffix: "_suffix",
 *         tablePrefix: "prefix_",
 *     },
 * }, {
 *     dependsOn: [cryptoKeyBinding],
 * });
 * ```
 *
 * ## Import
 *
 * Repository can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{region}}/repositories/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Repository can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dataform/repository:Repository default projects/{{project}}/locations/{{region}}/repositories/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataform/repository:Repository default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataform/repository:Repository default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataform/repository:Repository default {{name}}
 * ```
 */
class Repository extends pulumi.CustomResource {
    /**
     * Get an existing Repository 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 Repository(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Repository.  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'] === Repository.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["deletionPolicy"] = state?.deletionPolicy;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["gitRemoteSettings"] = state?.gitRemoteSettings;
            resourceInputs["kmsKeyName"] = state?.kmsKeyName;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["name"] = state?.name;
            resourceInputs["npmrcEnvironmentVariablesSecretVersion"] = state?.npmrcEnvironmentVariablesSecretVersion;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["region"] = state?.region;
            resourceInputs["serviceAccount"] = state?.serviceAccount;
            resourceInputs["workspaceCompilationOverrides"] = state?.workspaceCompilationOverrides;
        }
        else {
            const args = argsOrState;
            resourceInputs["deletionPolicy"] = args?.deletionPolicy;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["gitRemoteSettings"] = args?.gitRemoteSettings;
            resourceInputs["kmsKeyName"] = args?.kmsKeyName;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["name"] = args?.name;
            resourceInputs["npmrcEnvironmentVariablesSecretVersion"] = args?.npmrcEnvironmentVariablesSecretVersion;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["serviceAccount"] = args?.serviceAccount;
            resourceInputs["workspaceCompilationOverrides"] = args?.workspaceCompilationOverrides;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Repository.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Repository = Repository;
/** @internal */
Repository.__pulumiType = 'gcp:dataform/repository:Repository';
//# sourceMappingURL=repository.js.map