slack-ruby-client 0.15.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/.rubocop_todo.yml +75 -43
  4. data/.travis.yml +2 -4
  5. data/CHANGELOG.md +32 -0
  6. data/CONTRIBUTING.md +6 -13
  7. data/LICENSE.md +1 -1
  8. data/README.md +19 -36
  9. data/RELEASING.md +1 -1
  10. data/UPGRADING.md +56 -2
  11. data/bin/commands/admin_analytics.rb +16 -0
  12. data/bin/commands/admin_apps.rb +26 -2
  13. data/bin/commands/admin_apps_requests.rb +1 -0
  14. data/bin/commands/admin_auth_policy.rb +39 -0
  15. data/bin/commands/admin_barriers.rb +47 -0
  16. data/bin/commands/admin_conversations.rb +154 -2
  17. data/bin/commands/admin_conversations_ekm.rb +17 -0
  18. data/bin/commands/admin_conversations_restrictAccess.rb +3 -3
  19. data/bin/commands/admin_conversations_whitelist.rb +1 -1
  20. data/bin/commands/admin_emoji.rb +1 -1
  21. data/bin/commands/admin_teams.rb +1 -1
  22. data/bin/commands/admin_usergroups.rb +2 -2
  23. data/bin/commands/admin_users.rb +3 -2
  24. data/bin/commands/admin_users_session.rb +62 -0
  25. data/bin/commands/api.rb +0 -1
  26. data/bin/commands/apps_connections.rb +13 -0
  27. data/bin/commands/apps_event_authorizations.rb +16 -0
  28. data/bin/commands/apps_manifest.rb +51 -0
  29. data/bin/commands/auth_teams.rb +16 -0
  30. data/bin/commands/bots.rb +1 -0
  31. data/bin/commands/channels.rb +1 -155
  32. data/bin/commands/chat.rb +12 -7
  33. data/bin/commands/chat_scheduledMessages.rb +1 -0
  34. data/bin/commands/conversations.rb +71 -2
  35. data/bin/commands/dnd.rb +2 -0
  36. data/bin/commands/files.rb +6 -4
  37. data/bin/commands/files_remote.rb +2 -2
  38. data/bin/commands/groups.rb +1 -162
  39. data/bin/commands/im.rb +1 -63
  40. data/bin/commands/migration.rb +1 -0
  41. data/bin/commands/mpim.rb +1 -61
  42. data/bin/commands/oauth.rb +0 -13
  43. data/bin/commands/oauth_v2.rb +13 -1
  44. data/bin/commands/openid_connect.rb +27 -0
  45. data/bin/commands/pins.rb +2 -4
  46. data/bin/commands/reactions.rb +1 -0
  47. data/bin/commands/reminders.rb +6 -0
  48. data/bin/commands/rtm.rb +2 -2
  49. data/bin/commands/search.rb +4 -0
  50. data/bin/commands/stars.rb +7 -6
  51. data/bin/commands/team.rb +3 -0
  52. data/bin/commands/team_billing.rb +13 -0
  53. data/bin/commands/team_preferences.rb +13 -0
  54. data/bin/commands/tooling_tokens.rb +14 -0
  55. data/bin/commands/usergroups.rb +5 -0
  56. data/bin/commands/usergroups_users.rb +2 -0
  57. data/bin/commands/users.rb +4 -2
  58. data/bin/commands/users_profile.rb +5 -5
  59. data/bin/commands/views.rb +2 -2
  60. data/bin/commands/workflows.rb +38 -0
  61. data/bin/commands.rb +13 -9
  62. data/lib/slack/config.rb +1 -2
  63. data/lib/slack/events/request.rb +10 -4
  64. data/lib/slack/real_time/client.rb +6 -6
  65. data/lib/slack/real_time/concurrency/async.rb +6 -8
  66. data/lib/slack/real_time/concurrency.rb +0 -2
  67. data/lib/slack/real_time/config.rb +5 -14
  68. data/lib/slack/real_time/socket.rb +1 -2
  69. data/lib/slack/real_time/stores/base.rb +1 -6
  70. data/lib/slack/real_time/stores/starter.rb +6 -3
  71. data/lib/slack/real_time/stores/store.rb +5 -0
  72. data/lib/slack/version.rb +1 -1
  73. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  74. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
  75. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  76. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  77. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  78. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  79. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  80. data/lib/slack/web/api/endpoints/admin_conversations.rb +233 -3
  81. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  82. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
  83. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
  84. data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
  85. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  86. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  87. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  88. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  89. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  90. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  91. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  92. data/lib/slack/web/api/endpoints/admin_usergroups.rb +11 -11
  93. data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
  94. data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
  95. data/lib/slack/web/api/endpoints/api.rb +1 -3
  96. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  97. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  98. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  99. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  100. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  101. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  102. data/lib/slack/web/api/endpoints/bots.rb +3 -1
  103. data/lib/slack/web/api/endpoints/calls.rb +15 -15
  104. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  105. data/lib/slack/web/api/endpoints/channels.rb +0 -259
  106. data/lib/slack/web/api/endpoints/chat.rb +65 -55
  107. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +4 -2
  108. data/lib/slack/web/api/endpoints/conversations.rb +134 -24
  109. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  110. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  111. data/lib/slack/web/api/endpoints/files.rb +19 -15
  112. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  113. data/lib/slack/web/api/endpoints/files_remote.rb +22 -22
  114. data/lib/slack/web/api/endpoints/groups.rb +0 -269
  115. data/lib/slack/web/api/endpoints/im.rb +0 -107
  116. data/lib/slack/web/api/endpoints/migration.rb +4 -2
  117. data/lib/slack/web/api/endpoints/mpim.rb +0 -102
  118. data/lib/slack/web/api/endpoints/oauth.rb +5 -27
  119. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  120. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  121. data/lib/slack/web/api/endpoints/pins.rb +4 -9
  122. data/lib/slack/web/api/endpoints/reactions.rb +13 -11
  123. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  124. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  125. data/lib/slack/web/api/endpoints/search.rb +27 -13
  126. data/lib/slack/web/api/endpoints/stars.rb +11 -9
  127. data/lib/slack/web/api/endpoints/team.rb +11 -5
  128. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  129. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  130. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  131. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  132. data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
  133. data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
  134. data/lib/slack/web/api/endpoints/users.rb +20 -18
  135. data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
  136. data/lib/slack/web/api/endpoints/views.rb +13 -13
  137. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  138. data/lib/slack/web/api/endpoints.rb +26 -20
  139. data/lib/slack/web/api/errors/server_error.rb +37 -0
  140. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  141. data/lib/slack/web/api/errors.rb +394 -10
  142. data/lib/slack/web/api/mixins/conversations.id.rb +1 -3
  143. data/lib/slack/web/api/mixins/ids.id.rb +2 -2
  144. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  145. data/lib/slack/web/api/mixins.rb +0 -2
  146. data/lib/slack/web/api/patches/chat.1.patch +6 -8
  147. data/lib/slack/web/api/templates/endpoints.erb +1 -2
  148. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  149. data/lib/slack/web/config.rb +2 -0
  150. data/lib/slack/web/faraday/connection.rb +2 -2
  151. data/lib/slack/web/faraday/request.rb +2 -1
  152. data/lib/slack/web/faraday/response/raise_error.rb +12 -1
  153. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  154. data/lib/slack/web/pagination/cursor.rb +1 -5
  155. data/lib/slack-ruby-client.rb +2 -0
  156. data/lib/tasks/web.rake +11 -3
  157. data/slack-ruby-client.gemspec +2 -3
  158. data/spec/fixtures/slack/web/429_error.yml +50 -54
  159. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  160. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  161. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  162. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  163. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  164. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  165. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  166. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  167. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  168. data/spec/fixtures/slack/web/users_info.yml +153 -69
  169. data/spec/fixtures/slack/web/users_list.yml +102 -41
  170. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  171. data/spec/slack/events/request_spec.rb +13 -8
  172. data/spec/slack/real_time/client_spec.rb +35 -22
  173. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  174. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  175. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  176. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  177. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  178. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  179. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  180. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  181. data/spec/slack/slack_spec.rb +3 -1
  182. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  183. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
  184. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  185. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  186. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
  187. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
  188. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  189. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  190. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  191. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  192. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  193. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
  194. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  195. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
  196. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  197. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  198. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  199. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  200. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  201. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  202. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  203. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  204. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  205. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  206. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  207. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  208. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  209. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  210. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  211. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  212. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  213. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  214. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  215. data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
  216. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  217. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  218. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  219. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  220. data/spec/slack/web/api/error_spec.rb +5 -7
  221. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  222. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  223. data/spec/slack/web/api/mixins/conversations_spec.rb +11 -9
  224. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  225. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  226. data/spec/slack/web/client_spec.rb +112 -16
  227. data/spec/slack/web/faraday/request_spec.rb +80 -0
  228. data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
  229. data/spec/spec_helper.rb +1 -1
  230. data/spec/support/real_time/connected_client.rb +1 -7
  231. data/spec/support/vcr.rb +36 -1
  232. metadata +58 -155
  233. data/examples/hi_real_time/Gemfile +0 -6
  234. data/examples/hi_real_time/hi.gif +0 -0
  235. data/examples/hi_real_time/hi.rb +0 -41
  236. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  237. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  238. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  239. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  240. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  241. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  242. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  243. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  244. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  245. data/lib/slack/web/api/mixins/channels.id.rb +0 -27
  246. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  247. data/lib/slack/web/api/mixins/groups.id.rb +0 -27
  248. data/spec/fixtures/slack/web/503_error.yml +0 -14
  249. data/spec/fixtures/slack/web/channels_info.yml +0 -139
  250. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  251. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  252. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  253. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
  254. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  255. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  256. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
  257. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  258. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  259. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  260. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  261. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  262. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
  263. data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
  264. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -1,27 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Channels methods.'
4
+ desc "Get info on your team's Slack channels, create or archive channels, invite users, set the topic and purpose, and mark a channel as read."
5
5
  command 'channels' do |g|
6
- g.desc 'Archives a channel.'
7
- g.long_desc %( Archives a channel. )
8
- g.command 'archive' do |c|
9
- c.flag 'channel', desc: 'Channel to archive.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.channels_archive(options))
12
- end
13
- end
14
-
15
- g.desc 'Creates a channel.'
16
- g.long_desc %( Creates a channel. )
17
- g.command 'create' do |c|
18
- c.flag 'name', desc: 'Name of channel to create.'
19
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
20
- c.action do |_global_options, options, _args|
21
- puts JSON.dump($client.channels_create(options))
22
- end
23
- end
24
-
25
6
  g.desc 'Delete a channel (undocumented)'
26
7
  g.long_desc %( Delete a channel )
27
8
  g.command 'delete' do |c|
@@ -31,19 +12,6 @@ command 'channels' do |g|
31
12
  end
32
13
  end
33
14
 
34
- g.desc 'Fetches history of messages and events from a channel.'
35
- g.long_desc %( Fetches history of messages and events from a channel. )
36
- g.command 'history' do |c|
37
- c.flag 'channel', desc: 'Channel to fetch history for.'
38
- c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
39
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
40
- c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
41
- c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
42
- c.action do |_global_options, options, _args|
43
- puts JSON.dump($client.channels_history(options))
44
- end
45
- end
46
-
47
15
  g.desc 'This method returns the ID of a team channel.'
48
16
  g.long_desc %( This method returns the ID of a team channel. )
49
17
  g.command 'id' do |c|
@@ -52,126 +20,4 @@ command 'channels' do |g|
52
20
  puts JSON.dump($client.channels_id(options))
53
21
  end
54
22
  end
55
-
56
- g.desc 'Gets information about a channel.'
57
- g.long_desc %( Gets information about a channel. )
58
- g.command 'info' do |c|
59
- c.flag 'channel', desc: 'Channel to get info on.'
60
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.'
61
- c.action do |_global_options, options, _args|
62
- puts JSON.dump($client.channels_info(options))
63
- end
64
- end
65
-
66
- g.desc 'Invites a user to a channel.'
67
- g.long_desc %( Invites a user to a channel. )
68
- g.command 'invite' do |c|
69
- c.flag 'channel', desc: 'Channel to invite user to.'
70
- c.flag 'user', desc: 'User to invite to channel.'
71
- c.action do |_global_options, options, _args|
72
- puts JSON.dump($client.channels_invite(options))
73
- end
74
- end
75
-
76
- g.desc 'Joins a channel, creating it if needed.'
77
- g.long_desc %( Joins a channel, creating it if needed. )
78
- g.command 'join' do |c|
79
- c.flag 'name', desc: 'Name of channel to join.'
80
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
81
- c.action do |_global_options, options, _args|
82
- puts JSON.dump($client.channels_join(options))
83
- end
84
- end
85
-
86
- g.desc 'Removes a user from a channel.'
87
- g.long_desc %( Removes a user from a channel. )
88
- g.command 'kick' do |c|
89
- c.flag 'channel', desc: 'Channel to remove user from.'
90
- c.flag 'user', desc: 'User to remove from channel.'
91
- c.action do |_global_options, options, _args|
92
- puts JSON.dump($client.channels_kick(options))
93
- end
94
- end
95
-
96
- g.desc 'Leaves a channel.'
97
- g.long_desc %( Leaves a channel. )
98
- g.command 'leave' do |c|
99
- c.flag 'channel', desc: 'Channel to leave.'
100
- c.action do |_global_options, options, _args|
101
- puts JSON.dump($client.channels_leave(options))
102
- end
103
- end
104
-
105
- g.desc 'Lists all channels in a Slack team.'
106
- g.long_desc %( Lists all channels in a Slack team. )
107
- g.command 'list' do |c|
108
- c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
109
- c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
110
- c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
111
- c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached."
112
- c.action do |_global_options, options, _args|
113
- puts JSON.dump($client.channels_list(options))
114
- end
115
- end
116
-
117
- g.desc 'Sets the read cursor in a channel.'
118
- g.long_desc %( Sets the read cursor in a channel. )
119
- g.command 'mark' do |c|
120
- c.flag 'channel', desc: 'Channel to set reading cursor in.'
121
- c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
122
- c.action do |_global_options, options, _args|
123
- puts JSON.dump($client.channels_mark(options))
124
- end
125
- end
126
-
127
- g.desc 'Renames a channel.'
128
- g.long_desc %( Renames a channel. )
129
- g.command 'rename' do |c|
130
- c.flag 'channel', desc: 'Channel to rename.'
131
- c.flag 'name', desc: 'New name for channel.'
132
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
133
- c.action do |_global_options, options, _args|
134
- puts JSON.dump($client.channels_rename(options))
135
- end
136
- end
137
-
138
- g.desc 'Retrieve a thread of messages posted to a channel'
139
- g.long_desc %( Retrieve a thread of messages posted to a channel )
140
- g.command 'replies' do |c|
141
- c.flag 'channel', desc: 'Channel to fetch thread from.'
142
- c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
143
- c.action do |_global_options, options, _args|
144
- puts JSON.dump($client.channels_replies(options))
145
- end
146
- end
147
-
148
- g.desc 'Sets the purpose for a channel.'
149
- g.long_desc %( Sets the purpose for a channel. )
150
- g.command 'setPurpose' do |c|
151
- c.flag 'channel', desc: 'Channel to set the purpose of.'
152
- c.flag 'purpose', desc: 'The new purpose.'
153
- c.flag 'name_tagging', desc: 'if it is true, treat this like a message and not an unescaped thing.'
154
- c.action do |_global_options, options, _args|
155
- puts JSON.dump($client.channels_setPurpose(options))
156
- end
157
- end
158
-
159
- g.desc 'Sets the topic for a channel.'
160
- g.long_desc %( Sets the topic for a channel. )
161
- g.command 'setTopic' do |c|
162
- c.flag 'channel', desc: 'Channel to set the topic of.'
163
- c.flag 'topic', desc: 'The new topic.'
164
- c.action do |_global_options, options, _args|
165
- puts JSON.dump($client.channels_setTopic(options))
166
- end
167
- end
168
-
169
- g.desc 'Unarchives a channel.'
170
- g.long_desc %( Unarchives a channel. )
171
- g.command 'unarchive' do |c|
172
- c.flag 'channel', desc: 'Channel to unarchive.'
173
- c.action do |_global_options, options, _args|
174
- puts JSON.dump($client.channels_unarchive(options))
175
- end
176
- end
177
23
  end
data/bin/commands/chat.rb CHANGED
@@ -59,11 +59,11 @@ command 'chat' do |g|
59
59
  g.desc 'Sends an ephemeral message to a user in a channel.'
60
60
  g.long_desc %( Sends an ephemeral message to a user in a channel. )
61
61
  g.command 'postEphemeral' do |c|
62
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
63
62
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
64
63
  c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
65
64
  c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
66
65
  c.flag 'as_user', desc: 'Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
66
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
67
67
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
68
68
  c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
69
69
  c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
@@ -80,12 +80,12 @@ command 'chat' do |g|
80
80
  g.long_desc %( Sends a message to a channel. )
81
81
  g.command 'postMessage' do |c|
82
82
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
83
- c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
84
- c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.'
85
83
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
86
84
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
87
- c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.'
88
- c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.'
85
+ c.flag 'text', desc: 'The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.'
86
+ c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.'
87
+ c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
88
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
89
89
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
90
90
  c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
91
91
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
@@ -122,10 +122,13 @@ command 'chat' do |g|
122
122
  g.desc 'Provide custom unfurl behavior for user-posted URLs'
123
123
  g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
124
124
  g.command 'unfurl' do |c|
125
- c.flag 'channel', desc: 'Channel ID of the message.'
125
+ c.flag 'channel', desc: 'Channel ID of the message. Both channel and ts must be provided together, or unfurl_id and source must be provided together.'
126
126
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
127
127
  c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.'
128
- c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
128
+ c.flag 'source', desc: 'The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.'
129
+ c.flag 'unfurl_id', desc: 'The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.'
130
+ c.flag 'user_auth_blocks', desc: 'Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
131
+ c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.'
129
132
  c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
130
133
  c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
131
134
  c.action do |_global_options, options, _args|
@@ -141,8 +144,10 @@ command 'chat' do |g|
141
144
  c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
142
145
  c.flag 'attachments', desc: "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field."
143
146
  c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field."
147
+ c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.'
144
148
  c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.'
145
149
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.'
150
+ c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.'
146
151
  c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
147
152
  c.action do |_global_options, options, _args|
148
153
  puts JSON.dump($client.chat_update(options))
@@ -11,6 +11,7 @@ command 'chat_scheduledMessages' do |g|
11
11
  c.flag 'latest', desc: 'A UNIX timestamp of the latest value in the time range.'
12
12
  c.flag 'limit', desc: 'Maximum number of original entries to return.'
13
13
  c.flag 'oldest', desc: 'A UNIX timestamp of the oldest value in the time range.'
14
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
14
15
  c.action do |_global_options, options, _args|
15
16
  puts JSON.dump($client.chat_scheduledMessages_list(options))
16
17
  end
@@ -3,6 +3,30 @@
3
3
 
4
4
  desc 'Conversations methods.'
5
5
  command 'conversations' do |g|
6
+ g.desc 'Accepts an invitation to a Slack Connect channel.'
7
+ g.long_desc %( Accepts an invitation to a Slack Connect channel. )
8
+ g.command 'acceptSharedInvite' do |c|
9
+ c.flag 'channel_name', desc: 'Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.'
10
+ c.flag 'channel_id', desc: "ID of the channel that you'd like to accept. Must provide either invite_id or channel_id."
11
+ c.flag 'free_trial_accepted', desc: "Whether you'd like to use your workspace's free trial to begin using Slack Connect."
12
+ c.flag 'invite_id', desc: 'See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.'
13
+ c.flag 'is_private', desc: 'Whether the channel should be private.'
14
+ c.flag 'team_id', desc: 'The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump($client.conversations_acceptSharedInvite(options))
17
+ end
18
+ end
19
+
20
+ g.desc 'Approves an invitation to a Slack Connect channel'
21
+ g.long_desc %( Approves an invitation to a Slack Connect channel )
22
+ g.command 'approveSharedInvite' do |c|
23
+ c.flag 'invite_id', desc: 'ID of the shared channel invite to approve.'
24
+ c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are approving.'
25
+ c.action do |_global_options, options, _args|
26
+ puts JSON.dump($client.conversations_approveSharedInvite(options))
27
+ end
28
+ end
29
+
6
30
  g.desc 'Archives a conversation.'
7
31
  g.long_desc %( Archives a conversation. )
8
32
  g.command 'archive' do |c|
@@ -26,18 +50,29 @@ command 'conversations' do |g|
26
50
  g.command 'create' do |c|
27
51
  c.flag 'name', desc: 'Name of the public or private channel to create.'
28
52
  c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
53
+ c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
29
54
  c.action do |_global_options, options, _args|
30
55
  puts JSON.dump($client.conversations_create(options))
31
56
  end
32
57
  end
33
58
 
59
+ g.desc 'Declines a Slack Connect channel invite.'
60
+ g.long_desc %( Declines a Slack Connect channel invite. )
61
+ g.command 'declineSharedInvite' do |c|
62
+ c.flag 'invite_id', desc: 'ID of the Slack Connect invite to decline. Subscribe to the shared_channel_invite_accepted event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.'
63
+ c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are declining.'
64
+ c.action do |_global_options, options, _args|
65
+ puts JSON.dump($client.conversations_declineSharedInvite(options))
66
+ end
67
+ end
68
+
34
69
  g.desc "Fetches a conversation's history of messages and events."
35
70
  g.long_desc %( Fetches a conversation's history of messages and events. )
36
71
  g.command 'history' do |c|
37
72
  c.flag 'channel', desc: 'Conversation ID to fetch history for.'
38
73
  c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
39
74
  c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
40
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
75
+ c.flag 'latest', desc: 'End of time range of messages to include in results. Default is the current time.'
41
76
  c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached."
42
77
  c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
43
78
  c.action do |_global_options, options, _args|
@@ -66,6 +101,18 @@ command 'conversations' do |g|
66
101
  end
67
102
  end
68
103
 
104
+ g.desc 'Sends an invitation to a Slack Connect channel'
105
+ g.long_desc %( Sends an invitation to a Slack Connect channel )
106
+ g.command 'inviteShared' do |c|
107
+ c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
108
+ c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided.'
109
+ c.flag 'external_limited', desc: 'Optional boolean on whether invite is to a external limited member. Defaults to true.'
110
+ c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided.'
111
+ c.action do |_global_options, options, _args|
112
+ puts JSON.dump($client.conversations_inviteShared(options))
113
+ end
114
+ end
115
+
69
116
  g.desc 'Joins an existing conversation.'
70
117
  g.long_desc %( Joins an existing conversation. )
71
118
  g.command 'join' do |c|
@@ -100,12 +147,33 @@ command 'conversations' do |g|
100
147
  c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
101
148
  c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
102
149
  c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
150
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
103
151
  c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
104
152
  c.action do |_global_options, options, _args|
105
153
  puts JSON.dump($client.conversations_list(options))
106
154
  end
107
155
  end
108
156
 
157
+ g.desc 'Lists shared channel invites that have been generated or received but have not been approved by all parties'
158
+ g.long_desc %( Lists shared channel invites that have been generated or received but have not been approved by all parties )
159
+ g.command 'listConnectInvites' do |c|
160
+ c.flag 'cursor', desc: 'Set to next_cursor returned by previous call to list items in subsequent page.'
161
+ c.flag 'team_id', desc: 'Encoded team id for the workspace to retrieve invites for, required if org token is used.'
162
+ c.action do |_global_options, options, _args|
163
+ puts JSON.dump($client.conversations_listConnectInvites(options))
164
+ end
165
+ end
166
+
167
+ g.desc 'Sets the read cursor in a channel.'
168
+ g.long_desc %( Sets the read cursor in a channel. )
169
+ g.command 'mark' do |c|
170
+ c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
171
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
172
+ c.action do |_global_options, options, _args|
173
+ puts JSON.dump($client.conversations_mark(options))
174
+ end
175
+ end
176
+
109
177
  g.desc 'Retrieve members of a conversation.'
110
178
  g.long_desc %( Retrieve members of a conversation. )
111
179
  g.command 'members' do |c|
@@ -121,6 +189,7 @@ command 'conversations' do |g|
121
189
  g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
122
190
  g.command 'open' do |c|
123
191
  c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
192
+ c.flag 'prevent_creation', desc: 'Do not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.'
124
193
  c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
125
194
  c.flag 'users', desc: 'Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.'
126
195
  c.action do |_global_options, options, _args|
@@ -142,7 +211,7 @@ command 'conversations' do |g|
142
211
  g.long_desc %( Retrieve a thread of messages posted to a conversation )
143
212
  g.command 'replies' do |c|
144
213
  c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
145
- c.flag 'ts', desc: "Unique identifier of a thread's parent message."
214
+ c.flag 'ts', desc: "Unique identifier of either a thread's parent message or a message in the thread. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message."
146
215
  c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
147
216
  c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
148
217
  c.flag 'latest', desc: 'End of time range of messages to include in results.'
data/bin/commands/dnd.rb CHANGED
@@ -22,6 +22,7 @@ command 'dnd' do |g|
22
22
  g.desc "Retrieves a user's current Do Not Disturb status."
23
23
  g.long_desc %( Retrieves a user's current Do Not Disturb status. )
24
24
  g.command 'info' do |c|
25
+ c.flag 'team_id', desc: 'Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed.'
25
26
  c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
26
27
  c.action do |_global_options, options, _args|
27
28
  puts JSON.dump($client.dnd_info(options))
@@ -41,6 +42,7 @@ command 'dnd' do |g|
41
42
  g.long_desc %( Retrieves the Do Not Disturb status for up to 50 users on a team. )
42
43
  g.command 'teamInfo' do |c|
43
44
  c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
45
+ c.flag 'team_id', desc: 'Encoded team id where passed in users belong, required if org token is used.'
44
46
  c.action do |_global_options, options, _args|
45
47
  puts JSON.dump($client.dnd_teamInfo(options))
46
48
  end
@@ -23,8 +23,8 @@ command 'files' do |g|
23
23
  end
24
24
  end
25
25
 
26
- g.desc 'Gets information about a team file.'
27
- g.long_desc %( Gets information about a team file. )
26
+ g.desc 'Gets information about a file.'
27
+ g.long_desc %( Gets information about a file. )
28
28
  g.command 'info' do |c|
29
29
  c.flag 'file', desc: 'Specify a file by providing its ID.'
30
30
  c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection of comments. See pagination for more details."
@@ -34,11 +34,13 @@ command 'files' do |g|
34
34
  end
35
35
  end
36
36
 
37
- g.desc 'Lists & filters team files.'
38
- g.long_desc %( Lists & filters team files. )
37
+ g.desc 'List for a team, in a channel, or from a user with applied filters.'
38
+ g.long_desc %( List for a team, in a channel, or from a user with applied filters. )
39
39
  g.command 'list' do |c|
40
40
  c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
41
+ c.flag 'files', desc: '.'
41
42
  c.flag 'show_files_hidden_by_limit', desc: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.'
43
+ c.flag 'team_id', desc: 'encoded team id to list files in, required if org token is used.'
42
44
  c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
43
45
  c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
44
46
  c.flag 'types', desc: 'Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.'
@@ -54,8 +54,8 @@ command 'files_remote' do |g|
54
54
  g.long_desc %( Share a remote file into a channel. )
55
55
  g.command 'share' do |c|
56
56
  c.flag 'channels', desc: 'Comma-separated list of channel IDs where the file will be shared.'
57
- c.flag 'external_id', desc: 'Creator defined GUID for the file.'
58
- c.flag 'file', desc: 'Specify a file by providing its ID.'
57
+ c.flag 'external_id', desc: 'The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.'
58
+ c.flag 'file', desc: 'Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.'
59
59
  c.action do |_global_options, options, _args|
60
60
  puts JSON.dump($client.files_remote_share(options))
61
61
  end
@@ -1,49 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Groups methods.'
4
+ desc "Get info on your team's private channels."
5
5
  command 'groups' do |g|
6
- g.desc 'Archives a private channel.'
7
- g.long_desc %( Archives a private channel. )
8
- g.command 'archive' do |c|
9
- c.flag 'channel', desc: 'Private channel to archive.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.groups_archive(options))
12
- end
13
- end
14
-
15
- g.desc 'Creates a private channel.'
16
- g.long_desc %( Creates a private channel. )
17
- g.command 'create' do |c|
18
- c.flag 'name', desc: 'Name of private channel to create.'
19
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
20
- c.action do |_global_options, options, _args|
21
- puts JSON.dump($client.groups_create(options))
22
- end
23
- end
24
-
25
- g.desc 'Clones and archives a private channel.'
26
- g.long_desc %( Clones and archives a private channel. )
27
- g.command 'createChild' do |c|
28
- c.flag 'channel', desc: 'Private channel to clone and archive.'
29
- c.action do |_global_options, options, _args|
30
- puts JSON.dump($client.groups_createChild(options))
31
- end
32
- end
33
-
34
- g.desc 'Fetches history of messages and events from a private channel.'
35
- g.long_desc %( Fetches history of messages and events from a private channel. )
36
- g.command 'history' do |c|
37
- c.flag 'channel', desc: 'Private channel to fetch history for.'
38
- c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
39
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
40
- c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
41
- c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
42
- c.action do |_global_options, options, _args|
43
- puts JSON.dump($client.groups_history(options))
44
- end
45
- end
46
-
47
6
  g.desc 'This method returns the ID of a group.'
48
7
  g.long_desc %( This method returns the ID of a group. )
49
8
  g.command 'id' do |c|
@@ -52,124 +11,4 @@ command 'groups' do |g|
52
11
  puts JSON.dump($client.groups_id(options))
53
12
  end
54
13
  end
55
-
56
- g.desc 'Gets information about a private channel.'
57
- g.long_desc %( Gets information about a private channel. )
58
- g.command 'info' do |c|
59
- c.flag 'channel', desc: 'Private channel to get info on.'
60
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.'
61
- c.action do |_global_options, options, _args|
62
- puts JSON.dump($client.groups_info(options))
63
- end
64
- end
65
-
66
- g.desc 'Invites a user to a private channel.'
67
- g.long_desc %( Invites a user to a private channel. )
68
- g.command 'invite' do |c|
69
- c.flag 'channel', desc: 'Private channel to invite user to.'
70
- c.flag 'user', desc: 'User to invite.'
71
- c.action do |_global_options, options, _args|
72
- puts JSON.dump($client.groups_invite(options))
73
- end
74
- end
75
-
76
- g.desc 'Removes a user from a private channel.'
77
- g.long_desc %( Removes a user from a private channel. )
78
- g.command 'kick' do |c|
79
- c.flag 'channel', desc: 'Private channel to remove user from.'
80
- c.flag 'user', desc: 'User to remove from private channel.'
81
- c.action do |_global_options, options, _args|
82
- puts JSON.dump($client.groups_kick(options))
83
- end
84
- end
85
-
86
- g.desc 'Leaves a private channel.'
87
- g.long_desc %( Leaves a private channel. )
88
- g.command 'leave' do |c|
89
- c.flag 'channel', desc: 'Private channel to leave.'
90
- c.action do |_global_options, options, _args|
91
- puts JSON.dump($client.groups_leave(options))
92
- end
93
- end
94
-
95
- g.desc 'Lists private channels that the calling user has access to.'
96
- g.long_desc %( Lists private channels that the calling user has access to. )
97
- g.command 'list' do |c|
98
- c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
99
- c.flag 'exclude_archived', desc: "Don't return archived private channels."
100
- c.flag 'exclude_members', desc: 'Exclude the members from each group.'
101
- c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
102
- c.action do |_global_options, options, _args|
103
- puts JSON.dump($client.groups_list(options))
104
- end
105
- end
106
-
107
- g.desc 'Sets the read cursor in a private channel.'
108
- g.long_desc %( Sets the read cursor in a private channel. )
109
- g.command 'mark' do |c|
110
- c.flag 'channel', desc: 'Private channel to set reading cursor in.'
111
- c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
112
- c.action do |_global_options, options, _args|
113
- puts JSON.dump($client.groups_mark(options))
114
- end
115
- end
116
-
117
- g.desc 'Opens a private channel.'
118
- g.long_desc %( Opens a private channel. )
119
- g.command 'open' do |c|
120
- c.flag 'channel', desc: 'Private channel to open.'
121
- c.action do |_global_options, options, _args|
122
- puts JSON.dump($client.groups_open(options))
123
- end
124
- end
125
-
126
- g.desc 'Renames a private channel.'
127
- g.long_desc %( Renames a private channel. )
128
- g.command 'rename' do |c|
129
- c.flag 'channel', desc: 'Private channel to rename.'
130
- c.flag 'name', desc: 'New name for private channel.'
131
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
132
- c.action do |_global_options, options, _args|
133
- puts JSON.dump($client.groups_rename(options))
134
- end
135
- end
136
-
137
- g.desc 'Retrieve a thread of messages posted to a private channel'
138
- g.long_desc %( Retrieve a thread of messages posted to a private channel )
139
- g.command 'replies' do |c|
140
- c.flag 'channel', desc: 'Private channel to fetch thread from.'
141
- c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
142
- c.action do |_global_options, options, _args|
143
- puts JSON.dump($client.groups_replies(options))
144
- end
145
- end
146
-
147
- g.desc 'Sets the purpose for a private channel.'
148
- g.long_desc %( Sets the purpose for a private channel. )
149
- g.command 'setPurpose' do |c|
150
- c.flag 'channel', desc: 'Private channel to set the purpose of.'
151
- c.flag 'purpose', desc: 'The new purpose.'
152
- c.action do |_global_options, options, _args|
153
- puts JSON.dump($client.groups_setPurpose(options))
154
- end
155
- end
156
-
157
- g.desc 'Sets the topic for a private channel.'
158
- g.long_desc %( Sets the topic for a private channel. )
159
- g.command 'setTopic' do |c|
160
- c.flag 'channel', desc: 'Private channel to set the topic of.'
161
- c.flag 'topic', desc: 'The new topic.'
162
- c.action do |_global_options, options, _args|
163
- puts JSON.dump($client.groups_setTopic(options))
164
- end
165
- end
166
-
167
- g.desc 'Unarchives a private channel.'
168
- g.long_desc %( Unarchives a private channel. )
169
- g.command 'unarchive' do |c|
170
- c.flag 'channel', desc: 'Private channel to unarchive.'
171
- c.action do |_global_options, options, _args|
172
- puts JSON.dump($client.groups_unarchive(options))
173
- end
174
- end
175
14
  end