slack

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

A Pulumi package for managing Slack workspaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversation

type Conversation struct {
	pulumi.CustomResourceState

	// indicates whether the
	// conversation should be archived or left behind on destroy. Valid values are
	// `archive | none`. Note that when set to `none` the conversation will be left
	// as it is  and as a result any subsequent runs of pulumi up with the same
	// name  will fail.
	ActionOnDestroy pulumi.StringPtrOutput `pulumi:"actionOnDestroy"`
	// indicate
	// whether the members should be kick of the channel when removed from
	// `permanentMembers`. When set to `none` the user are never kicked, this prevent
	// a side effect on public channels where user that joined the channel are kicked.
	ActionOnUpdatePermanentMembers pulumi.StringPtrOutput `pulumi:"actionOnUpdatePermanentMembers"`
	AdoptExistingChannel           pulumi.BoolPtrOutput   `pulumi:"adoptExistingChannel"`
	// is a unix timestamp.
	Created pulumi.IntOutput `pulumi:"created"`
	// is the user ID of the member that created this channel.
	Creator pulumi.StringOutput `pulumi:"creator"`
	// indicates a conversation is archived. Frozen in time.
	IsArchived pulumi.BoolPtrOutput `pulumi:"isArchived"`
	// represents this conversation as being part of a Shared Channel
	// with a remote organization.
	IsExtShared pulumi.BoolOutput `pulumi:"isExtShared"`
	// will be true if this channel is the "general" channel that includes
	// all regular team members.
	IsGeneral pulumi.BoolOutput `pulumi:"isGeneral"`
	// explains whether this shared channel is shared between Enterprise
	// Grid workspaces within the same organization.
	IsOrgShared pulumi.BoolOutput `pulumi:"isOrgShared"`
	// create a private channel instead of a public one.
	IsPrivate pulumi.BoolOutput `pulumi:"isPrivate"`
	// means the conversation is in some way shared between multiple workspaces.
	IsShared pulumi.BoolOutput `pulumi:"isShared"`
	// name of the public or private channel.
	Name pulumi.StringOutput `pulumi:"name"`
	// user IDs to add to the channel.
	PermanentMembers pulumi.StringArrayOutput `pulumi:"permanentMembers"`
	// purpose of the channel.
	Purpose pulumi.StringPtrOutput `pulumi:"purpose"`
	// topic for the channel.
	Topic pulumi.StringPtrOutput `pulumi:"topic"`
}

Manages a Slack channel

## Required scopes

This resource requires the following scopes:

If using `bot` tokens:

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

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.NewConversation(ctx, "test", &slack.ConversationArgs{
			IsPrivate:        pulumi.Bool(true),
			PermanentMembers: pulumi.StringArray{},
			Topic:            pulumi.String("The topic for my channel"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.NewConversation(ctx, "nonadmin", &slack.ConversationArgs{
			ActionOnDestroy:  pulumi.String("none"),
			IsPrivate:        pulumi.Bool(true),
			PermanentMembers: pulumi.StringArray{},
			Topic:            pulumi.String("The channel won't be archived on destroy"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.NewConversation(ctx, "adopted", &slack.ConversationArgs{
			ActionOnUpdatePermanentMembers: pulumi.String("none"),
			AdoptExistingChannel:           pulumi.Bool(true),
			PermanentMembers:               pulumi.StringArray{},
			Topic:                          pulumi.String("Adopt existing, don't kick members"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## 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 ```

func GetConversation

func GetConversation(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ConversationState, opts ...pulumi.ResourceOption) (*Conversation, error)

GetConversation gets an existing Conversation resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewConversation

func NewConversation(ctx *pulumi.Context,
	name string, args *ConversationArgs, opts ...pulumi.ResourceOption) (*Conversation, error)

NewConversation registers a new resource with the given unique name, arguments, and options.

func (*Conversation) ElementType

func (*Conversation) ElementType() reflect.Type

func (*Conversation) ToConversationOutput

func (i *Conversation) ToConversationOutput() ConversationOutput

func (*Conversation) ToConversationOutputWithContext

func (i *Conversation) ToConversationOutputWithContext(ctx context.Context) ConversationOutput

type ConversationArgs

type ConversationArgs struct {
	// indicates whether the
	// conversation should be archived or left behind on destroy. Valid values are
	// `archive | none`. Note that when set to `none` the conversation will be left
	// as it is  and as a result any subsequent runs of pulumi up with the same
	// name  will fail.
	ActionOnDestroy pulumi.StringPtrInput
	// indicate
	// whether the members should be kick of the channel when removed from
	// `permanentMembers`. When set to `none` the user are never kicked, this prevent
	// a side effect on public channels where user that joined the channel are kicked.
	ActionOnUpdatePermanentMembers pulumi.StringPtrInput
	AdoptExistingChannel           pulumi.BoolPtrInput
	// indicates a conversation is archived. Frozen in time.
	IsArchived pulumi.BoolPtrInput
	// create a private channel instead of a public one.
	IsPrivate pulumi.BoolInput
	// name of the public or private channel.
	Name pulumi.StringPtrInput
	// user IDs to add to the channel.
	PermanentMembers pulumi.StringArrayInput
	// purpose of the channel.
	Purpose pulumi.StringPtrInput
	// topic for the channel.
	Topic pulumi.StringPtrInput
}

The set of arguments for constructing a Conversation resource.

func (ConversationArgs) ElementType

func (ConversationArgs) ElementType() reflect.Type

type ConversationArray

type ConversationArray []ConversationInput

func (ConversationArray) ElementType

func (ConversationArray) ElementType() reflect.Type

func (ConversationArray) ToConversationArrayOutput

func (i ConversationArray) ToConversationArrayOutput() ConversationArrayOutput

func (ConversationArray) ToConversationArrayOutputWithContext

func (i ConversationArray) ToConversationArrayOutputWithContext(ctx context.Context) ConversationArrayOutput

type ConversationArrayInput

type ConversationArrayInput interface {
	pulumi.Input

	ToConversationArrayOutput() ConversationArrayOutput
	ToConversationArrayOutputWithContext(context.Context) ConversationArrayOutput
}

ConversationArrayInput is an input type that accepts ConversationArray and ConversationArrayOutput values. You can construct a concrete instance of `ConversationArrayInput` via:

ConversationArray{ ConversationArgs{...} }

type ConversationArrayOutput

type ConversationArrayOutput struct{ *pulumi.OutputState }

func (ConversationArrayOutput) ElementType

func (ConversationArrayOutput) ElementType() reflect.Type

func (ConversationArrayOutput) Index

func (ConversationArrayOutput) ToConversationArrayOutput

func (o ConversationArrayOutput) ToConversationArrayOutput() ConversationArrayOutput

func (ConversationArrayOutput) ToConversationArrayOutputWithContext

func (o ConversationArrayOutput) ToConversationArrayOutputWithContext(ctx context.Context) ConversationArrayOutput

type ConversationInput

type ConversationInput interface {
	pulumi.Input

	ToConversationOutput() ConversationOutput
	ToConversationOutputWithContext(ctx context.Context) ConversationOutput
}

type ConversationMap

type ConversationMap map[string]ConversationInput

func (ConversationMap) ElementType

func (ConversationMap) ElementType() reflect.Type

func (ConversationMap) ToConversationMapOutput

func (i ConversationMap) ToConversationMapOutput() ConversationMapOutput

func (ConversationMap) ToConversationMapOutputWithContext

func (i ConversationMap) ToConversationMapOutputWithContext(ctx context.Context) ConversationMapOutput

type ConversationMapInput

type ConversationMapInput interface {
	pulumi.Input

	ToConversationMapOutput() ConversationMapOutput
	ToConversationMapOutputWithContext(context.Context) ConversationMapOutput
}

ConversationMapInput is an input type that accepts ConversationMap and ConversationMapOutput values. You can construct a concrete instance of `ConversationMapInput` via:

ConversationMap{ "key": ConversationArgs{...} }

type ConversationMapOutput

type ConversationMapOutput struct{ *pulumi.OutputState }

func (ConversationMapOutput) ElementType

func (ConversationMapOutput) ElementType() reflect.Type

func (ConversationMapOutput) MapIndex

func (ConversationMapOutput) ToConversationMapOutput

func (o ConversationMapOutput) ToConversationMapOutput() ConversationMapOutput

func (ConversationMapOutput) ToConversationMapOutputWithContext

func (o ConversationMapOutput) ToConversationMapOutputWithContext(ctx context.Context) ConversationMapOutput

type ConversationOutput

type ConversationOutput struct{ *pulumi.OutputState }

func (ConversationOutput) ActionOnDestroy added in v0.2.0

func (o ConversationOutput) ActionOnDestroy() pulumi.StringPtrOutput

indicates whether the conversation should be archived or left behind on destroy. Valid values are `archive | none`. Note that when set to `none` the conversation will be left as it is and as a result any subsequent runs of pulumi up with the same name will fail.

func (ConversationOutput) ActionOnUpdatePermanentMembers added in v0.2.1

func (o ConversationOutput) ActionOnUpdatePermanentMembers() pulumi.StringPtrOutput

indicate whether the members should be kick of the channel when removed from `permanentMembers`. When set to `none` the user are never kicked, this prevent a side effect on public channels where user that joined the channel are kicked.

func (ConversationOutput) AdoptExistingChannel added in v0.3.1

func (o ConversationOutput) AdoptExistingChannel() pulumi.BoolPtrOutput

func (ConversationOutput) Created added in v0.2.0

func (o ConversationOutput) Created() pulumi.IntOutput

is a unix timestamp.

func (ConversationOutput) Creator added in v0.2.0

is the user ID of the member that created this channel.

func (ConversationOutput) ElementType

func (ConversationOutput) ElementType() reflect.Type

func (ConversationOutput) IsArchived added in v0.2.0

func (o ConversationOutput) IsArchived() pulumi.BoolPtrOutput

indicates a conversation is archived. Frozen in time.

func (ConversationOutput) IsExtShared added in v0.2.0

func (o ConversationOutput) IsExtShared() pulumi.BoolOutput

represents this conversation as being part of a Shared Channel with a remote organization.

func (ConversationOutput) IsGeneral added in v0.2.0

func (o ConversationOutput) IsGeneral() pulumi.BoolOutput

will be true if this channel is the "general" channel that includes all regular team members.

func (ConversationOutput) IsOrgShared added in v0.2.0

func (o ConversationOutput) IsOrgShared() pulumi.BoolOutput

explains whether this shared channel is shared between Enterprise Grid workspaces within the same organization.

func (ConversationOutput) IsPrivate added in v0.2.0

func (o ConversationOutput) IsPrivate() pulumi.BoolOutput

create a private channel instead of a public one.

func (ConversationOutput) IsShared added in v0.2.0

func (o ConversationOutput) IsShared() pulumi.BoolOutput

means the conversation is in some way shared between multiple workspaces.

func (ConversationOutput) Name added in v0.2.0

name of the public or private channel.

func (ConversationOutput) PermanentMembers added in v0.2.0

func (o ConversationOutput) PermanentMembers() pulumi.StringArrayOutput

user IDs to add to the channel.

func (ConversationOutput) Purpose added in v0.2.0

purpose of the channel.

func (ConversationOutput) ToConversationOutput

func (o ConversationOutput) ToConversationOutput() ConversationOutput

func (ConversationOutput) ToConversationOutputWithContext

func (o ConversationOutput) ToConversationOutputWithContext(ctx context.Context) ConversationOutput

func (ConversationOutput) Topic added in v0.2.0

topic for the channel.

type ConversationState

type ConversationState struct {
	// indicates whether the
	// conversation should be archived or left behind on destroy. Valid values are
	// `archive | none`. Note that when set to `none` the conversation will be left
	// as it is  and as a result any subsequent runs of pulumi up with the same
	// name  will fail.
	ActionOnDestroy pulumi.StringPtrInput
	// indicate
	// whether the members should be kick of the channel when removed from
	// `permanentMembers`. When set to `none` the user are never kicked, this prevent
	// a side effect on public channels where user that joined the channel are kicked.
	ActionOnUpdatePermanentMembers pulumi.StringPtrInput
	AdoptExistingChannel           pulumi.BoolPtrInput
	// is a unix timestamp.
	Created pulumi.IntPtrInput
	// is the user ID of the member that created this channel.
	Creator pulumi.StringPtrInput
	// indicates a conversation is archived. Frozen in time.
	IsArchived pulumi.BoolPtrInput
	// represents this conversation as being part of a Shared Channel
	// with a remote organization.
	IsExtShared pulumi.BoolPtrInput
	// will be true if this channel is the "general" channel that includes
	// all regular team members.
	IsGeneral pulumi.BoolPtrInput
	// explains whether this shared channel is shared between Enterprise
	// Grid workspaces within the same organization.
	IsOrgShared pulumi.BoolPtrInput
	// create a private channel instead of a public one.
	IsPrivate pulumi.BoolPtrInput
	// means the conversation is in some way shared between multiple workspaces.
	IsShared pulumi.BoolPtrInput
	// name of the public or private channel.
	Name pulumi.StringPtrInput
	// user IDs to add to the channel.
	PermanentMembers pulumi.StringArrayInput
	// purpose of the channel.
	Purpose pulumi.StringPtrInput
	// topic for the channel.
	Topic pulumi.StringPtrInput
}

func (ConversationState) ElementType

func (ConversationState) ElementType() reflect.Type

type GetUserArgs

type GetUserArgs struct {
	// The email of the user
	//
	// The data source expects exactly one of these fields, you can't set both.
	Email *string `pulumi:"email"`
	// The name of the user
	Name *string `pulumi:"name"`
}

A collection of arguments for invoking getUser.

type GetUserOutputArgs

type GetUserOutputArgs struct {
	// The email of the user
	//
	// The data source expects exactly one of these fields, you can't set both.
	Email pulumi.StringPtrInput `pulumi:"email"`
	// The name of the user
	Name pulumi.StringPtrInput `pulumi:"name"`
}

A collection of arguments for invoking getUser.

func (GetUserOutputArgs) ElementType

func (GetUserOutputArgs) ElementType() reflect.Type

type GetUserResult

type GetUserResult struct {
	Email *string `pulumi:"email"`
	// The provider-assigned unique ID for this managed resource.
	Id   string  `pulumi:"id"`
	Name *string `pulumi:"name"`
}

A collection of values returned by getUser.

func GetUser

func GetUser(ctx *pulumi.Context, args *GetUserArgs, opts ...pulumi.InvokeOption) (*GetUserResult, error)

Use this data source to get information about a user for use in other resources.

## Required scopes

This resource requires the following scopes:

- [users:read](https://api.slack.com/scopes/users:read) - [users:read.email](https://api.slack.com/scopes/users:read.email)

The Slack API methods used by the resource are:

- [users.lookupByEmail](https://api.slack.com/methods/users.lookupByEmail) - [users.list](https://api.slack.com/methods/users.list)

If you get `missingScope` errors while using this resource check the scopes against the documentation for the methods above.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.GetUser(ctx, &slack.GetUserArgs{
			Name: pulumi.StringRef("my-user"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = slack.GetUser(ctx, &slack.GetUserArgs{
			Email: pulumi.StringRef("my-user@example.com"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

type GetUserResultOutput

type GetUserResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getUser.

func (GetUserResultOutput) ElementType

func (GetUserResultOutput) ElementType() reflect.Type

func (GetUserResultOutput) Email

func (GetUserResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (GetUserResultOutput) Name

func (GetUserResultOutput) ToGetUserResultOutput

func (o GetUserResultOutput) ToGetUserResultOutput() GetUserResultOutput

func (GetUserResultOutput) ToGetUserResultOutputWithContext

func (o GetUserResultOutput) ToGetUserResultOutputWithContext(ctx context.Context) GetUserResultOutput

type LookupConversationArgs

type LookupConversationArgs struct {
	// The ID of the channel
	ChannelId *string `pulumi:"channelId"`
	// The conversation is privileged between two or more members
	//
	// Either `channelId` or `name` must be provided. `isPrivate` only works in conjunction
	// with `name`.
	IsPrivate *bool `pulumi:"isPrivate"`
	// The name of the public or private channel
	Name *string `pulumi:"name"`
}

A collection of arguments for invoking getConversation.

type LookupConversationOutputArgs

type LookupConversationOutputArgs struct {
	// The ID of the channel
	ChannelId pulumi.StringPtrInput `pulumi:"channelId"`
	// The conversation is privileged between two or more members
	//
	// Either `channelId` or `name` must be provided. `isPrivate` only works in conjunction
	// with `name`.
	IsPrivate pulumi.BoolPtrInput `pulumi:"isPrivate"`
	// The name of the public or private channel
	Name pulumi.StringPtrInput `pulumi:"name"`
}

A collection of arguments for invoking getConversation.

func (LookupConversationOutputArgs) ElementType

type LookupConversationResult

type LookupConversationResult struct {
	ChannelId *string `pulumi:"channelId"`
	// is a unix timestamp.
	Created int `pulumi:"created"`
	// is the user ID of the member that created this channel.
	Creator string `pulumi:"creator"`
	// The provider-assigned unique ID for this managed resource.
	Id string `pulumi:"id"`
	// indicates a conversation is archived. Frozen in time.
	IsArchived bool `pulumi:"isArchived"`
	// represents this conversation as being part of a Shared Channel
	// with a remote organization.
	IsExtShared bool `pulumi:"isExtShared"`
	// will be true if this channel is the "general" channel that includes
	// all regular team members.
	IsGeneral bool `pulumi:"isGeneral"`
	// explains whether this shared channel is shared between Enterprise
	// Grid workspaces within the same organization.
	IsOrgShared bool `pulumi:"isOrgShared"`
	// means the conversation is privileged between two or more members.
	IsPrivate *bool `pulumi:"isPrivate"`
	// means the conversation is in some way shared between multiple workspaces.
	IsShared bool `pulumi:"isShared"`
	// name of the public or private channel.
	Name *string `pulumi:"name"`
	// purpose of the channel.
	Purpose string `pulumi:"purpose"`
	// topic for the channel.
	Topic string `pulumi:"topic"`
}

A collection of values returned by getConversation.

func LookupConversation

func LookupConversation(ctx *pulumi.Context, args *LookupConversationArgs, opts ...pulumi.InvokeOption) (*LookupConversationResult, error)

Use this data source to get information about a Slack conversation for use in other resources.

## Required scopes

This resource requires the following scopes:

- [channels:read](https://api.slack.com/scopes/channels:read) (public channels) - [groups:read](https://api.slack.com/scopes/groups:read) (private channels)

The Slack API methods used by the resource are:

- [conversations.info](https://api.slack.com/methods/conversations.info) - [conversations.members](https://api.slack.com/methods/conversations.members)

If you get `missingScope` errors while using this resource check the scopes against the documentation for the methods above.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.LookupConversation(ctx, &slack.LookupConversationArgs{
			ChannelId: pulumi.StringRef("my-channel"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = slack.LookupConversation(ctx, &slack.LookupConversationArgs{
			Name: pulumi.StringRef("my-channel-name"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

type LookupConversationResultOutput

type LookupConversationResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getConversation.

func (LookupConversationResultOutput) ChannelId

func (LookupConversationResultOutput) Created

is a unix timestamp.

func (LookupConversationResultOutput) Creator

is the user ID of the member that created this channel.

func (LookupConversationResultOutput) ElementType

func (LookupConversationResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (LookupConversationResultOutput) IsArchived

indicates a conversation is archived. Frozen in time.

func (LookupConversationResultOutput) IsExtShared

represents this conversation as being part of a Shared Channel with a remote organization.

func (LookupConversationResultOutput) IsGeneral

will be true if this channel is the "general" channel that includes all regular team members.

func (LookupConversationResultOutput) IsOrgShared

explains whether this shared channel is shared between Enterprise Grid workspaces within the same organization.

func (LookupConversationResultOutput) IsPrivate

means the conversation is privileged between two or more members.

func (LookupConversationResultOutput) IsShared

means the conversation is in some way shared between multiple workspaces.

func (LookupConversationResultOutput) Name

name of the public or private channel.

func (LookupConversationResultOutput) Purpose

purpose of the channel.

func (LookupConversationResultOutput) ToLookupConversationResultOutput

func (o LookupConversationResultOutput) ToLookupConversationResultOutput() LookupConversationResultOutput

func (LookupConversationResultOutput) ToLookupConversationResultOutputWithContext

func (o LookupConversationResultOutput) ToLookupConversationResultOutputWithContext(ctx context.Context) LookupConversationResultOutput

func (LookupConversationResultOutput) Topic

topic for the channel.

type LookupUsergroupArgs

type LookupUsergroupArgs struct {
	// The name of the usergroup
	Name *string `pulumi:"name"`
	// The id of the usergroup
	//
	// The data source expects exactly one of these fields, you can't set both.
	UsergroupId *string `pulumi:"usergroupId"`
}

A collection of arguments for invoking getUsergroup.

type LookupUsergroupOutputArgs

type LookupUsergroupOutputArgs struct {
	// The name of the usergroup
	Name pulumi.StringPtrInput `pulumi:"name"`
	// The id of the usergroup
	//
	// The data source expects exactly one of these fields, you can't set both.
	UsergroupId pulumi.StringPtrInput `pulumi:"usergroupId"`
}

A collection of arguments for invoking getUsergroup.

func (LookupUsergroupOutputArgs) ElementType

func (LookupUsergroupOutputArgs) ElementType() reflect.Type

type LookupUsergroupResult

type LookupUsergroupResult struct {
	// The channel IDs for which the User Group uses as a default.
	Channels []string `pulumi:"channels"`
	// The short description of the User Group.
	Description string `pulumi:"description"`
	// The mention handle.
	Handle string `pulumi:"handle"`
	// The provider-assigned unique ID for this managed resource.
	Id          string  `pulumi:"id"`
	Name        *string `pulumi:"name"`
	UsergroupId *string `pulumi:"usergroupId"`
	// The user IDs that represent the entire list of users for the
	// User Group.
	Users []string `pulumi:"users"`
}

A collection of values returned by getUsergroup.

func LookupUsergroup

func LookupUsergroup(ctx *pulumi.Context, args *LookupUsergroupArgs, opts ...pulumi.InvokeOption) (*LookupUsergroupResult, error)

Use this data source to get information about a usergroups for use in other resources. The data source returns enabled groups only.

## Required scopes

This resource requires the following scopes:

- [usergroups:read](https://api.slack.com/scopes/usergroups:read)

The Slack API methods used by the resource are:

- [usergroups.list](https://api.slack.com/methods/usergroups.list)

If you get `missingScope` errors while using this resource check the scopes against the documentation for the methods above.

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.LookupUsergroup(ctx, &slack.LookupUsergroupArgs{
			Name: pulumi.StringRef("my-usergroup"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = slack.LookupUsergroup(ctx, &slack.LookupUsergroupArgs{
			UsergroupId: pulumi.StringRef("USERGROUP00"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

type LookupUsergroupResultOutput

type LookupUsergroupResultOutput struct{ *pulumi.OutputState }

A collection of values returned by getUsergroup.

func (LookupUsergroupResultOutput) Channels

The channel IDs for which the User Group uses as a default.

func (LookupUsergroupResultOutput) Description

The short description of the User Group.

func (LookupUsergroupResultOutput) ElementType

func (LookupUsergroupResultOutput) Handle

The mention handle.

func (LookupUsergroupResultOutput) Id

The provider-assigned unique ID for this managed resource.

func (LookupUsergroupResultOutput) Name

func (LookupUsergroupResultOutput) ToLookupUsergroupResultOutput

func (o LookupUsergroupResultOutput) ToLookupUsergroupResultOutput() LookupUsergroupResultOutput

func (LookupUsergroupResultOutput) ToLookupUsergroupResultOutputWithContext

func (o LookupUsergroupResultOutput) ToLookupUsergroupResultOutputWithContext(ctx context.Context) LookupUsergroupResultOutput

func (LookupUsergroupResultOutput) UsergroupId

func (LookupUsergroupResultOutput) Users

The user IDs that represent the entire list of users for the User Group.

type Provider

type Provider struct {
	pulumi.ProviderResourceState

	// The Slack token
	Token pulumi.StringOutput `pulumi:"token"`
}

The provider type for the slack package. By default, resources use package-wide configuration settings, however an explicit `Provider` instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.

func NewProvider

func NewProvider(ctx *pulumi.Context,
	name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error)

NewProvider registers a new resource with the given unique name, arguments, and options.

func (*Provider) ElementType

func (*Provider) ElementType() reflect.Type

func (*Provider) ToProviderOutput

func (i *Provider) ToProviderOutput() ProviderOutput

func (*Provider) ToProviderOutputWithContext

func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

type ProviderArgs

type ProviderArgs struct {
	// The Slack token
	Token pulumi.StringInput
}

The set of arguments for constructing a Provider resource.

func (ProviderArgs) ElementType

func (ProviderArgs) ElementType() reflect.Type

type ProviderInput

type ProviderInput interface {
	pulumi.Input

	ToProviderOutput() ProviderOutput
	ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}

type ProviderOutput

type ProviderOutput struct{ *pulumi.OutputState }

func (ProviderOutput) ElementType

func (ProviderOutput) ElementType() reflect.Type

func (ProviderOutput) ToProviderOutput

func (o ProviderOutput) ToProviderOutput() ProviderOutput

func (ProviderOutput) ToProviderOutputWithContext

func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

func (ProviderOutput) Token added in v0.2.0

The Slack token

type Usergroup

type Usergroup struct {
	pulumi.CustomResourceState

	// channel IDs for which the User Group uses as a default.
	Channels pulumi.StringArrayOutput `pulumi:"channels"`
	// a short description of the User Group.
	Description pulumi.StringPtrOutput `pulumi:"description"`
	// a mention handle. Must be unique among channels, users
	// and User Groups.
	Handle pulumi.StringPtrOutput `pulumi:"handle"`
	// a name for the User Group. Must be unique among User Groups.
	Name pulumi.StringOutput `pulumi:"name"`
	// user IDs that represent the entire list of users for the
	// User Group.
	Users pulumi.StringArrayOutput `pulumi:"users"`
}

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

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := slack.NewUsergroup(ctx, "myGroup", &slack.UsergroupArgs{
			Channels: pulumi.StringArray{
				pulumi.String("CHANNEL00"),
			},
			Description: pulumi.String("Test user group"),
			Handle:      pulumi.String("test"),
			Users: pulumi.StringArray{
				pulumi.String("USER00"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

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:

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/pulumi/pulumi-slack/sdk/go/slack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myGroup, err := slack.NewUsergroup(ctx, "myGroup", &slack.UsergroupArgs{
			Handle:      pulumi.String("test"),
			Description: pulumi.String("Test user group"),
			Users: pulumi.StringArray{
				pulumi.String("USER00"),
			},
		})
		if err != nil {
			return err
		}
		_, err = slack.NewConversation(ctx, "test", &slack.ConversationArgs{
			Topic:            pulumi.String("The topic for my channel"),
			PermanentMembers: myGroup.Users,
			IsPrivate:        pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

## Import

`slack_usergroup` can be imported using the ID of the group, e.g.

```sh $ pulumi import slack:index/usergroup:Usergroup my_group S022GE79E9G ```

func GetUsergroup

func GetUsergroup(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *UsergroupState, opts ...pulumi.ResourceOption) (*Usergroup, error)

GetUsergroup gets an existing Usergroup resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewUsergroup

func NewUsergroup(ctx *pulumi.Context,
	name string, args *UsergroupArgs, opts ...pulumi.ResourceOption) (*Usergroup, error)

NewUsergroup registers a new resource with the given unique name, arguments, and options.

func (*Usergroup) ElementType

func (*Usergroup) ElementType() reflect.Type

func (*Usergroup) ToUsergroupOutput

func (i *Usergroup) ToUsergroupOutput() UsergroupOutput

func (*Usergroup) ToUsergroupOutputWithContext

func (i *Usergroup) ToUsergroupOutputWithContext(ctx context.Context) UsergroupOutput

type UsergroupArgs

type UsergroupArgs struct {
	// channel IDs for which the User Group uses as a default.
	Channels pulumi.StringArrayInput
	// a short description of the User Group.
	Description pulumi.StringPtrInput
	// a mention handle. Must be unique among channels, users
	// and User Groups.
	Handle pulumi.StringPtrInput
	// a name for the User Group. Must be unique among User Groups.
	Name pulumi.StringPtrInput
	// user IDs that represent the entire list of users for the
	// User Group.
	Users pulumi.StringArrayInput
}

The set of arguments for constructing a Usergroup resource.

func (UsergroupArgs) ElementType

func (UsergroupArgs) ElementType() reflect.Type

type UsergroupArray

type UsergroupArray []UsergroupInput

func (UsergroupArray) ElementType

func (UsergroupArray) ElementType() reflect.Type

func (UsergroupArray) ToUsergroupArrayOutput

func (i UsergroupArray) ToUsergroupArrayOutput() UsergroupArrayOutput

func (UsergroupArray) ToUsergroupArrayOutputWithContext

func (i UsergroupArray) ToUsergroupArrayOutputWithContext(ctx context.Context) UsergroupArrayOutput

type UsergroupArrayInput

type UsergroupArrayInput interface {
	pulumi.Input

	ToUsergroupArrayOutput() UsergroupArrayOutput
	ToUsergroupArrayOutputWithContext(context.Context) UsergroupArrayOutput
}

UsergroupArrayInput is an input type that accepts UsergroupArray and UsergroupArrayOutput values. You can construct a concrete instance of `UsergroupArrayInput` via:

UsergroupArray{ UsergroupArgs{...} }

type UsergroupArrayOutput

type UsergroupArrayOutput struct{ *pulumi.OutputState }

func (UsergroupArrayOutput) ElementType

func (UsergroupArrayOutput) ElementType() reflect.Type

func (UsergroupArrayOutput) Index

func (UsergroupArrayOutput) ToUsergroupArrayOutput

func (o UsergroupArrayOutput) ToUsergroupArrayOutput() UsergroupArrayOutput

func (UsergroupArrayOutput) ToUsergroupArrayOutputWithContext

func (o UsergroupArrayOutput) ToUsergroupArrayOutputWithContext(ctx context.Context) UsergroupArrayOutput

type UsergroupInput

type UsergroupInput interface {
	pulumi.Input

	ToUsergroupOutput() UsergroupOutput
	ToUsergroupOutputWithContext(ctx context.Context) UsergroupOutput
}

type UsergroupMap

type UsergroupMap map[string]UsergroupInput

func (UsergroupMap) ElementType

func (UsergroupMap) ElementType() reflect.Type

func (UsergroupMap) ToUsergroupMapOutput

func (i UsergroupMap) ToUsergroupMapOutput() UsergroupMapOutput

func (UsergroupMap) ToUsergroupMapOutputWithContext

func (i UsergroupMap) ToUsergroupMapOutputWithContext(ctx context.Context) UsergroupMapOutput

type UsergroupMapInput

type UsergroupMapInput interface {
	pulumi.Input

	ToUsergroupMapOutput() UsergroupMapOutput
	ToUsergroupMapOutputWithContext(context.Context) UsergroupMapOutput
}

UsergroupMapInput is an input type that accepts UsergroupMap and UsergroupMapOutput values. You can construct a concrete instance of `UsergroupMapInput` via:

UsergroupMap{ "key": UsergroupArgs{...} }

type UsergroupMapOutput

type UsergroupMapOutput struct{ *pulumi.OutputState }

func (UsergroupMapOutput) ElementType

func (UsergroupMapOutput) ElementType() reflect.Type

func (UsergroupMapOutput) MapIndex

func (UsergroupMapOutput) ToUsergroupMapOutput

func (o UsergroupMapOutput) ToUsergroupMapOutput() UsergroupMapOutput

func (UsergroupMapOutput) ToUsergroupMapOutputWithContext

func (o UsergroupMapOutput) ToUsergroupMapOutputWithContext(ctx context.Context) UsergroupMapOutput

type UsergroupOutput

type UsergroupOutput struct{ *pulumi.OutputState }

func (UsergroupOutput) Channels added in v0.2.0

channel IDs for which the User Group uses as a default.

func (UsergroupOutput) Description added in v0.2.0

func (o UsergroupOutput) Description() pulumi.StringPtrOutput

a short description of the User Group.

func (UsergroupOutput) ElementType

func (UsergroupOutput) ElementType() reflect.Type

func (UsergroupOutput) Handle added in v0.2.0

a mention handle. Must be unique among channels, users and User Groups.

func (UsergroupOutput) Name added in v0.2.0

a name for the User Group. Must be unique among User Groups.

func (UsergroupOutput) ToUsergroupOutput

func (o UsergroupOutput) ToUsergroupOutput() UsergroupOutput

func (UsergroupOutput) ToUsergroupOutputWithContext

func (o UsergroupOutput) ToUsergroupOutputWithContext(ctx context.Context) UsergroupOutput

func (UsergroupOutput) Users added in v0.2.0

user IDs that represent the entire list of users for the User Group.

type UsergroupState

type UsergroupState struct {
	// channel IDs for which the User Group uses as a default.
	Channels pulumi.StringArrayInput
	// a short description of the User Group.
	Description pulumi.StringPtrInput
	// a mention handle. Must be unique among channels, users
	// and User Groups.
	Handle pulumi.StringPtrInput
	// a name for the User Group. Must be unique among User Groups.
	Name pulumi.StringPtrInput
	// user IDs that represent the entire list of users for the
	// User Group.
	Users pulumi.StringArrayInput
}

func (UsergroupState) ElementType

func (UsergroupState) ElementType() reflect.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL