UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

104 lines 4.16 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.GitRepositoryBranch = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Git Repository Branch. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", { * name: "Example Project", * visibility: "private", * versionControl: "Git", * workItemTemplate: "Agile", * }); * const exampleGit = new azuredevops.Git("example", { * projectId: example.id, * name: "Example Git Repository", * initialization: { * initType: "Clean", * }, * }); * const exampleGitRepositoryBranch = new azuredevops.GitRepositoryBranch("example", { * repositoryId: exampleGit.id, * name: "example-branch-name", * refBranch: exampleGit.defaultBranch, * }); * const exampleFromCommitId = new azuredevops.GitRepositoryBranch("example_from_commit_id", { * repositoryId: exampleGit.id, * name: "example-from-commit-id", * refCommitId: exampleGitRepositoryBranch.lastCommitId, * }); * ``` * * ## Import * * Azure DevOps Git Repository Branch can be imported using the `repository ID:branchName`. * * ```sh * $ pulumi import azuredevops:index/gitRepositoryBranch:GitRepositoryBranch example "00000000-0000-0000-0000-000000000000:main" * ``` */ class GitRepositoryBranch extends pulumi.CustomResource { /** * Get an existing GitRepositoryBranch 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 GitRepositoryBranch(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of GitRepositoryBranch. 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'] === GitRepositoryBranch.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["lastCommitId"] = state?.lastCommitId; resourceInputs["name"] = state?.name; resourceInputs["refBranch"] = state?.refBranch; resourceInputs["refCommitId"] = state?.refCommitId; resourceInputs["refTag"] = state?.refTag; resourceInputs["repositoryId"] = state?.repositoryId; } else { const args = argsOrState; if (args?.repositoryId === undefined && !opts.urn) { throw new Error("Missing required property 'repositoryId'"); } resourceInputs["name"] = args?.name; resourceInputs["refBranch"] = args?.refBranch; resourceInputs["refCommitId"] = args?.refCommitId; resourceInputs["refTag"] = args?.refTag; resourceInputs["repositoryId"] = args?.repositoryId; resourceInputs["lastCommitId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GitRepositoryBranch.__pulumiType, name, resourceInputs, opts); } } exports.GitRepositoryBranch = GitRepositoryBranch; /** @internal */ GitRepositoryBranch.__pulumiType = 'azuredevops:index/gitRepositoryBranch:GitRepositoryBranch'; //# sourceMappingURL=gitRepositoryBranch.js.map