Skip to content

Commit

Permalink
Documented required scopes (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablovarela authored May 20, 2021
1 parent dc139bd commit 5ec7d9f
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 48 deletions.
39 changes: 27 additions & 12 deletions docs/data-sources/conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ page_title: "Slack: slack_conversation"
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 `missing_scope` errors while using this resource check the scopes against
the documentation for the methods above.

## Example Usage

```hcl
Expand All @@ -20,23 +35,23 @@ data slack_conversation test {

The following arguments are supported:

* `channel_id` - (Required) The ID of the channel
- `channel_id` - (Required) The ID of the channel

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `name` - name of the public or private channel.
* `topic` - topic for the channel.
* `purpose` - purpose of the channel.
* `creator` - is the user ID of the member that created this channel.
* `created` - is a unix timestamp.
* `is_private` - means the conversation is privileged between two or more members.
* `is_archived` - indicates a conversation is archived. Frozen in time.
* `is_shared` - means the conversation is in some way shared between multiple workspaces.
* `is_ext_shared` - represents this conversation as being part of a Shared Channel
- `name` - name of the public or private channel.
- `topic` - topic for the channel.
- `purpose` - purpose of the channel.
- `creator` - is the user ID of the member that created this channel.
- `created` - is a unix timestamp.
- `is_private` - means the conversation is privileged between two or more members.
- `is_archived` - indicates a conversation is archived. Frozen in time.
- `is_shared` - means the conversation is in some way shared between multiple workspaces.
- `is_ext_shared` - represents this conversation as being part of a Shared Channel
with a remote organization.
* `is_org_shared` - explains whether this shared channel is shared between Enterprise
- `is_org_shared` - explains whether this shared channel is shared between Enterprise
Grid workspaces within the same organization.
* `is_general` - will be true if this channel is the "general" channel that includes
- `is_general` - will be true if this channel is the "general" channel that includes
all regular team members.
21 changes: 18 additions & 3 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ page_title: "Slack: slack_user"
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 `missing_scope` errors while using this resource check the scopes against
the documentation for the methods above.

## Example Usage

```hcl
Expand All @@ -24,13 +39,13 @@ data slack_user by_email {

The following arguments are supported:

* `name` - (Optional) The name of the user
* `email` - (Optional) The email of the user
- `name` - (Optional) The name of the user
- `email` - (Optional) The email of the user

The data source expects exactly one of these fields, you can't set both.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The ID of the user
- `id` - The ID of the user
28 changes: 19 additions & 9 deletions docs/data-sources/usergroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ page_title: "Slack: slack_usergroup"
Use this data source to get information about a usergroups for use in other
resources. The data source returns enabled groups only.

Requires
[usergroups:read](https://api.slack.com/scopes/usergroups:read) scope.
## 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 `missing_scope` errors while using this resource check the scopes against
the documentation for the methods above.

## Example Usage

Expand All @@ -27,18 +37,18 @@ data slack_usergroup by_id {

The following arguments are supported:

* `name` - (Optional) The name of the usergroup
* `usergroup_id` - (Optional) The id of the usergroup
- `name` - (Optional) The name of the usergroup
- `usergroup_id` - (Optional) The id of the usergroup

The data source expects exactly one of these fields, you can't set both.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The ID of the usergroup
* `description` - The short description of the User Group.
* `handle` - The mention handle.
* `users` - The user IDs that represent the entire list of users for the
- `id` - The ID of the usergroup
- `description` - The short description of the User Group.
- `handle` - The mention handle.
- `users` - The user IDs that represent the entire list of users for the
User Group.
* `channels` - The channel IDs for which the User Group uses as a default.
- `channels` - The channel IDs for which the User Group uses as a default.
51 changes: 38 additions & 13 deletions docs/resources/conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@ page_title: "Slack: slack_conversation"

Manages a Slack channel

## Required scopes

This resource requires the following scopes:

- [channels:read](https://api.slack.com/scopes/channels:read) (public channels)
- [channels:write](https://api.slack.com/scopes/channels:write) (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.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 `missing_scope` errors while using this resource check the scopes against
the documentation for the methods above.

## Example Usage

```hcl
Expand All @@ -22,24 +47,24 @@ resource slack_conversation test {

The following arguments are supported:

* `name` - (Required) name of the public or private channel.
* `topic` - (Optional) topic for the channel.
* `purpose` - (Optional) purpose of the channel.
* `permanent_members` - (Optional) user IDs to add to the channel.
* `is_private` - (Optional) create a private channel instead of a public one.
* `is_archived` - (Optional) indicates a conversation is archived. Frozen in time.
- `name` - (Required) name of the public or private channel.
- `topic` - (Optional) topic for the channel.
- `purpose` - (Optional) purpose of the channel.
- `permanent_members` - (Optional) user IDs to add to the channel.
- `is_private` - (Optional) create a private channel instead of a public one.
- `is_archived` - (Optional) indicates a conversation is archived. Frozen in time.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The channel ID (e.g. C015QDUB7ME).
* `creator` - is the user ID of the member that created this channel.
* `created` - is a unix timestamp.
* `is_shared` - means the conversation is in some way shared between multiple workspaces.
* `is_ext_shared` - represents this conversation as being part of a Shared Channel
- `id` - The channel ID (e.g. C015QDUB7ME).
- `creator` - is the user ID of the member that created this channel.
- `created` - is a unix timestamp.
- `is_shared` - means the conversation is in some way shared between multiple workspaces.
- `is_ext_shared` - represents this conversation as being part of a Shared Channel
with a remote organization.
* `is_org_shared` - explains whether this shared channel is shared between Enterprise
- `is_org_shared` - explains whether this shared channel is shared between Enterprise
Grid workspaces within the same organization.
* `is_general` - will be true if this channel is the "general" channel that includes
- `is_general` - will be true if this channel is the "general" channel that includes
all regular team members.
34 changes: 26 additions & 8 deletions docs/resources/usergroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,26 @@ page_title: "Slack: slack_usergroup"

# slack_usergroup Resource

Manages a Slack User Group. Requires
[usergroups:write](https://api.slack.com/scopes/usergroups:write) scope.
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 `missing_scope` errors while using this resource check the scopes against
the documentation for the methods above.

## Example Usage

Expand Down Expand Up @@ -44,16 +62,16 @@ resource slack_conversation "test" {

The following arguments are supported:

* `name` - (Required) a name for the User Group. Must be unique among User Groups.
* `description` - (Optional) a short description of the User Group.
* `handle` - (Optional) a mention handle. Must be unique among channels, users
- `name` - (Required) a name for the User Group. Must be unique among User Groups.
- `description` - (Optional) a short description of the User Group.
- `handle` - (Optional) a mention handle. Must be unique among channels, users
and User Groups.
* `users` - (Optional) user IDs that represent the entire list of users for the
- `users` - (Optional) user IDs that represent the entire list of users for the
User Group.
* `channels` - (Optional) channel IDs for which the User Group uses as a default.
- `channels` - (Optional) channel IDs for which the User Group uses as a default.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `id` - The usergroup ID
- `id` - The usergroup ID
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/zclconf/go-cty v1.8.3 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
google.golang.org/api v0.47.0 // indirect
google.golang.org/genproto v0.0.0-20210520160233-290a1ae68a05 // indirect
google.golang.org/grpc v1.38.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down

0 comments on commit 5ec7d9f

Please sign in to comment.