@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
120 lines • 4.81 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.Team = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## *---
*
* layout: "azuredevops"
* page_title: "AzureDevops: azuredevops.Team"
* description: |-
* Manages a team within a project in a Azure DevOps organization.
* ---
*
* # azuredevops.Team
*
* Manages 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 example_project_readers = azuredevops.getGroupOutput({
* projectId: example.id,
* name: "Readers",
* });
* const exampleTeam = new azuredevops.Team("example", {
* projectId: example.id,
* name: "Example Team",
* administrators: [example_project_contributors.apply(example_project_contributors => example_project_contributors.descriptor)],
* members: [example_project_readers.apply(example_project_readers => example_project_readers.descriptor)],
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Teams - Create](https://docs.microsoft.com/en-us/rest/api/azure/devops/core/teams/create?view=azure-devops-rest-7.0)
*
* ## PAT Permissions Required
*
* - **vso.project_manage**: Grants the ability to create, read, update, and delete projects and teams.
*
* ## Import
*
* Azure DevOps teams can be imported using the complete resource id `<project_id>/<team_id>` e.g.
*
* ```sh
* $ pulumi import azuredevops:index/team:Team example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
class Team extends pulumi.CustomResource {
/**
* Get an existing Team 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 Team(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Team. 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'] === Team.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["administrators"] = state ? state.administrators : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["descriptor"] = state ? state.descriptor : undefined;
resourceInputs["members"] = state ? state.members : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
resourceInputs["administrators"] = args ? args.administrators : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["members"] = args ? args.members : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["descriptor"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Team.__pulumiType, name, resourceInputs, opts);
}
}
exports.Team = Team;
/** @internal */
Team.__pulumiType = 'azuredevops:index/team:Team';
//# sourceMappingURL=team.js.map