@pulumi/slack
Version:
A Pulumi package for managing Slack workspaces.
172 lines • 7.78 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.Conversation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a Slack channel
*
* ## Required scopes
*
* This resource requires the following scopes:
*
* If using `bot` tokens:
*
* - [channels:read](https://api.slack.com/scopes/channels:read)
* (public channels)
* - [channels:manage](https://api.slack.com/scopes/channels:manage)
* (public channels)
* - [channels:join](https://api.slack.com/scopes/channels:join)
* (adopting existing public channels)
* - [groups:read](https://api.slack.com/scopes/groups:read)
* (private channels)
* - [groups:write](https://api.slack.com/scopes/groups:write)
* (private channels)
*
* If using `user` tokens:
*
* - [channels:read](https://api.slack.com/scopes/channels:read) (public channels)
* - [channels:write](https://api.slack.com/scopes/channels:manage) (public channels)
* - [groups:read](https://api.slack.com/scopes/groups:read) (private channels)
* - [groups:write](https://api.slack.com/scopes/groups:write) (private channels)
*
* The Slack API methods used by the resource are:
*
* - [conversations.create](https://api.slack.com/methods/conversations.create)
* - [conversations.join](https://api.slack.com/methods/conversations.join)
* - [conversations.setTopic](https://api.slack.com/methods/conversations.setTopic)
* - [conversations.setPurpose](https://api.slack.com/methods/conversations.setPurpose)
* - [conversations.info](https://api.slack.com/methods/conversations.info)
* - [conversations.members](https://api.slack.com/methods/conversations.members)
* - [conversations.kick](https://api.slack.com/methods/conversations.kick)
* - [conversations.invite](https://api.slack.com/methods/conversations.invite)
* - [conversations.rename](https://api.slack.com/methods/conversations.rename)
* - [conversations.archive](https://api.slack.com/methods/conversations.archive)
* - [conversations.unarchive](https://api.slack.com/methods/conversations.unarchive)
*
* 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 test = new slack.Conversation("test", {
* name: "my-channel",
* topic: "The topic for my channel",
* permanentMembers: [],
* isPrivate: true,
* });
* ```
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as slack from "@pulumi/slack";
*
* const nonadmin = new slack.Conversation("nonadmin", {
* name: "my-channel01",
* topic: "The channel won't be archived on destroy",
* permanentMembers: [],
* isPrivate: true,
* actionOnDestroy: "none",
* });
* ```
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as slack from "@pulumi/slack";
*
* const adopted = new slack.Conversation("adopted", {
* name: "my-channel02",
* topic: "Adopt existing, don't kick members",
* permanentMembers: [],
* adoptExistingChannel: true,
* actionOnUpdatePermanentMembers: "none",
* });
* ```
*
* ## Import
*
* `slack_conversation` can be imported using the ID of the conversation/channel, e.g.
*
* ```sh
* $ pulumi import slack:index/conversation:Conversation my_conversation C023X7QTFHQ
* ```
*/
class Conversation extends pulumi.CustomResource {
/**
* Get an existing Conversation 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 Conversation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Conversation. 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'] === Conversation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["actionOnDestroy"] = state ? state.actionOnDestroy : undefined;
resourceInputs["actionOnUpdatePermanentMembers"] = state ? state.actionOnUpdatePermanentMembers : undefined;
resourceInputs["adoptExistingChannel"] = state ? state.adoptExistingChannel : undefined;
resourceInputs["created"] = state ? state.created : undefined;
resourceInputs["creator"] = state ? state.creator : undefined;
resourceInputs["isArchived"] = state ? state.isArchived : undefined;
resourceInputs["isExtShared"] = state ? state.isExtShared : undefined;
resourceInputs["isGeneral"] = state ? state.isGeneral : undefined;
resourceInputs["isOrgShared"] = state ? state.isOrgShared : undefined;
resourceInputs["isPrivate"] = state ? state.isPrivate : undefined;
resourceInputs["isShared"] = state ? state.isShared : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["permanentMembers"] = state ? state.permanentMembers : undefined;
resourceInputs["purpose"] = state ? state.purpose : undefined;
resourceInputs["topic"] = state ? state.topic : undefined;
}
else {
const args = argsOrState;
if ((!args || args.isPrivate === undefined) && !opts.urn) {
throw new Error("Missing required property 'isPrivate'");
}
resourceInputs["actionOnDestroy"] = args ? args.actionOnDestroy : undefined;
resourceInputs["actionOnUpdatePermanentMembers"] = args ? args.actionOnUpdatePermanentMembers : undefined;
resourceInputs["adoptExistingChannel"] = args ? args.adoptExistingChannel : undefined;
resourceInputs["isArchived"] = args ? args.isArchived : undefined;
resourceInputs["isPrivate"] = args ? args.isPrivate : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["permanentMembers"] = args ? args.permanentMembers : undefined;
resourceInputs["purpose"] = args ? args.purpose : undefined;
resourceInputs["topic"] = args ? args.topic : undefined;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["creator"] = undefined /*out*/;
resourceInputs["isExtShared"] = undefined /*out*/;
resourceInputs["isGeneral"] = undefined /*out*/;
resourceInputs["isOrgShared"] = undefined /*out*/;
resourceInputs["isShared"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Conversation.__pulumiType, name, resourceInputs, opts);
}
}
exports.Conversation = Conversation;
/** @internal */
Conversation.__pulumiType = 'slack:index/conversation:Conversation';
//# sourceMappingURL=conversation.js.map