@emailbob/twingate
Version:
A Pulumi package for creating and managing Twingate cloud resources.
84 lines • 3.73 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.TwingateUser = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Users provides different levels of write capabilities across the Twingate Admin Console. For more information, see Twingate's [documentation](https://www.twingate.com/docs/users).
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as twingate from "@emailbob/twingate";
*
* const user = new twingate.TwingateUser("user", {
* email: "sample@company.com",
* firstName: "Twin",
* lastName: "Gate",
* role: "DEVOPS",
* sendInvite: true,
* });
* ```
* <!--End PulumiCodeChooser -->
*/
class TwingateUser extends pulumi.CustomResource {
/**
* Get an existing TwingateUser 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 TwingateUser(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TwingateUser. 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'] === TwingateUser.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["email"] = state ? state.email : undefined;
resourceInputs["firstName"] = state ? state.firstName : undefined;
resourceInputs["isActive"] = state ? state.isActive : undefined;
resourceInputs["lastName"] = state ? state.lastName : undefined;
resourceInputs["role"] = state ? state.role : undefined;
resourceInputs["sendInvite"] = state ? state.sendInvite : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.email === undefined) && !opts.urn) {
throw new Error("Missing required property 'email'");
}
resourceInputs["email"] = args ? args.email : undefined;
resourceInputs["firstName"] = args ? args.firstName : undefined;
resourceInputs["isActive"] = args ? args.isActive : undefined;
resourceInputs["lastName"] = args ? args.lastName : undefined;
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["sendInvite"] = args ? args.sendInvite : undefined;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TwingateUser.__pulumiType, name, resourceInputs, opts);
}
}
exports.TwingateUser = TwingateUser;
/** @internal */
TwingateUser.__pulumiType = 'twingate:index/twingateUser:TwingateUser';
//# sourceMappingURL=twingateUser.js.map