@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
96 lines • 4.16 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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,
* });
* ```
*/
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, Object.assign(Object.assign({}, 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 ? state.lastCommitId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["refBranch"] = state ? state.refBranch : undefined;
resourceInputs["refCommitId"] = state ? state.refCommitId : undefined;
resourceInputs["refTag"] = state ? state.refTag : undefined;
resourceInputs["repositoryId"] = state ? state.repositoryId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.repositoryId === undefined) && !opts.urn) {
throw new Error("Missing required property 'repositoryId'");
}
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["refBranch"] = args ? args.refBranch : undefined;
resourceInputs["refCommitId"] = args ? args.refCommitId : undefined;
resourceInputs["refTag"] = args ? args.refTag : undefined;
resourceInputs["repositoryId"] = args ? args.repositoryId : undefined;
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