UNPKG

@pulumi/opsgenie

Version:

A Pulumi package for creating and managing opsgenie cloud resources.

78 lines 3.19 kB
"use strict"; // *** 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.CustomRole = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages custom user roles within Opsgenie. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as opsgenie from "@pulumi/opsgenie"; * * const test = new opsgenie.CustomRole("test", { * roleName: "genierole", * extendedRole: "user", * grantedRights: ["alert-delete"], * disallowedRights: [ * "profile-edit", * "contacts-edit", * ], * }); * ``` */ class CustomRole extends pulumi.CustomResource { /** * Get an existing CustomRole 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 CustomRole(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CustomRole. 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'] === CustomRole.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["disallowedRights"] = state ? state.disallowedRights : undefined; resourceInputs["extendedRole"] = state ? state.extendedRole : undefined; resourceInputs["grantedRights"] = state ? state.grantedRights : undefined; resourceInputs["roleName"] = state ? state.roleName : undefined; } else { const args = argsOrState; if ((!args || args.roleName === undefined) && !opts.urn) { throw new Error("Missing required property 'roleName'"); } resourceInputs["disallowedRights"] = args ? args.disallowedRights : undefined; resourceInputs["extendedRole"] = args ? args.extendedRole : undefined; resourceInputs["grantedRights"] = args ? args.grantedRights : undefined; resourceInputs["roleName"] = args ? args.roleName : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CustomRole.__pulumiType, name, resourceInputs, opts); } } exports.CustomRole = CustomRole; /** @internal */ CustomRole.__pulumiType = 'opsgenie:index/customRole:CustomRole'; //# sourceMappingURL=customRole.js.map