UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

136 lines 6.09 kB
"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.RepositoryGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The resource for managing Repository Group for Gemini Code Assist. * * To get more information about RepositoryGroup, see: * * * [API documentation](https://cloud.google.com/gemini/docs/api/reference/rest/v1/projects.locations.codeRepositoryIndexes.repositoryGroups) * * ## Example Usage * * ### Gemini Repository Group Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.gemini.RepositoryGroup("example", { * location: "us-central1", * codeRepositoryIndex: "example-cri", * repositoryGroupId: "example-repository-group", * repositories: [{ * resource: "projects/example-project/locations/us-central1/connections/example-connection/gitRepositoryLinks/example-repo", * branchPattern: "main", * }], * labels: { * label1: "value1", * }, * }); * ``` * * ## Import * * RepositoryGroup can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index}}/repositoryGroups/{{repository_group_id}}` * * * `{{project}}/{{location}}/{{code_repository_index}}/{{repository_group_id}}` * * * `{{location}}/{{code_repository_index}}/{{repository_group_id}}` * * When using the `pulumi import` command, RepositoryGroup can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:gemini/repositoryGroup:RepositoryGroup default projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index}}/repositoryGroups/{{repository_group_id}} * ``` * * ```sh * $ pulumi import gcp:gemini/repositoryGroup:RepositoryGroup default {{project}}/{{location}}/{{code_repository_index}}/{{repository_group_id}} * ``` * * ```sh * $ pulumi import gcp:gemini/repositoryGroup:RepositoryGroup default {{location}}/{{code_repository_index}}/{{repository_group_id}} * ``` */ class RepositoryGroup extends pulumi.CustomResource { /** * Get an existing RepositoryGroup 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 RepositoryGroup(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RepositoryGroup. 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'] === RepositoryGroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["codeRepositoryIndex"] = state?.codeRepositoryIndex; resourceInputs["createTime"] = state?.createTime; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["repositories"] = state?.repositories; resourceInputs["repositoryGroupId"] = state?.repositoryGroupId; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.codeRepositoryIndex === undefined && !opts.urn) { throw new Error("Missing required property 'codeRepositoryIndex'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.repositories === undefined && !opts.urn) { throw new Error("Missing required property 'repositories'"); } if (args?.repositoryGroupId === undefined && !opts.urn) { throw new Error("Missing required property 'repositoryGroupId'"); } resourceInputs["codeRepositoryIndex"] = args?.codeRepositoryIndex; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["repositories"] = args?.repositories; resourceInputs["repositoryGroupId"] = args?.repositoryGroupId; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(RepositoryGroup.__pulumiType, name, resourceInputs, opts); } } exports.RepositoryGroup = RepositoryGroup; /** @internal */ RepositoryGroup.__pulumiType = 'gcp:gemini/repositoryGroup:RepositoryGroup'; //# sourceMappingURL=repositoryGroup.js.map