@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
107 lines • 4.67 kB
JavaScript
;
// *** 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.CheckApproval = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a Approval Check.
*
* ## Example Usage
*
* ### Protect an environment
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {name: "Example Project"});
* const exampleEnvironment = new azuredevops.Environment("example", {
* projectId: example.id,
* name: "Example Environment",
* });
* const exampleGroup = new azuredevops.Group("example", {displayName: "some-azdo-group"});
* const exampleCheckApproval = new azuredevops.CheckApproval("example", {
* projectId: example.id,
* targetResourceId: exampleEnvironment.id,
* targetResourceType: "environment",
* requesterCanApprove: true,
* approvers: [exampleGroup.originId],
* });
* ```
*
* ## Import
*
* Importing this resource is not supported.
*/
class CheckApproval extends pulumi.CustomResource {
/**
* Get an existing CheckApproval 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 CheckApproval(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CheckApproval. 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'] === CheckApproval.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["approvers"] = state?.approvers;
resourceInputs["instructions"] = state?.instructions;
resourceInputs["minimumRequiredApprovers"] = state?.minimumRequiredApprovers;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["requesterCanApprove"] = state?.requesterCanApprove;
resourceInputs["targetResourceId"] = state?.targetResourceId;
resourceInputs["targetResourceType"] = state?.targetResourceType;
resourceInputs["timeout"] = state?.timeout;
resourceInputs["version"] = state?.version;
}
else {
const args = argsOrState;
if (args?.approvers === undefined && !opts.urn) {
throw new Error("Missing required property 'approvers'");
}
if (args?.projectId === undefined && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if (args?.targetResourceId === undefined && !opts.urn) {
throw new Error("Missing required property 'targetResourceId'");
}
if (args?.targetResourceType === undefined && !opts.urn) {
throw new Error("Missing required property 'targetResourceType'");
}
resourceInputs["approvers"] = args?.approvers;
resourceInputs["instructions"] = args?.instructions;
resourceInputs["minimumRequiredApprovers"] = args?.minimumRequiredApprovers;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["requesterCanApprove"] = args?.requesterCanApprove;
resourceInputs["targetResourceId"] = args?.targetResourceId;
resourceInputs["targetResourceType"] = args?.targetResourceType;
resourceInputs["timeout"] = args?.timeout;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CheckApproval.__pulumiType, name, resourceInputs, opts);
}
}
exports.CheckApproval = CheckApproval;
/** @internal */
CheckApproval.__pulumiType = 'azuredevops:index/checkApproval:CheckApproval';
//# sourceMappingURL=checkApproval.js.map