slack-ruby-client 1.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/integration_test.yml +45 -0
- data/.github/workflows/lint.yml +14 -0
- data/.github/workflows/pr_lint.yml +21 -0
- data/.github/workflows/test.yml +37 -0
- data/.gitignore +4 -3
- data/.rubocop.yml +6 -1
- data/.rubocop_todo.yml +88 -34
- data/.ruby-version +1 -0
- data/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +6 -5
- data/Gemfile +13 -1
- data/Gemfile.danger +6 -0
- data/README.md +78 -76
- data/RELEASING.md +2 -2
- data/SECURITY.md +9 -0
- data/UPGRADING.md +28 -0
- data/bin/commands/admin_analytics.rb +16 -10
- data/bin/commands/admin_apps.rb +48 -42
- data/bin/commands/admin_apps_approved.rb +17 -11
- data/bin/commands/admin_apps_requests.rb +28 -11
- data/bin/commands/admin_apps_restricted.rb +17 -11
- data/bin/commands/admin_audit_anomaly_allow.rb +29 -0
- data/bin/commands/admin_auth_policy.rb +37 -31
- data/bin/commands/admin_barriers.rb +44 -38
- data/bin/commands/admin_conversations.rb +221 -163
- data/bin/commands/admin_conversations_ekm.rb +17 -11
- data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
- data/bin/commands/admin_emoji.rb +50 -44
- data/bin/commands/admin_inviteRequests.rb +34 -28
- data/bin/commands/admin_inviteRequests_approved.rb +16 -10
- data/bin/commands/admin_inviteRequests_denied.rb +16 -10
- data/bin/commands/admin_roles.rb +46 -0
- data/bin/commands/admin_teams.rb +26 -20
- data/bin/commands/admin_teams_admins.rb +16 -10
- data/bin/commands/admin_teams_owners.rb +16 -10
- data/bin/commands/admin_teams_settings.rb +59 -53
- data/bin/commands/admin_usergroups.rb +45 -39
- data/bin/commands/admin_users.rb +91 -85
- data/bin/commands/admin_users_session.rb +72 -66
- data/bin/commands/admin_users_unsupportedVersions.rb +21 -0
- data/bin/commands/api.rb +14 -8
- data/bin/commands/apps.rb +15 -9
- data/bin/commands/apps_connections.rb +13 -7
- data/bin/commands/apps_event_authorizations.rb +16 -10
- data/bin/commands/apps_manifest.rb +48 -41
- data/bin/commands/auth.rb +21 -15
- data/bin/commands/auth_teams.rb +16 -10
- data/bin/commands/bookmarks.rb +59 -0
- data/bin/commands/bots.rb +15 -9
- data/bin/commands/calls.rb +49 -43
- data/bin/commands/calls_participants.rb +24 -18
- data/bin/commands/chat.rb +150 -141
- data/bin/commands/chat_scheduledMessages.rb +19 -13
- data/bin/commands/conversations.rb +233 -225
- data/bin/commands/dialog.rb +15 -9
- data/bin/commands/dnd.rb +46 -40
- data/bin/commands/emoji.rb +14 -7
- data/bin/commands/files.rb +112 -83
- data/bin/commands/files_comments.rb +15 -9
- data/bin/commands/files_remote.rb +73 -67
- data/bin/commands/functions_workflows_steps.rb +22 -0
- data/bin/commands/functions_workflows_steps_responses.rb +22 -0
- data/bin/commands/migration.rb +16 -10
- data/bin/commands/oauth.rb +18 -12
- data/bin/commands/oauth_v2.rb +28 -22
- data/bin/commands/openid_connect.rb +26 -20
- data/bin/commands/pins.rb +33 -26
- data/bin/commands/reactions.rb +52 -46
- data/bin/commands/reminders.rb +53 -47
- data/bin/commands/rtm.rb +15 -24
- data/bin/commands/search.rb +43 -37
- data/bin/commands/stars.rb +38 -32
- data/bin/commands/team.rb +47 -38
- data/bin/commands/team_billing.rb +13 -7
- data/bin/commands/team_preferences.rb +13 -7
- data/bin/commands/team_profile.rb +14 -8
- data/bin/commands/tooling_tokens.rb +14 -8
- data/bin/commands/usergroups.rb +64 -58
- data/bin/commands/usergroups_users.rb +27 -21
- data/bin/commands/users.rb +111 -105
- data/bin/commands/users_admin.rb +28 -22
- data/bin/commands/users_prefs.rb +13 -7
- data/bin/commands/users_profile.rb +26 -20
- data/bin/commands/views.rb +47 -39
- data/bin/commands/workflows.rb +36 -30
- data/bin/slack +48 -43
- data/lib/slack/real_time/api/message.rb +3 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
- data/lib/slack/real_time/api/typing.rb +2 -1
- data/lib/slack/real_time/client.rb +10 -28
- data/lib/slack/real_time/config.rb +3 -3
- data/lib/slack/real_time/models/channel.rb +4 -0
- data/lib/slack/real_time/models/{group.rb → mpim.rb} +1 -1
- data/lib/slack/real_time/models.rb +2 -1
- data/lib/slack/real_time/stores/base.rb +25 -9
- data/lib/slack/real_time/stores/starter.rb +323 -309
- data/lib/slack/real_time/stores/store.rb +265 -198
- data/lib/slack/real_time/stores.rb +1 -7
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +16 -0
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_conversations.rb +110 -28
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_emoji.rb +9 -9
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_users.rb +16 -16
- data/lib/slack/web/api/endpoints/admin_users_session.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_manifest.rb +8 -6
- data/lib/slack/web/api/endpoints/bookmarks.rb +88 -0
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +5 -5
- data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
- data/lib/slack/web/api/endpoints/chat.rb +37 -31
- data/lib/slack/web/api/endpoints/conversations.rb +38 -34
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/emoji.rb +2 -0
- data/lib/slack/web/api/endpoints/files.rb +45 -10
- data/lib/slack/web/api/endpoints/files_comments.rb +2 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +8 -8
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
- data/lib/slack/web/api/endpoints/migration.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/pins.rb +5 -3
- data/lib/slack/web/api/endpoints/reactions.rb +4 -4
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +0 -23
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/team.rb +13 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -3
- data/lib/slack/web/api/endpoints/users.rb +4 -4
- data/lib/slack/web/api/endpoints/users_admin.rb +2 -2
- data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/views.rb +16 -11
- data/lib/slack/web/api/endpoints/workflows.rb +4 -4
- data/lib/slack/web/api/endpoints.rb +12 -0
- data/lib/slack/web/api/errors.rb +146 -8
- data/lib/slack/web/api/mixins/conversations.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +2 -1
- data/lib/slack/web/api/patches/{chat.1.patch → chat.attachments-blocks.patch} +13 -14
- data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
- data/lib/slack/web/api/patches/views.view-json.patch +55 -0
- data/lib/slack/web/api/templates/command.erb +18 -12
- data/lib/slack/web/api/templates/method.erb +1 -1
- data/lib/slack/web/config.rb +2 -2
- data/lib/slack/web/faraday/connection.rb +4 -4
- data/lib/slack/web/faraday/request.rb +2 -0
- data/lib/slack/web/faraday/response/raise_error.rb +2 -10
- data/lib/slack/web/faraday/response/wrap_error.rb +1 -1
- data/lib/slack-ruby-client.rb +2 -1
- data/lib/tasks/real_time.rake +44 -24
- data/lib/tasks/web.rake +9 -8
- data/slack-ruby-client.gemspec +5 -14
- data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/events/config_spec.rb +2 -0
- data/spec/slack/events/request_spec.rb +5 -1
- data/spec/slack/messages/formatting_spec.rb +10 -0
- data/spec/slack/real_time/api/message_spec.rb +1 -1
- data/spec/slack/real_time/api/ping_spec.rb +1 -1
- data/spec/slack/real_time/api/typing_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +91 -127
- data/spec/slack/real_time/event_handlers/bot_spec.rb +19 -17
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +30 -27
- data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +35 -27
- data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +27 -23
- data/spec/slack/real_time/event_handlers/team_spec.rb +7 -8
- data/spec/slack/real_time/event_handlers/user_spec.rb +6 -5
- data/spec/slack/real_time/stores/store_spec.rb +50 -0
- data/spec/slack/slack_spec.rb +5 -4
- data/spec/slack/version_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +45 -17
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +6 -2
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +33 -16
- data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +2 -0
- data/spec/slack/web/api/mixins/users_spec.rb +2 -0
- data/spec/slack/web/api/pagination/cursor_spec.rb +11 -7
- data/spec/slack/web/client_spec.rb +39 -11
- data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -1
- data/spec/support/real_time/loaded_client.rb +120 -0
- metadata +45 -197
- data/.travis.yml +0 -29
- data/bin/commands/admin_conversations_whitelist.rb +0 -37
- data/bin/commands/apps_permissions.rb +0 -23
- data/bin/commands/apps_permissions_resources.rb +0 -15
- data/bin/commands/apps_permissions_scopes.rb +0 -13
- data/bin/commands/apps_permissions_users.rb +0 -26
- data/bin/commands/channels.rb +0 -23
- data/bin/commands/groups.rb +0 -14
- data/bin/commands/im.rb +0 -6
- data/bin/commands/mpim.rb +0 -6
- data/bin/commands.rb +0 -66
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +0 -64
- data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -36
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -31
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -21
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -50
- data/lib/slack/web/api/endpoints/channels.rb +0 -25
- data/lib/slack/web/api/endpoints/groups.rb +0 -13
- data/lib/slack/web/api/endpoints/im.rb +0 -13
- data/lib/slack/web/api/endpoints/mpim.rb +0 -13
- data/lib/slack/web/api/endpoints/presence.rb +0 -23
- data/lib/slack/web/api/patches/views.1.view-json.patch +0 -40
- data/lib/slack/web/api/patches/views.1.views-published.patch +0 -16
- data/lib/slack/web/api/templates/commands.erb +0 -6
- data/spec/fixtures/slack/web/rtm_start.yml +0 -815
- data/spec/slack/real_time/rtm_start_spec.rb +0 -14
- data/spec/slack/real_time/store_spec.rb +0 -12
@@ -1,39 +1,45 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'AdminAuthPolicy methods.'
|
8
|
+
command 'admin_auth_policy' do |g|
|
9
|
+
g.desc 'Assign entities to a particular authentication policy.'
|
10
|
+
g.long_desc %( Assign entities to a particular authentication policy. )
|
11
|
+
g.command 'assignEntities' do |c|
|
12
|
+
c.flag 'entity_ids', desc: 'Array of IDs to assign to the policy.'
|
13
|
+
c.flag 'entity_type', desc: 'The type of entity to assign to the policy. Currently, USER is supported.'
|
14
|
+
c.flag 'policy_name', desc: 'The name of the authentication policy to assign the entities to. Currently, email_password is the only policy that may be used with this method.'
|
15
|
+
c.action do |_global_options, options, _args|
|
16
|
+
puts JSON.dump(@client.admin_auth_policy_assignEntities(options))
|
17
|
+
end
|
18
|
+
end
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
g.desc 'Fetch all the entities assigned to a particular authentication policy by name.'
|
21
|
+
g.long_desc %( Fetch all the entities assigned to a particular authentication policy by name. )
|
22
|
+
g.command 'getEntities' do |c|
|
23
|
+
c.flag 'policy_name', desc: 'The name of the policy to fetch entities for. Currently, email_password is the only policy that may be used with this method.'
|
24
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
25
|
+
c.flag 'entity_type', desc: 'The type of entity to assign to the policy. Currently, USER is supported.'
|
26
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 and 1000, both inclusive.'
|
27
|
+
c.action do |_global_options, options, _args|
|
28
|
+
puts JSON.dump(@client.admin_auth_policy_getEntities(options))
|
29
|
+
end
|
30
|
+
end
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
g.desc 'Remove specified entities from a specified authentication policy.'
|
33
|
+
g.long_desc %( Remove specified entities from a specified authentication policy. )
|
34
|
+
g.command 'removeEntities' do |c|
|
35
|
+
c.flag 'entity_ids', desc: "Encoded IDs of the entities you'd like to remove from the policy."
|
36
|
+
c.flag 'entity_type', desc: 'The type of entity to assign to the policy. Currently, USER is supported.'
|
37
|
+
c.flag 'policy_name', desc: 'The name of the policy to remove entities from. Currently, email_password is the only policy that may be used with this method.'
|
38
|
+
c.action do |_global_options, options, _args|
|
39
|
+
puts JSON.dump(@client.admin_auth_policy_removeEntities(options))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
37
43
|
end
|
38
44
|
end
|
39
45
|
end
|
@@ -1,47 +1,53 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'AdminBarriers methods.'
|
8
|
+
command 'admin_barriers' do |g|
|
9
|
+
g.desc 'Create an Information Barrier'
|
10
|
+
g.long_desc %( Create an Information Barrier )
|
11
|
+
g.command 'create' do |c|
|
12
|
+
c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.'
|
13
|
+
c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.'
|
14
|
+
c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.'
|
15
|
+
c.action do |_global_options, options, _args|
|
16
|
+
puts JSON.dump(@client.admin_barriers_create(options))
|
17
|
+
end
|
18
|
+
end
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
g.desc 'Delete an existing Information Barrier'
|
21
|
+
g.long_desc %( Delete an existing Information Barrier )
|
22
|
+
g.command 'delete' do |c|
|
23
|
+
c.flag 'barrier_id', desc: "The ID of the barrier you're trying to delete."
|
24
|
+
c.action do |_global_options, options, _args|
|
25
|
+
puts JSON.dump(@client.admin_barriers_delete(options))
|
26
|
+
end
|
27
|
+
end
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
g.desc 'Get all Information Barriers for your organization'
|
30
|
+
g.long_desc %( Get all Information Barriers for your organization )
|
31
|
+
g.command 'list' do |c|
|
32
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
33
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
34
|
+
c.action do |_global_options, options, _args|
|
35
|
+
puts JSON.dump(@client.admin_barriers_list(options))
|
36
|
+
end
|
37
|
+
end
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
g.desc 'Update an existing Information Barrier'
|
40
|
+
g.long_desc %( Update an existing Information Barrier )
|
41
|
+
g.command 'update' do |c|
|
42
|
+
c.flag 'barrier_id', desc: "The ID of the barrier you're trying to modify."
|
43
|
+
c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.'
|
44
|
+
c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.'
|
45
|
+
c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.'
|
46
|
+
c.action do |_global_options, options, _args|
|
47
|
+
puts JSON.dump(@client.admin_barriers_update(options))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
45
51
|
end
|
46
52
|
end
|
47
53
|
end
|
@@ -1,169 +1,227 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'AdminConversations methods.'
|
8
|
+
command 'admin_conversations' do |g|
|
9
|
+
g.desc 'Archive a public or private channel.'
|
10
|
+
g.long_desc %( Archive a public or private channel. )
|
11
|
+
g.command 'archive' do |c|
|
12
|
+
c.flag 'channel_id', desc: 'The channel to archive.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump(@client.admin_conversations_archive(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
g.desc 'Archive public or private channels in bulk.'
|
19
|
+
g.long_desc %( Archive public or private channels in bulk. )
|
20
|
+
g.command 'bulkArchive' do |c|
|
21
|
+
c.flag 'channel_ids', desc: 'An array of channel IDs to archive.'
|
22
|
+
c.action do |_global_options, options, _args|
|
23
|
+
puts JSON.dump(@client.admin_conversations_bulkArchive(options))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
g.desc 'Delete public or private channels in bulk'
|
28
|
+
g.long_desc %( Delete public or private channels in bulk )
|
29
|
+
g.command 'bulkDelete' do |c|
|
30
|
+
c.flag 'channel_ids', desc: 'An array of channel IDs.'
|
31
|
+
c.action do |_global_options, options, _args|
|
32
|
+
puts JSON.dump(@client.admin_conversations_bulkDelete(options))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
g.desc 'Move public or private channels in bulk.'
|
37
|
+
g.long_desc %( Move public or private channels in bulk. )
|
38
|
+
g.command 'bulkMove' do |c|
|
39
|
+
c.flag 'channel_ids', desc: 'An array of channel IDs.'
|
40
|
+
c.flag 'target_team_id', desc: 'Target team ID.'
|
41
|
+
c.action do |_global_options, options, _args|
|
42
|
+
puts JSON.dump(@client.admin_conversations_bulkMove(options))
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
g.desc 'Convert a public channel to a private channel.'
|
47
|
+
g.long_desc %( Convert a public channel to a private channel. )
|
48
|
+
g.command 'convertToPrivate' do |c|
|
49
|
+
c.flag 'channel_id', desc: 'The channel to convert to private.'
|
50
|
+
c.flag 'name', desc: 'Name of private channel to create. Only respected when converting an MPIM.'
|
51
|
+
c.action do |_global_options, options, _args|
|
52
|
+
puts JSON.dump(@client.admin_conversations_convertToPrivate(options))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
g.desc 'Convert a private channel to a public channel.'
|
57
|
+
g.long_desc %( Convert a private channel to a public channel. )
|
58
|
+
g.command 'convertToPublic' do |c|
|
59
|
+
c.flag 'channel_id', desc: 'The channel to convert to public.'
|
60
|
+
c.action do |_global_options, options, _args|
|
61
|
+
puts JSON.dump(@client.admin_conversations_convertToPublic(options))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
g.desc 'Create a public or private channel-based conversation.'
|
66
|
+
g.long_desc %( Create a public or private channel-based conversation. )
|
67
|
+
g.command 'create' do |c|
|
68
|
+
c.flag 'is_private', desc: 'When true, creates a private channel instead of a public channel.'
|
69
|
+
c.flag 'name', desc: 'Name of the public or private channel to create.'
|
70
|
+
c.flag 'description', desc: 'Description of the public or private channel to create.'
|
71
|
+
c.flag 'org_wide', desc: 'When true, the channel will be available org-wide. Note: if the channel is not org_wide=true, you must specify a team_id for this channel.'
|
72
|
+
c.flag 'team_id', desc: 'The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.'
|
73
|
+
c.action do |_global_options, options, _args|
|
74
|
+
puts JSON.dump(@client.admin_conversations_create(options))
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
g.desc 'Delete a public or private channel.'
|
79
|
+
g.long_desc %( Delete a public or private channel. )
|
80
|
+
g.command 'delete' do |c|
|
81
|
+
c.flag 'channel_id', desc: 'The channel to delete.'
|
82
|
+
c.action do |_global_options, options, _args|
|
83
|
+
puts JSON.dump(@client.admin_conversations_delete(options))
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
g.desc 'Disconnect a connected channel from one or more workspaces.'
|
88
|
+
g.long_desc %( Disconnect a connected channel from one or more workspaces. )
|
89
|
+
g.command 'disconnectShared' do |c|
|
90
|
+
c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
|
91
|
+
c.flag 'leaving_team_ids', desc: 'team IDs getting removed from the channel, optional if there are only two teams in the channel.'
|
92
|
+
c.action do |_global_options, options, _args|
|
93
|
+
puts JSON.dump(@client.admin_conversations_disconnectShared(options))
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
g.desc 'Get conversation preferences for a public or private channel.'
|
98
|
+
g.long_desc %( Get conversation preferences for a public or private channel. )
|
99
|
+
g.command 'getConversationPrefs' do |c|
|
100
|
+
c.flag 'channel_id', desc: 'The channel to get preferences for.'
|
101
|
+
c.action do |_global_options, options, _args|
|
102
|
+
puts JSON.dump(@client.admin_conversations_getConversationPrefs(options))
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
g.desc "This API endpoint can be used by any admin to get a conversation's retention policy."
|
107
|
+
g.long_desc %( This API endpoint can be used by any admin to get a conversation's retention policy. )
|
108
|
+
g.command 'getCustomRetention' do |c|
|
109
|
+
c.flag 'channel_id', desc: 'The conversation to get the retention policy for.'
|
110
|
+
c.action do |_global_options, options, _args|
|
111
|
+
puts JSON.dump(@client.admin_conversations_getCustomRetention(options))
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
g.desc 'Get all the workspaces a given public or private channel is connected to within this Enterprise org.'
|
116
|
+
g.long_desc %( Get all the workspaces a given public or private channel is connected to within this Enterprise org. )
|
117
|
+
g.command 'getTeams' do |c|
|
118
|
+
c.flag 'channel_id', desc: 'The channel to determine connected workspaces within the organization for.'
|
119
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
120
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
121
|
+
c.action do |_global_options, options, _args|
|
122
|
+
puts JSON.dump(@client.admin_conversations_getTeams(options))
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
g.desc 'Invite a user to a public or private channel.'
|
127
|
+
g.long_desc %( Invite a user to a public or private channel. )
|
128
|
+
g.command 'invite' do |c|
|
129
|
+
c.flag 'channel_id', desc: 'The channel that the users will be invited to.'
|
130
|
+
c.flag 'user_ids', desc: 'The users to invite.'
|
131
|
+
c.action do |_global_options, options, _args|
|
132
|
+
puts JSON.dump(@client.admin_conversations_invite(options))
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
g.desc 'Returns channels on the given team using the filters.'
|
137
|
+
g.long_desc %( Returns channels on the given team using the filters. )
|
138
|
+
g.command 'lookup' do |c|
|
139
|
+
c.flag 'last_message_activity_before', desc: 'Filter by public channels where the most recent message was sent before last_message_activity.'
|
140
|
+
c.flag 'team_ids', desc: 'Array of team IDs to filter by.'
|
141
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned in the previous call, to fetch the next page.'
|
142
|
+
c.flag 'limit', desc: 'Maximum number of results.'
|
143
|
+
c.flag 'max_member_count', desc: 'Filter by public channels with member count equal to or less than the specified number.'
|
144
|
+
c.action do |_global_options, options, _args|
|
145
|
+
puts JSON.dump(@client.admin_conversations_lookup(options))
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
g.desc "This API endpoint can be used by any admin to remove a conversation's retention policy."
|
150
|
+
g.long_desc %( This API endpoint can be used by any admin to remove a conversation's retention policy. )
|
151
|
+
g.command 'removeCustomRetention' do |c|
|
152
|
+
c.flag 'channel_id', desc: 'The conversation to set the retention policy for.'
|
153
|
+
c.action do |_global_options, options, _args|
|
154
|
+
puts JSON.dump(@client.admin_conversations_removeCustomRetention(options))
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
g.desc 'Rename a public or private channel.'
|
159
|
+
g.long_desc %( Rename a public or private channel. )
|
160
|
+
g.command 'rename' do |c|
|
161
|
+
c.flag 'channel_id', desc: 'The channel to rename.'
|
162
|
+
c.flag 'name', desc: '.'
|
163
|
+
c.action do |_global_options, options, _args|
|
164
|
+
puts JSON.dump(@client.admin_conversations_rename(options))
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
g.desc 'Search for public or private channels in an Enterprise organization.'
|
169
|
+
g.long_desc %( Search for public or private channels in an Enterprise organization. )
|
170
|
+
g.command 'search' do |c|
|
171
|
+
c.flag 'connected_team_ids', desc: 'Array of encoded team IDs, signifying the external orgs to search through.'
|
172
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
173
|
+
c.flag 'limit', desc: 'Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.'
|
174
|
+
c.flag 'query', desc: 'Name of the the channel to query by.'
|
175
|
+
c.flag 'search_channel_types', desc: 'The type of channel to include or exclude in the search. For example private will search private channels, while private_exclude will exclude them. For a full list of types, check the Types section.'
|
176
|
+
c.flag 'sort', desc: 'Possible values are relevant (search ranking based on what we think is closest), name (alphabetical), member_count (number of users in the channel), and created (date channel was created). You can optionally pair this with the sort_dir arg to change how it is sorted.'
|
177
|
+
c.flag 'sort_dir', desc: 'Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).'
|
178
|
+
c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the internal workspaces to search through.'
|
179
|
+
c.action do |_global_options, options, _args|
|
180
|
+
puts JSON.dump(@client.admin_conversations_search(options))
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
g.desc 'Set the posting permissions for a public or private channel.'
|
185
|
+
g.long_desc %( Set the posting permissions for a public or private channel. )
|
186
|
+
g.command 'setConversationPrefs' do |c|
|
187
|
+
c.flag 'channel_id', desc: 'The channel to set the prefs for.'
|
188
|
+
c.flag 'prefs', desc: 'The prefs for this channel in a stringified JSON format.'
|
189
|
+
c.action do |_global_options, options, _args|
|
190
|
+
puts JSON.dump(@client.admin_conversations_setConversationPrefs(options))
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
g.desc "This API endpoint can be used by any admin to set a conversation's retention policy."
|
195
|
+
g.long_desc %( This API endpoint can be used by any admin to set a conversation's retention policy. )
|
196
|
+
g.command 'setCustomRetention' do |c|
|
197
|
+
c.flag 'channel_id', desc: 'The conversation to set the retention policy for.'
|
198
|
+
c.flag 'duration_days', desc: 'The message retention duration in days to set for this conversation.'
|
199
|
+
c.action do |_global_options, options, _args|
|
200
|
+
puts JSON.dump(@client.admin_conversations_setCustomRetention(options))
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
g.desc 'Set the workspaces in an Enterprise grid org that connect to a public or private channel.'
|
205
|
+
g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a public or private channel. )
|
206
|
+
g.command 'setTeams' do |c|
|
207
|
+
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
|
208
|
+
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
|
209
|
+
c.flag 'target_team_ids', desc: 'A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.'
|
210
|
+
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
|
211
|
+
c.action do |_global_options, options, _args|
|
212
|
+
puts JSON.dump(@client.admin_conversations_setTeams(options))
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
g.desc 'Unarchive a public or private channel.'
|
217
|
+
g.long_desc %( Unarchive a public or private channel. )
|
218
|
+
g.command 'unarchive' do |c|
|
219
|
+
c.flag 'channel_id', desc: 'The channel to unarchive.'
|
220
|
+
c.action do |_global_options, options, _args|
|
221
|
+
puts JSON.dump(@client.admin_conversations_unarchive(options))
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
167
225
|
end
|
168
226
|
end
|
169
227
|
end
|