UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

110 lines 4.92 kB
"use strict"; // *** 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.FeedPermission = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages creation of the Feed Permission within Azure DevOps organization. * * ## Example Usage * * ### Create Feed Permission * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", {name: "Example Project"}); * const exampleGroup = new azuredevops.Group("example", { * scope: example.id, * displayName: "Example group", * description: "Example description", * }); * const exampleFeed = new azuredevops.Feed("example", {name: "examplefeed"}); * const permission = new azuredevops.FeedPermission("permission", { * feedId: exampleFeed.id, * role: "reader", * identityDescriptor: exampleGroup.descriptor, * }); * ``` * * ## Relevant Links * * - [Azure DevOps Service REST API 7.0 - Feed Management](https://learn.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed-management?view=azure-devops-rest-7.0) * * ## Import * * Azure DevOps Feed Permission can be imported using the `Project ID/Feed ID/Identity Descriptor` or `Feed ID/Identity Descriptor` e.g.: * * ```sh * $ pulumi import azuredevops:index/feedPermission:FeedPermission permission 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000/vssgp.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * ``` * * or * * ```sh * $ pulumi import azuredevops:index/feedPermission:FeedPermission permission 00000000-0000-0000-0000-000000000000/vssgp.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * ``` */ class FeedPermission extends pulumi.CustomResource { /** * Get an existing FeedPermission 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 FeedPermission(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FeedPermission. 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'] === FeedPermission.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["feedId"] = state ? state.feedId : undefined; resourceInputs["identityDescriptor"] = state ? state.identityDescriptor : undefined; resourceInputs["identityId"] = state ? state.identityId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["role"] = state ? state.role : undefined; } else { const args = argsOrState; if ((!args || args.feedId === undefined) && !opts.urn) { throw new Error("Missing required property 'feedId'"); } if ((!args || args.identityDescriptor === undefined) && !opts.urn) { throw new Error("Missing required property 'identityDescriptor'"); } if ((!args || args.role === undefined) && !opts.urn) { throw new Error("Missing required property 'role'"); } resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["feedId"] = args ? args.feedId : undefined; resourceInputs["identityDescriptor"] = args ? args.identityDescriptor : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["role"] = args ? args.role : undefined; resourceInputs["identityId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FeedPermission.__pulumiType, name, resourceInputs, opts); } } exports.FeedPermission = FeedPermission; /** @internal */ FeedPermission.__pulumiType = 'azuredevops:index/feedPermission:FeedPermission'; //# sourceMappingURL=feedPermission.js.map