@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
94 lines • 4.01 kB
JavaScript
;
// *** 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.User = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a user entitlement within Azure DevOps.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.User("example", {principalName: "foo@contoso.com"});
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - User Entitlements - Add](https://docs.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/user-entitlements/add?view=azure-devops-rest-7.0)
* - [Programmatic mapping of access levels](https://docs.microsoft.com/en-us/azure/devops/organizations/security/access-levels?view=azure-devops#programmatic-mapping-of-access-levels)
*
* ## PAT Permissions Required
*
* - **Member Entitlement Management**: Read & Write
*
* ## Import
*
* This resource allows importing by the UUID of a user entitlement or by using the principal name of a user who owns the entitlement.
*
* ```sh
* $ pulumi import azuredevops:index/user:User example "00000000-0000-0000-0000-000000000000"
* ```
*
* or
*
* ```sh
* $ pulumi import azuredevops:index/user:User example "example@example.com"
* ```
*/
class User extends pulumi.CustomResource {
/**
* Get an existing User 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 User(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of User. 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'] === User.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountLicenseType"] = state ? state.accountLicenseType : undefined;
resourceInputs["descriptor"] = state ? state.descriptor : undefined;
resourceInputs["licensingSource"] = state ? state.licensingSource : undefined;
resourceInputs["origin"] = state ? state.origin : undefined;
resourceInputs["originId"] = state ? state.originId : undefined;
resourceInputs["principalName"] = state ? state.principalName : undefined;
}
else {
const args = argsOrState;
resourceInputs["accountLicenseType"] = args ? args.accountLicenseType : undefined;
resourceInputs["licensingSource"] = args ? args.licensingSource : undefined;
resourceInputs["origin"] = args ? args.origin : undefined;
resourceInputs["originId"] = args ? args.originId : undefined;
resourceInputs["principalName"] = args ? args.principalName : undefined;
resourceInputs["descriptor"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(User.__pulumiType, name, resourceInputs, opts);
}
}
exports.User = User;
/** @internal */
User.__pulumiType = 'azuredevops:index/user:User';
//# sourceMappingURL=user.js.map