UNPKG

@pulumi/slack

Version:

A Pulumi package for managing Slack workspaces.

147 lines 5.6 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Usergroup = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Manages a Slack User Group. * * ## Required scopes * * This resource requires the following scopes: * * - [usergroups:write](https://api.slack.com/scopes/usergroups:write) * - [usergroups:read](https://api.slack.com/scopes/usergroups:read) * * The Slack API methods used by the resource are: * * - [usergroups.create](https://api.slack.com/methods/usergroups.create) * - [usergroups.enable](https://api.slack.com/methods/usergroups.enable) * - [usergroups.disable](https://api.slack.com/methods/usergroups.disable) * - [usergroups.update](https://api.slack.com/methods/usergroups.update) * - [usergroups.list](https://api.slack.com/methods/usergroups.list) * - [usergroups.users.update](https://api.slack.com/methods/usergroups.users.update) * * If you get `missingScope` errors while using this resource check the scopes against * the documentation for the methods above. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as slack from "@pulumi/slack"; * * const myGroup = new slack.Usergroup("my_group", { * name: "TestGroup", * handle: "test", * description: "Test user group", * users: ["USER00"], * channels: ["CHANNEL00"], * }); * ``` * * Note that if a channel is removed from the `channels` list users are * **not** removed from the channel. In order to keep the users in the * groups and in the channel in sync set `permanentUsers` in the channel: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as slack from "@pulumi/slack"; * * const myGroup = new slack.Usergroup("my_group", { * name: "TestGroup", * handle: "test", * description: "Test user group", * users: ["USER00"], * }); * const test = new slack.Conversation("test", { * name: "my-channel", * topic: "The topic for my channel", * permanentMembers: myGroup.users, * isPrivate: true, * }); * ``` * * ## Import * * `slack.Usergroup` can be imported using the ID of the group, e.g. * * ```sh * $ pulumi import slack:index/usergroup:Usergroup my_group S022GE79E9G * ``` */ class Usergroup extends pulumi.CustomResource { /** * Get an existing Usergroup 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 Usergroup(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'slack:index/usergroup:Usergroup'; /** * Returns true if the given object is an instance of Usergroup. 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'] === Usergroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["channels"] = state?.channels; resourceInputs["description"] = state?.description; resourceInputs["handle"] = state?.handle; resourceInputs["name"] = state?.name; resourceInputs["users"] = state?.users; } else { const args = argsOrState; resourceInputs["channels"] = args?.channels; resourceInputs["description"] = args?.description; resourceInputs["handle"] = args?.handle; resourceInputs["name"] = args?.name; resourceInputs["users"] = args?.users; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Usergroup.__pulumiType, name, resourceInputs, opts); } } exports.Usergroup = Usergroup; //# sourceMappingURL=usergroup.js.map