@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
116 lines • 4.58 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.User = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a User within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.User("test", {
* username: "user@domain.com",
* fullName: "Test User",
* role: "User",
* locale: "en_US",
* timezone: "America/New_York",
* tags: [
* "sre",
* "opsgenie",
* ],
* skypeUsername: "skypename",
* userAddresses: [{
* country: "Country",
* state: "State",
* city: "City",
* line: "Line",
* zipcode: "998877",
* }],
* userDetails: {
* key1: "val1,val2",
* key2: "val3,val4",
* },
* });
* ```
*
* ## Import
*
* Users can be imported using the `user_id`, e.g.
*
* ```sh
* $ pulumi import opsgenie:index/user:User user user_id`
* ```
*/
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["fullName"] = state ? state.fullName : undefined;
resourceInputs["locale"] = state ? state.locale : undefined;
resourceInputs["role"] = state ? state.role : undefined;
resourceInputs["skypeUsername"] = state ? state.skypeUsername : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["timezone"] = state ? state.timezone : undefined;
resourceInputs["userAddresses"] = state ? state.userAddresses : undefined;
resourceInputs["userDetails"] = state ? state.userDetails : undefined;
resourceInputs["username"] = state ? state.username : undefined;
}
else {
const args = argsOrState;
if ((!args || args.fullName === undefined) && !opts.urn) {
throw new Error("Missing required property 'fullName'");
}
if ((!args || args.role === undefined) && !opts.urn) {
throw new Error("Missing required property 'role'");
}
if ((!args || args.username === undefined) && !opts.urn) {
throw new Error("Missing required property 'username'");
}
resourceInputs["fullName"] = args ? args.fullName : undefined;
resourceInputs["locale"] = args ? args.locale : undefined;
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["skypeUsername"] = args ? args.skypeUsername : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["timezone"] = args ? args.timezone : undefined;
resourceInputs["userAddresses"] = args ? args.userAddresses : undefined;
resourceInputs["userDetails"] = args ? args.userDetails : undefined;
resourceInputs["username"] = args ? args.username : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(User.__pulumiType, name, resourceInputs, opts);
}
}
exports.User = User;
/** @internal */
User.__pulumiType = 'opsgenie:index/user:User';
//# sourceMappingURL=user.js.map