slack-ruby-client 0.14.5 → 0.14.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +11 -4
- data/README.md +51 -19
- data/bin/commands.rb +12 -0
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_conversations.rb +17 -0
- data/bin/commands/admin_emoji.rb +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_users.rb +97 -0
- data/bin/commands/chat.rb +8 -8
- data/bin/commands/conversations.rb +1 -1
- data/bin/commands/files.rb +1 -0
- data/bin/commands/files_remote.rb +1 -1
- data/bin/commands/oauth.rb +1 -1
- data/lib/slack-ruby-client.rb +1 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +24 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +163 -0
- data/lib/slack/web/api/endpoints/chat.rb +8 -8
- data/lib/slack/web/api/endpoints/conversations.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +2 -0
- data/lib/slack/web/api/endpoints/files_remote.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth.rb +1 -1
- data/lib/slack/web/api/errors.rb +566 -0
- data/lib/slack/web/api/errors/slack_error.rb +12 -0
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/client.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +4 -1
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +10 -1
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +75 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/conversations_spec.rb +1 -1
- data/spec/slack/web/api/errors/slack_error_spec.rb +22 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +26 -3
- metadata +54 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24883016f639f51e34aa4026ff203ef1cb6fa66abac9c0017d5653508f9169c7
|
4
|
+
data.tar.gz: 49bf4585f49dba526c764e018150ed9e884161c67529e442ef9e5df104d48345
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db889eac4fbc7effec2f2f8bd319523f4e3c646ad0be8b52e2221a444d79cca38bae6fed8d0b6aac100c4869f862f6cfddb4644407d305977ad8b2a3fc1da670
|
7
|
+
data.tar.gz: 636f316d2e9efba1f663ccf0691fcf715b4f6a16d80bb98d8e5676d5479d6536beaa9a5c4de0452319a166ef50f9c7e6cddf451e6898600b3a57897b862472d2
|
data/.rubocop.yml
CHANGED
@@ -11,6 +11,7 @@ AllCops:
|
|
11
11
|
- vendor/**/*
|
12
12
|
- lib/slack/web/api/slack-api-ref/**/*
|
13
13
|
- lib/slack/web/api/endpoints/* # Auto-generated
|
14
|
+
- lib/slack/web/api/errors.rb # Auto-generated
|
14
15
|
- spec/slack/web/api/endpoints/* # Auto-generated
|
15
16
|
Layout/EmptyLineAfterMagicComment:
|
16
17
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
### 0.14.6 (2020/3/28)
|
2
|
+
|
3
|
+
* [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin_inviteRequests_approve`, `admin_inviteRequests_deny`, `admin_inviteRequests_list`, `admin_inviteRequests_approved_list`, `admin_inviteRequests_denied_list`, `admin_teams_create`, `admin_teams_list`, `admin_teams_admins_list`, `admin_teams_owners_list`, `admin_teams_settings`, `admin_teams_settings_setIcon`, `admin_teams_settings_setName`, `admin_teams_settings_setDescription`, `admin_users_assign`, `admin_users_invite`, `admin_users_remove`, `admin_users_setAdmin`, `admin_users_setOwner` and `admin_users_setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
|
4
|
+
* [#311](https://github.com/slack-ruby/slack-ruby-client/pull/311): Made Web API `response_metadata` more accessible in errors - [@jmanian](https://github.com/jmanian).
|
5
|
+
* [#312](https://github.com/slack-ruby/slack-ruby-client/pull/312): Added specific error classes for Web API - [@jmanian](https://github.com/jmanian).
|
6
|
+
* [#313](https://github.com/slack-ruby/slack-ruby-client/pull/313): Added `admin_teams_settings_info`, `admin_users_list`, `admin_users_setExpiration`, `admin_apps_approved_list`, `admin_apps_restricted_list`, `admin_conversations_setTeams`, `admin_emoji_add`, `admin_emoji_addAlias`, `admin_emoji_list`, `admin_emoji_remove` and `admin_emoji_rename` endpoints - [@dblock](https://github.com/dblock).
|
7
|
+
|
1
8
|
### 0.14.5 (2019/12/23)
|
2
9
|
|
3
10
|
* [#293](https://github.com/slack-ruby/slack-ruby-client/pull/293): Rubocop auto-correct and comprehensive todo - [@jcraigk](https://github.com/jcraigk).
|
4
11
|
* [#297](https://github.com/slack-ruby/slack-ruby-client/pull/297): Various Rubocop fixes - [@jcraigk](https://github.com/jcraigk).
|
5
|
-
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298):
|
6
|
-
* [#
|
12
|
+
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Added `admin_apps`, `admin_app_requests` and `views` endpoints - [@jmanian](https://github.com/jmanian).
|
13
|
+
* [#303](https://github.com/slack-ruby/slack-ruby-client/pull/303): Added `oauth_v2_access` and `views_publish` endpoints - [@jwright](https://github.com/jwright).
|
7
14
|
* [#309](https://github.com/slack-ruby/slack-ruby-client/pull/309): Stop ping on `inactive_account` and `invalid_auth` - [@dblock](https://github.com/dblock).
|
8
15
|
|
9
16
|
### 0.14.4 (2019/7/28)
|
@@ -167,8 +174,8 @@
|
|
167
174
|
### 0.7.1 (2016/5/2)
|
168
175
|
|
169
176
|
* [#82](https://github.com/slack-ruby/slack-ruby-client/pull/82): Fix `usergroups.users.{list,update}` and `files.comments.{add,edit,delete}` APIs - [@masatomo](https://github.com/masatomo).
|
170
|
-
* [#73](https://github.com/slack-ruby/slack-ruby-client/issues/73):
|
171
|
-
* [#69](https://github.com/slack-ruby/slack-ruby-client/issues/69):
|
177
|
+
* [#73](https://github.com/slack-ruby/slack-ruby-client/issues/73): Added a `closed` event - [@rkadyb](https://github.com/rkadyb).
|
178
|
+
* [#69](https://github.com/slack-ruby/slack-ruby-client/issues/69): Added attachments support for `Slack::Web::Api::Endpoints::Chat.chat_update` - [@nicka](https://github.com/nicka).
|
172
179
|
* [#85](https://github.com/slack-ruby/slack-ruby-client/issues/85): Compatibility with WebMock 2.0 - [@dblock](https://github.com/dblock).
|
173
180
|
* Added `as_user` to `chat_delete` Web API - [@dblock](https://github.com/dblock).
|
174
181
|
* Added `reminders_add`, `reminders_complete`, `reminders_delete`, `reminders_info` and `reminders_list` to Web API - [@dblock](https://github.com/dblock).
|
data/README.md
CHANGED
@@ -20,17 +20,21 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
20
20
|
- [Using the Legacy API Token](#using-the-legacy-api-token)
|
21
21
|
- [Global Settings](#global-settings)
|
22
22
|
- [Web Client](#web-client)
|
23
|
-
- [
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
- [Web Client Examples](#web-client-examples)
|
24
|
+
- [Test Auth](#test-auth)
|
25
|
+
- [Send Messages](#send-messages)
|
26
|
+
- [List Channels](#list-channels)
|
27
|
+
- [Upload a File](#upload-a-file)
|
28
|
+
- [Get Channel Info](#get-channel-info)
|
29
|
+
- [Get User Info](#get-user-info)
|
30
|
+
- [Search for a User](#search-for-a-user)
|
31
|
+
- [Other](#other)
|
31
32
|
- [Web Client Options](#web-client-options)
|
32
33
|
- [Pagination Support](#pagination-support)
|
33
34
|
- [Error Handling](#error-handling)
|
35
|
+
- [Slack Errors](#slack-errors)
|
36
|
+
- [Rate Limiting](#rate-limiting)
|
37
|
+
- [Other Errors](#other-errors)
|
34
38
|
- [RealTime Client](#realtime-client)
|
35
39
|
- [Slack::RealTime::Stores::Store](#slackrealtimestoresstore)
|
36
40
|
- [Slack::RealTime::Stores::Starter](#slackrealtimestoresstarter)
|
@@ -67,7 +71,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
67
71
|
|
68
72
|
## Stable Release
|
69
73
|
|
70
|
-
You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.
|
74
|
+
You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.6. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
71
75
|
|
72
76
|
## Installation
|
73
77
|
|
@@ -122,14 +126,18 @@ logger | An optional logger, defaults to `::Logger.new(STDOUT)` at `Logger
|
|
122
126
|
|
123
127
|
The Slack Web API allows you to build applications that interact with Slack.
|
124
128
|
|
125
|
-
####
|
129
|
+
#### Web Client Examples
|
130
|
+
|
131
|
+
Here are some examples of how to use the web client with the Web API.
|
132
|
+
|
133
|
+
##### Test Auth
|
126
134
|
|
127
135
|
```ruby
|
128
136
|
client = Slack::Web::Client.new
|
129
137
|
client.auth_test
|
130
138
|
```
|
131
139
|
|
132
|
-
|
140
|
+
##### Send Messages
|
133
141
|
|
134
142
|
Send messages with [chat_PostMessage](https://api.slack.com/methods/chat.postMessage).
|
135
143
|
|
@@ -141,7 +149,7 @@ See a fully working example in [examples/hi_web](examples/hi_web/hi.rb).
|
|
141
149
|
|
142
150
|
![](examples/hi_web/hi.gif)
|
143
151
|
|
144
|
-
|
152
|
+
##### List Channels
|
145
153
|
|
146
154
|
List channels with [channels_list](https://api.slack.com/methods/channels.list).
|
147
155
|
|
@@ -151,7 +159,7 @@ channels = client.channels_list.channels
|
|
151
159
|
general_channel = channels.detect { |c| c.name == 'general' }
|
152
160
|
```
|
153
161
|
|
154
|
-
|
162
|
+
##### Upload a File
|
155
163
|
|
156
164
|
Upload a file with [files_upload](https://api.slack.com/methods/files.upload).
|
157
165
|
|
@@ -166,7 +174,7 @@ client.files_upload(
|
|
166
174
|
)
|
167
175
|
```
|
168
176
|
|
169
|
-
|
177
|
+
##### Get Channel Info
|
170
178
|
|
171
179
|
You can use a channel ID or name (prefixed with `#`) in all functions that take a `:channel` argument. Lookup by name is not supported by the Slack API and the `channels_id` method called invokes `channels_list` in order to locate the channel ID.
|
172
180
|
|
@@ -178,7 +186,7 @@ client.channels_info(channel: 'C04KB5X4D') # calls channels_info
|
|
178
186
|
client.channels_info(channel: '#general') # calls channels_list followed by channels_info
|
179
187
|
```
|
180
188
|
|
181
|
-
|
189
|
+
##### Get User Info
|
182
190
|
|
183
191
|
You can use a user ID or name (prefixed with `@`) in all functions that take a `:user` argument. Lookup by name is not supported by the Slack API and the `users_id` method called invokes `users_list` in order to locate the user ID.
|
184
192
|
|
@@ -190,7 +198,7 @@ client.users_info(user: 'U092BDCLV') # calls users_info
|
|
190
198
|
client.users_info(user: '@dblock') # calls users_list followed by users_info
|
191
199
|
```
|
192
200
|
|
193
|
-
|
201
|
+
##### Search for a User
|
194
202
|
|
195
203
|
Constructs an in-memory index of users and searches it. If you want to use this functionality, add the [picky](https://github.com/floere/picky) gem to your project's Gemfile.
|
196
204
|
|
@@ -198,7 +206,7 @@ Constructs an in-memory index of users and searches it. If you want to use this
|
|
198
206
|
client.users_search(user: 'dblock')
|
199
207
|
```
|
200
208
|
|
201
|
-
|
209
|
+
##### Other
|
202
210
|
|
203
211
|
Refer to the [Slack Web API Method Reference](https://api.slack.com/methods) for the list of all available functions.
|
204
212
|
|
@@ -270,9 +278,33 @@ all_members # many thousands of team members retrieved 10 at a time
|
|
270
278
|
|
271
279
|
#### Error Handling
|
272
280
|
|
273
|
-
|
281
|
+
##### Slack Errors
|
282
|
+
|
283
|
+
If Slack returns an error for the request, then an error will be raised. The error class is specific to the type of error that Slack returns. For instance if Slack returns `account_inactive` then the error will be `Slack::Web::Api::Errors::AccountInactive`. This allows you to handle certain types of errors as needed:
|
284
|
+
|
285
|
+
```ruby
|
286
|
+
rescue Slack::Web::Api::Errors::AccountInactive => e
|
287
|
+
# deal with inactive account
|
288
|
+
end
|
289
|
+
```
|
290
|
+
|
291
|
+
All of these errors inherit from `Slack::Web::Api::Errors::SlackError`, so you can handle or silence all errors if necessary:
|
292
|
+
|
293
|
+
```ruby
|
294
|
+
rescue Slack::Web::Api::Errors::SlackError => e
|
295
|
+
# capture all Slack errors
|
296
|
+
end
|
297
|
+
```
|
298
|
+
|
299
|
+
If there's a new error type that is not yet known by this library, then it will raise `Slack::Web::Api::Errors::SlackError`. (Update the Web API if you find that errors are missing — see [CONTRIBUTING](CONTRIBUTING.md).)
|
300
|
+
|
301
|
+
In all of these cases the error message contains the error code, which is also accessible with `slack_error.error`. In case of multiple errors, the error message contains the error codes separated by commas, or they are accessible as an array with `slack_error.errors`. The original response is also accessible using the `response` attribute. The `response_metadata` is accessible with `slack_error.response_metadata`.
|
302
|
+
|
303
|
+
##### Rate Limiting
|
304
|
+
|
305
|
+
If you exceed [Slack’s rate limits](https://api.slack.com/docs/rate-limits), a `Slack::Web::Api::Errors::TooManyRequestsError` will be raised instead. (This does not inherit from `Slack::Web::Api::Errors::SlackError`.)
|
274
306
|
|
275
|
-
|
307
|
+
##### Other Errors
|
276
308
|
|
277
309
|
In any other case, a `Faraday::ClientError` will be raised. This may be the case if Slack is temporarily unavailable, for example.
|
278
310
|
|
data/bin/commands.rb
CHANGED
@@ -2,7 +2,19 @@
|
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
4
|
require 'commands/admin_apps'
|
5
|
+
require 'commands/admin_apps_approved'
|
5
6
|
require 'commands/admin_apps_requests'
|
7
|
+
require 'commands/admin_apps_restricted'
|
8
|
+
require 'commands/admin_conversations'
|
9
|
+
require 'commands/admin_emoji'
|
10
|
+
require 'commands/admin_inviteRequests'
|
11
|
+
require 'commands/admin_inviteRequests_approved'
|
12
|
+
require 'commands/admin_inviteRequests_denied'
|
13
|
+
require 'commands/admin_teams'
|
14
|
+
require 'commands/admin_teams_admins'
|
15
|
+
require 'commands/admin_teams_owners'
|
16
|
+
require 'commands/admin_teams_settings'
|
17
|
+
require 'commands/admin_users'
|
6
18
|
require 'commands/admin_users_session'
|
7
19
|
require 'commands/api'
|
8
20
|
require 'commands/apps'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminAppsApproved methods.'
|
5
|
+
command 'admin_apps_approved' do |g|
|
6
|
+
g.desc 'List approved apps for an org or workspace.'
|
7
|
+
g.long_desc %( List approved apps for an org or workspace. )
|
8
|
+
g.command 'list' do |c|
|
9
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
10
|
+
c.flag 'enterprise_id', desc: '.'
|
11
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
12
|
+
c.flag 'team_id', desc: '.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump($client.admin_apps_approved_list(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminAppsRestricted methods.'
|
5
|
+
command 'admin_apps_restricted' do |g|
|
6
|
+
g.desc 'List restricted apps for an org or workspace.'
|
7
|
+
g.long_desc %( List restricted apps for an org or workspace. )
|
8
|
+
g.command 'list' do |c|
|
9
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
10
|
+
c.flag 'enterprise_id', desc: '.'
|
11
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
12
|
+
c.flag 'team_id', desc: '.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump($client.admin_apps_restricted_list(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminConversations methods.'
|
5
|
+
command 'admin_conversations' do |g|
|
6
|
+
g.desc 'Set the workspaces in an Enterprise grid org that connect to a channel.'
|
7
|
+
g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a channel. )
|
8
|
+
g.command 'setTeams' do |c|
|
9
|
+
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
|
10
|
+
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
|
11
|
+
c.flag 'target_team_ids', desc: "The list of workspaces to which the channel should be shared. Not required if the channel is being shared orgwide. Example: ['T1234', 'T5678']."
|
12
|
+
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump($client.admin_conversations_setTeams(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminEmoji methods.'
|
5
|
+
command 'admin_emoji' do |g|
|
6
|
+
g.desc 'Add an emoji.'
|
7
|
+
g.long_desc %( Add an emoji. )
|
8
|
+
g.command 'add' do |c|
|
9
|
+
c.flag 'name', desc: 'The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.'
|
10
|
+
c.flag 'url', desc: 'The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.'
|
11
|
+
c.action do |_global_options, options, _args|
|
12
|
+
puts JSON.dump($client.admin_emoji_add(options))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
g.desc 'Add an emoji alias.'
|
17
|
+
g.long_desc %( Add an emoji alias. )
|
18
|
+
g.command 'addAlias' do |c|
|
19
|
+
c.flag 'alias_for', desc: 'The alias of the emoji.'
|
20
|
+
c.flag 'name', desc: 'The name of the emoji to be aliased. Colons (:myemoji:) around the value are not required, although they may be included.'
|
21
|
+
c.action do |_global_options, options, _args|
|
22
|
+
puts JSON.dump($client.admin_emoji_addAlias(options))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
g.desc 'List emoji for an Enterprise Grid organization.'
|
27
|
+
g.long_desc %( List emoji for an Enterprise Grid organization. )
|
28
|
+
g.command 'list' do |c|
|
29
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
30
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
31
|
+
c.action do |_global_options, options, _args|
|
32
|
+
puts JSON.dump($client.admin_emoji_list(options))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
g.desc 'Remove an emoji across an Enterprise Grid organization'
|
37
|
+
g.long_desc %( Remove an emoji across an Enterprise Grid organization )
|
38
|
+
g.command 'remove' do |c|
|
39
|
+
c.flag 'name', desc: 'The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.'
|
40
|
+
c.action do |_global_options, options, _args|
|
41
|
+
puts JSON.dump($client.admin_emoji_remove(options))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
g.desc 'Rename an emoji.'
|
46
|
+
g.long_desc %( Rename an emoji. )
|
47
|
+
g.command 'rename' do |c|
|
48
|
+
c.flag 'name', desc: 'The name of the emoji to be renamed. Colons (:myemoji:) around the value are not required, although they may be included.'
|
49
|
+
c.flag 'new_name', desc: 'The new name of the emoji.'
|
50
|
+
c.action do |_global_options, options, _args|
|
51
|
+
puts JSON.dump($client.admin_emoji_rename(options))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminInviterequests methods.'
|
5
|
+
command 'admin_inviteRequests' do |g|
|
6
|
+
g.desc 'Approve a workspace invite request.'
|
7
|
+
g.long_desc %( Approve a workspace invite request. )
|
8
|
+
g.command 'approve' do |c|
|
9
|
+
c.flag 'invite_request_id', desc: 'ID of the request to invite.'
|
10
|
+
c.flag 'team_id', desc: 'ID for the workspace where the invite request was made.'
|
11
|
+
c.action do |_global_options, options, _args|
|
12
|
+
puts JSON.dump($client.admin_inviteRequests_approve(options))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
g.desc 'Deny a workspace invite request.'
|
17
|
+
g.long_desc %( Deny a workspace invite request. )
|
18
|
+
g.command 'deny' do |c|
|
19
|
+
c.flag 'invite_request_id', desc: 'ID of the request to invite.'
|
20
|
+
c.flag 'team_id', desc: 'ID for the workspace where the invite request was made.'
|
21
|
+
c.action do |_global_options, options, _args|
|
22
|
+
puts JSON.dump($client.admin_inviteRequests_deny(options))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
g.desc 'List all pending workspace invite requests.'
|
27
|
+
g.long_desc %( List all pending workspace invite requests. )
|
28
|
+
g.command 'list' do |c|
|
29
|
+
c.flag 'cursor', desc: 'Value of the next_cursor field sent as part of the previous API response.'
|
30
|
+
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive.'
|
31
|
+
c.flag 'team_id', desc: 'ID for the workspace where the invite requests were made.'
|
32
|
+
c.action do |_global_options, options, _args|
|
33
|
+
puts JSON.dump($client.admin_inviteRequests_list(options))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminInviterequestsApproved methods.'
|
5
|
+
command 'admin_inviteRequests_approved' do |g|
|
6
|
+
g.desc 'List all approved workspace invite requests.'
|
7
|
+
g.long_desc %( List all approved workspace invite requests. )
|
8
|
+
g.command 'list' do |c|
|
9
|
+
c.flag 'cursor', desc: 'Value of the next_cursor field sent as part of the previous API response.'
|
10
|
+
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive.'
|
11
|
+
c.flag 'team_id', desc: 'ID for the workspace where the invite requests were made.'
|
12
|
+
c.action do |_global_options, options, _args|
|
13
|
+
puts JSON.dump($client.admin_inviteRequests_approved_list(options))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminInviterequestsDenied methods.'
|
5
|
+
command 'admin_inviteRequests_denied' do |g|
|
6
|
+
g.desc 'List all denied workspace invite requests.'
|
7
|
+
g.long_desc %( List all denied workspace invite requests. )
|
8
|
+
g.command 'list' do |c|
|
9
|
+
c.flag 'cursor', desc: 'Value of the next_cursor field sent as part of the previous api response.'
|
10
|
+
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation. Must be between 1 - 1000 both inclusive.'
|
11
|
+
c.flag 'team_id', desc: 'ID for the workspace where the invite requests were made.'
|
12
|
+
c.action do |_global_options, options, _args|
|
13
|
+
puts JSON.dump($client.admin_inviteRequests_denied_list(options))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminTeams methods.'
|
5
|
+
command 'admin_teams' do |g|
|
6
|
+
g.desc 'Create an Enterprise team.'
|
7
|
+
g.long_desc %( Create an Enterprise team. )
|
8
|
+
g.command 'create' do |c|
|
9
|
+
c.flag 'team_domain', desc: 'Team domain (for example, slacksoftballteam).'
|
10
|
+
c.flag 'team_name', desc: 'Team name (for example, Slack Softball Team).'
|
11
|
+
c.flag 'team_description', desc: 'Description for the team.'
|
12
|
+
c.flag 'team_discoverability', desc: "Who can join the team. A team's discoverability can be open, closed, invite_only, or unlisted."
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump($client.admin_teams_create(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
g.desc 'List all teams on an Enterprise organization'
|
19
|
+
g.long_desc %( List all teams on an Enterprise organization )
|
20
|
+
g.command 'list' do |c|
|
21
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
22
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 100 both inclusive.'
|
23
|
+
c.action do |_global_options, options, _args|
|
24
|
+
puts JSON.dump($client.admin_teams_list(options))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'AdminTeamsAdmins methods.'
|
5
|
+
command 'admin_teams_admins' do |g|
|
6
|
+
g.desc 'List all of the admins on a given workspace.'
|
7
|
+
g.long_desc %( List all of the admins on a given workspace. )
|
8
|
+
g.command 'list' do |c|
|
9
|
+
c.flag 'team_id', desc: '.'
|
10
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
11
|
+
c.flag 'limit', desc: 'The maximum number of items to return.'
|
12
|
+
c.action do |_global_options, options, _args|
|
13
|
+
puts JSON.dump($client.admin_teams_admins_list(options))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|