@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
118 lines • 4.84 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.TeamAdministrators = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## *---
*
* layout: "azuredevops"
* page_title: "AzureDevops: azuredevops.TeamAdministrators"
* description: |-
* Manages administrators of a team within a project in a Azure DevOps organization.
* ---
*
* # azuredevops.TeamAdministrators
*
* Manages administrators of a team within a project in a Azure DevOps organization.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* workItemTemplate: "Agile",
* versionControl: "Git",
* visibility: "private",
* description: "Managed by Pulumi",
* });
* const example_project_contributors = azuredevops.getGroupOutput({
* projectId: example.id,
* name: "Contributors",
* });
* const exampleTeam = new azuredevops.Team("example", {
* projectId: example.id,
* name: pulumi.interpolate`${example.name} Team 2`,
* });
* const example_team_administrators = new azuredevops.TeamAdministrators("example-team-administrators", {
* projectId: exampleTeam.projectId,
* teamId: exampleTeam.id,
* mode: "overwrite",
* administrators: [example_project_contributors.apply(example_project_contributors => example_project_contributors.descriptor)],
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Teams - Update](https://docs.microsoft.com/en-us/rest/api/azure/devops/core/teams/update?view=azure-devops-rest-7.0)
*
* ## PAT Permissions Required
*
* - **vso.project_write**: Grants the ability to read and update projects and teams.
*
* ## Import
*
* The resource does not support import.
*/
class TeamAdministrators extends pulumi.CustomResource {
/**
* Get an existing TeamAdministrators 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 TeamAdministrators(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TeamAdministrators. 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'] === TeamAdministrators.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["administrators"] = state ? state.administrators : undefined;
resourceInputs["mode"] = state ? state.mode : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["teamId"] = state ? state.teamId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.administrators === undefined) && !opts.urn) {
throw new Error("Missing required property 'administrators'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.teamId === undefined) && !opts.urn) {
throw new Error("Missing required property 'teamId'");
}
resourceInputs["administrators"] = args ? args.administrators : undefined;
resourceInputs["mode"] = args ? args.mode : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["teamId"] = args ? args.teamId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TeamAdministrators.__pulumiType, name, resourceInputs, opts);
}
}
exports.TeamAdministrators = TeamAdministrators;
/** @internal */
TeamAdministrators.__pulumiType = 'azuredevops:index/teamAdministrators:TeamAdministrators';
//# sourceMappingURL=teamAdministrators.js.map