UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

107 lines 5.06 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.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, Object.assign(Object.assign({}, 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 ? state.approvers : undefined; resourceInputs["instructions"] = state ? state.instructions : undefined; resourceInputs["minimumRequiredApprovers"] = state ? state.minimumRequiredApprovers : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["requesterCanApprove"] = state ? state.requesterCanApprove : undefined; resourceInputs["targetResourceId"] = state ? state.targetResourceId : undefined; resourceInputs["targetResourceType"] = state ? state.targetResourceType : undefined; resourceInputs["timeout"] = state ? state.timeout : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.approvers === undefined) && !opts.urn) { throw new Error("Missing required property 'approvers'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.targetResourceId === undefined) && !opts.urn) { throw new Error("Missing required property 'targetResourceId'"); } if ((!args || args.targetResourceType === undefined) && !opts.urn) { throw new Error("Missing required property 'targetResourceType'"); } resourceInputs["approvers"] = args ? args.approvers : undefined; resourceInputs["instructions"] = args ? args.instructions : undefined; resourceInputs["minimumRequiredApprovers"] = args ? args.minimumRequiredApprovers : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["requesterCanApprove"] = args ? args.requesterCanApprove : undefined; resourceInputs["targetResourceId"] = args ? args.targetResourceId : undefined; resourceInputs["targetResourceType"] = args ? args.targetResourceType : undefined; resourceInputs["timeout"] = args ? args.timeout : undefined; 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