"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");
/**
 * Repositories store source code. It supports all Git SCM client commands and has built-in pull requests and issue tracking. Both HTTPS and SSH authentication are supported.
 *
 * To get more information about Repository, see:
 *
 * * [API documentation](https://cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/secure-source-manager/docs/overview)
 *
 * ## Example Usage
 *
 * ### Secure Source Manager Repository Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const instance = new gcp.securesourcemanager.Instance("instance", {
 *     location: "us-central1",
 *     instanceId: "my-instance",
 *     deletionPolicy: "PREVENT",
 * });
 * const _default = new gcp.securesourcemanager.Repository("default", {
 *     location: "us-central1",
 *     repositoryId: "my-repository",
 *     instance: instance.name,
 *     deletionPolicy: "PREVENT",
 * });
 * ```
 * ### Secure Source Manager Repository Initial Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const instance = new gcp.securesourcemanager.Instance("instance", {
 *     location: "us-central1",
 *     instanceId: "my-instance",
 *     deletionPolicy: "PREVENT",
 * });
 * const _default = new gcp.securesourcemanager.Repository("default", {
 *     location: "us-central1",
 *     repositoryId: "my-repository",
 *     instance: instance.name,
 *     description: "This is a test repository",
 *     initialConfig: {
 *         defaultBranch: "main",
 *         gitignores: ["python"],
 *         license: "mit",
 *         readme: "default",
 *     },
 *     deletionPolicy: "PREVENT",
 * });
 * ```
 *
 * ## Import
 *
 * Repository can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/repositories/{{repository_id}}`
 *
 * * `{{project}}/{{location}}/{{repository_id}}`
 *
 * * `{{location}}/{{repository_id}}`
 *
 * * `{{repository_id}}`
 *
 * When using the `pulumi import` command, Repository can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:securesourcemanager/repository:Repository default projects/{{project}}/locations/{{location}}/repositories/{{repository_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:securesourcemanager/repository:Repository default {{project}}/{{location}}/{{repository_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:securesourcemanager/repository:Repository default {{location}}/{{repository_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:securesourcemanager/repository:Repository default {{repository_id}}
 * ```
 */
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["createTime"] = state?.createTime;
            resourceInputs["deletionPolicy"] = state?.deletionPolicy;
            resourceInputs["description"] = state?.description;
            resourceInputs["initialConfig"] = state?.initialConfig;
            resourceInputs["instance"] = state?.instance;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["repositoryId"] = state?.repositoryId;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["updateTime"] = state?.updateTime;
            resourceInputs["uris"] = state?.uris;
        }
        else {
            const args = argsOrState;
            if (args?.instance === undefined && !opts.urn) {
                throw new Error("Missing required property 'instance'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.repositoryId === undefined && !opts.urn) {
                throw new Error("Missing required property 'repositoryId'");
            }
            resourceInputs["deletionPolicy"] = args?.deletionPolicy;
            resourceInputs["description"] = args?.description;
            resourceInputs["initialConfig"] = args?.initialConfig;
            resourceInputs["instance"] = args?.instance;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["repositoryId"] = args?.repositoryId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
            resourceInputs["uris"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Repository.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Repository = Repository;
/** @internal */
Repository.__pulumiType = 'gcp:securesourcemanager/repository:Repository';
//# sourceMappingURL=repository.js.map