slack-ruby-client 0.11.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. checksums.yaml +5 -5
  2. data/.coveralls.yml +2 -0
  3. data/.github/FUNDING.yml +2 -0
  4. data/.github/dependabot.yml +6 -0
  5. data/.github/workflows/integration_test.yml +45 -0
  6. data/.github/workflows/lint.yml +14 -0
  7. data/.github/workflows/pr_lint.yml +21 -0
  8. data/.github/workflows/test.yml +56 -0
  9. data/.github/workflows/update_api.yml +81 -0
  10. data/.gitignore +7 -3
  11. data/.rubocop.yml +40 -2
  12. data/.rubocop_todo.yml +209 -55
  13. data/.ruby-version +1 -0
  14. data/CHANGELOG.md +257 -30
  15. data/CONTRIBUTING.md +44 -29
  16. data/Dangerfile +2 -0
  17. data/Gemfile +28 -6
  18. data/Gemfile.danger +6 -0
  19. data/LICENSE.md +1 -1
  20. data/README.md +473 -134
  21. data/RELEASING.md +2 -2
  22. data/Rakefile +2 -1
  23. data/SECURITY.md +9 -0
  24. data/UPGRADING.md +117 -3
  25. data/bin/commands/admin_analytics.rb +22 -0
  26. data/bin/commands/admin_apps.rb +57 -0
  27. data/bin/commands/admin_apps_activities.rb +32 -0
  28. data/bin/commands/admin_apps_approved.rb +24 -0
  29. data/bin/commands/admin_apps_config.rb +31 -0
  30. data/bin/commands/admin_apps_requests.rb +35 -0
  31. data/bin/commands/admin_apps_restricted.rb +24 -0
  32. data/bin/commands/admin_audit_anomaly_allow.rb +29 -0
  33. data/bin/commands/admin_auth_policy.rb +45 -0
  34. data/bin/commands/admin_barriers.rb +53 -0
  35. data/bin/commands/admin_conversations.rb +260 -0
  36. data/bin/commands/admin_conversations_ekm.rb +23 -0
  37. data/bin/commands/admin_conversations_restrictAccess.rb +43 -0
  38. data/bin/commands/admin_emoji.rb +60 -0
  39. data/bin/commands/admin_functions.rb +23 -0
  40. data/bin/commands/admin_functions_permissions.rb +31 -0
  41. data/bin/commands/admin_inviteRequests.rb +42 -0
  42. data/bin/commands/admin_inviteRequests_approved.rb +22 -0
  43. data/bin/commands/admin_inviteRequests_denied.rb +22 -0
  44. data/bin/commands/admin_roles.rb +46 -0
  45. data/bin/commands/admin_teams.rb +33 -0
  46. data/bin/commands/admin_teams_admins.rb +22 -0
  47. data/bin/commands/admin_teams_owners.rb +22 -0
  48. data/bin/commands/admin_teams_settings.rb +70 -0
  49. data/bin/commands/admin_usergroups.rb +54 -0
  50. data/bin/commands/admin_users.rb +106 -0
  51. data/bin/commands/admin_users_session.rb +84 -0
  52. data/bin/commands/admin_users_unsupportedVersions.rb +21 -0
  53. data/bin/commands/admin_workflows.rb +42 -0
  54. data/bin/commands/admin_workflows_collaborators.rb +31 -0
  55. data/bin/commands/admin_workflows_permissions.rb +21 -0
  56. data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
  57. data/bin/commands/api.rb +15 -9
  58. data/bin/commands/apps.rb +21 -0
  59. data/bin/commands/apps_activities.rb +32 -0
  60. data/bin/commands/apps_auth_external.rb +32 -0
  61. data/bin/commands/apps_connections.rb +19 -0
  62. data/bin/commands/apps_datastore.rb +116 -0
  63. data/bin/commands/apps_event_authorizations.rb +22 -0
  64. data/bin/commands/apps_manifest.rb +58 -0
  65. data/bin/commands/assistant_search.rb +27 -0
  66. data/bin/commands/assistant_threads.rb +45 -0
  67. data/bin/commands/auth.rb +22 -15
  68. data/bin/commands/auth_teams.rb +22 -0
  69. data/bin/commands/bookmarks.rb +60 -0
  70. data/bin/commands/bots.rb +16 -8
  71. data/bin/commands/calls.rb +58 -0
  72. data/bin/commands/calls_participants.rb +31 -0
  73. data/bin/commands/canvases.rb +41 -0
  74. data/bin/commands/canvases_access.rb +34 -0
  75. data/bin/commands/canvases_sections.rb +21 -0
  76. data/bin/commands/chat.rb +158 -99
  77. data/bin/commands/chat_scheduledMessages.rb +25 -0
  78. data/bin/commands/conversations.rb +241 -157
  79. data/bin/commands/conversations_canvases.rb +22 -0
  80. data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
  81. data/bin/commands/conversations_requestSharedInvite.rb +48 -0
  82. data/bin/commands/dialog.rb +16 -9
  83. data/bin/commands/dnd.rb +47 -38
  84. data/bin/commands/emoji.rb +15 -7
  85. data/bin/commands/files.rb +113 -87
  86. data/bin/commands/files_comments.rb +16 -30
  87. data/bin/commands/files_remote.rb +84 -0
  88. data/bin/commands/functions.rb +31 -0
  89. data/bin/commands/functions_distributions_permissions.rb +61 -0
  90. data/bin/commands/functions_workflows_steps.rb +23 -0
  91. data/bin/commands/functions_workflows_steps_responses.rb +23 -0
  92. data/bin/commands/migration.rb +17 -9
  93. data/bin/commands/oauth.rb +19 -24
  94. data/bin/commands/oauth_v2.rb +35 -0
  95. data/bin/commands/openid_connect.rb +33 -0
  96. data/bin/commands/pins.rb +33 -30
  97. data/bin/commands/reactions.rb +53 -45
  98. data/bin/commands/reminders.rb +54 -41
  99. data/bin/commands/rtm.rb +16 -22
  100. data/bin/commands/search.rb +44 -33
  101. data/bin/commands/stars.rb +39 -29
  102. data/bin/commands/team.rb +50 -34
  103. data/bin/commands/team_billing.rb +19 -0
  104. data/bin/commands/team_externalTeams.rb +35 -0
  105. data/bin/commands/team_preferences.rb +19 -0
  106. data/bin/commands/team_profile.rb +15 -8
  107. data/bin/commands/tooling_tokens.rb +20 -0
  108. data/bin/commands/usergroups.rb +69 -53
  109. data/bin/commands/usergroups_users.rb +30 -19
  110. data/bin/commands/users.rb +114 -84
  111. data/bin/commands/users_admin.rb +29 -22
  112. data/bin/commands/users_discoverableContacts.rb +20 -0
  113. data/bin/commands/users_prefs.rb +14 -7
  114. data/bin/commands/users_profile.rb +27 -20
  115. data/bin/commands/views.rb +56 -0
  116. data/bin/commands/workflows.rb +44 -0
  117. data/bin/commands/workflows_triggers_permissions.rb +60 -0
  118. data/bin/slack +50 -46
  119. data/examples/files_upload_v2/.env.example +1 -0
  120. data/examples/{hi_real_time → files_upload_v2}/Gemfile +2 -2
  121. data/examples/files_upload_v2/README.md +13 -0
  122. data/examples/files_upload_v2/files_upload_v2.rb +45 -0
  123. data/examples/hi_real_time_and_web/Gemfile +1 -0
  124. data/examples/hi_real_time_and_web/hi.rb +7 -3
  125. data/examples/{hi_real_time_async_eventmachine → hi_real_time_async_async}/Gemfile +2 -1
  126. data/examples/{hi_real_time_async_eventmachine → hi_real_time_async_async}/hi.rb +12 -7
  127. data/examples/hi_web/Gemfile +1 -0
  128. data/examples/hi_web/hi.rb +1 -0
  129. data/examples/new_ticket/Gemfile +1 -0
  130. data/examples/new_ticket/new_ticket.rb +1 -0
  131. data/examples/oauth_v2/.env.example +4 -0
  132. data/examples/oauth_v2/Gemfile +7 -0
  133. data/examples/oauth_v2/README.md +33 -0
  134. data/examples/oauth_v2/oauth_v2.rb +60 -0
  135. data/lib/slack/config.rb +2 -2
  136. data/lib/slack/events/config.rb +32 -0
  137. data/lib/slack/events/request.rb +76 -0
  138. data/lib/slack/logger.rb +6 -5
  139. data/lib/slack/messages/formatting.rb +66 -1
  140. data/lib/slack/messages/message.rb +1 -4
  141. data/lib/slack/real_time/api/message.rb +6 -3
  142. data/lib/slack/real_time/api/message_id.rb +1 -0
  143. data/lib/slack/real_time/api/ping.rb +5 -2
  144. data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
  145. data/lib/slack/real_time/api/typing.rb +5 -2
  146. data/lib/slack/real_time/client.rb +117 -54
  147. data/lib/slack/real_time/concurrency/async.rb +142 -0
  148. data/lib/slack/real_time/concurrency.rb +2 -2
  149. data/lib/slack/real_time/config.rb +12 -13
  150. data/lib/slack/real_time/models/base.rb +1 -4
  151. data/lib/slack/real_time/models/bot.rb +1 -0
  152. data/lib/slack/real_time/models/channel.rb +5 -0
  153. data/lib/slack/real_time/models/im.rb +1 -0
  154. data/lib/slack/real_time/models/{group.rb → mpim.rb} +2 -1
  155. data/lib/slack/real_time/models/team.rb +1 -0
  156. data/lib/slack/real_time/models/user.rb +1 -0
  157. data/lib/slack/real_time/models.rb +3 -1
  158. data/lib/slack/real_time/socket.rb +49 -17
  159. data/lib/slack/real_time/stores/base.rb +28 -14
  160. data/lib/slack/real_time/stores/starter.rb +325 -287
  161. data/lib/slack/real_time/stores/store.rb +271 -186
  162. data/lib/slack/real_time/stores.rb +2 -7
  163. data/lib/slack/utils/security.rb +44 -0
  164. data/lib/slack/version.rb +2 -1
  165. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  166. data/lib/slack/web/api/endpoints/admin_apps.rb +78 -0
  167. data/lib/slack/web/api/endpoints/admin_apps_activities.rb +53 -0
  168. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +37 -0
  169. data/lib/slack/web/api/endpoints/admin_apps_config.rb +40 -0
  170. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +53 -0
  171. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +37 -0
  172. data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
  173. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  174. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  175. data/lib/slack/web/api/endpoints/admin_conversations.rb +397 -0
  176. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  177. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  178. data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
  179. data/lib/slack/web/api/endpoints/admin_functions.rb +36 -0
  180. data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +41 -0
  181. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
  182. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
  183. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
  184. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  185. data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
  186. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
  187. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
  188. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
  189. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  190. data/lib/slack/web/api/endpoints/admin_users.rb +167 -0
  191. data/lib/slack/web/api/endpoints/admin_users_session.rb +121 -0
  192. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
  193. data/lib/slack/web/api/endpoints/admin_workflows.rb +67 -0
  194. data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +42 -0
  195. data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +26 -0
  196. data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
  197. data/lib/slack/web/api/endpoints/api.rb +2 -3
  198. data/lib/slack/web/api/endpoints/apps.rb +27 -0
  199. data/lib/slack/web/api/endpoints/apps_activities.rb +54 -0
  200. data/lib/slack/web/api/endpoints/apps_auth_external.rb +41 -0
  201. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  202. data/lib/slack/web/api/endpoints/apps_datastore.rb +181 -0
  203. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  204. data/lib/slack/web/api/endpoints/apps_manifest.rb +79 -0
  205. data/lib/slack/web/api/endpoints/assistant_search.rb +44 -0
  206. data/lib/slack/web/api/endpoints/assistant_threads.rb +68 -0
  207. data/lib/slack/web/api/endpoints/auth.rb +2 -1
  208. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  209. data/lib/slack/web/api/endpoints/bookmarks.rb +90 -0
  210. data/lib/slack/web/api/endpoints/bots.rb +4 -1
  211. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  212. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  213. data/lib/slack/web/api/endpoints/canvases.rb +54 -0
  214. data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
  215. data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
  216. data/lib/slack/web/api/endpoints/chat.rb +172 -87
  217. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +40 -0
  218. data/lib/slack/web/api/endpoints/conversations.rb +190 -64
  219. data/lib/slack/web/api/endpoints/conversations_canvases.rb +28 -0
  220. data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
  221. data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +73 -0
  222. data/lib/slack/web/api/endpoints/dialog.rb +6 -10
  223. data/lib/slack/web/api/endpoints/dnd.rb +11 -5
  224. data/lib/slack/web/api/endpoints/emoji.rb +3 -0
  225. data/lib/slack/web/api/endpoints/files.rb +85 -36
  226. data/lib/slack/web/api/endpoints/files_comments.rb +4 -36
  227. data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
  228. data/lib/slack/web/api/endpoints/functions.rb +43 -0
  229. data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +84 -0
  230. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +30 -0
  231. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +30 -0
  232. data/lib/slack/web/api/endpoints/migration.rb +6 -3
  233. data/lib/slack/web/api/endpoints/oauth.rb +10 -32
  234. data/lib/slack/web/api/endpoints/oauth_v2.rb +48 -0
  235. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  236. data/lib/slack/web/api/endpoints/pins.rb +11 -18
  237. data/lib/slack/web/api/endpoints/reactions.rb +31 -20
  238. data/lib/slack/web/api/endpoints/reminders.rb +25 -12
  239. data/lib/slack/web/api/endpoints/rtm.rb +4 -22
  240. data/lib/slack/web/api/endpoints/search.rb +33 -18
  241. data/lib/slack/web/api/endpoints/stars.rb +23 -10
  242. data/lib/slack/web/api/endpoints/team.rb +38 -7
  243. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  244. data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
  245. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  246. data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
  247. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  248. data/lib/slack/web/api/endpoints/usergroups.rb +44 -25
  249. data/lib/slack/web/api/endpoints/usergroups_users.rb +23 -14
  250. data/lib/slack/web/api/endpoints/users.rb +57 -18
  251. data/lib/slack/web/api/endpoints/users_admin.rb +5 -2
  252. data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +24 -0
  253. data/lib/slack/web/api/endpoints/users_prefs.rb +2 -0
  254. data/lib/slack/web/api/endpoints/users_profile.rb +11 -9
  255. data/lib/slack/web/api/endpoints/views.rb +86 -0
  256. data/lib/slack/web/api/endpoints/workflows.rb +63 -0
  257. data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
  258. data/lib/slack/web/api/endpoints.rb +136 -12
  259. data/lib/slack/web/api/error.rb +1 -0
  260. data/lib/slack/web/api/errors/server_error.rb +37 -0
  261. data/lib/slack/web/api/errors/slack_error.rb +14 -1
  262. data/lib/slack/web/api/errors/too_many_requests_error.rb +2 -4
  263. data/lib/slack/web/api/errors.rb +1396 -0
  264. data/lib/slack/web/api/helpers/files.rb +97 -0
  265. data/lib/slack/web/api/helpers.rb +13 -0
  266. data/lib/slack/web/api/mixins/conversations.id.rb +47 -0
  267. data/lib/slack/web/api/mixins/ids.id.rb +4 -3
  268. data/lib/slack/web/api/mixins/users.id.rb +18 -4
  269. data/lib/slack/web/api/mixins/users.search.rb +3 -1
  270. data/lib/slack/web/api/mixins.rb +2 -2
  271. data/lib/slack/web/api/options.rb +26 -0
  272. data/lib/slack/web/api/patches/.gitkeep +0 -0
  273. data/lib/slack/web/api/templates/command.erb +19 -12
  274. data/lib/slack/web/api/templates/endpoints.erb +2 -2
  275. data/lib/slack/web/api/templates/errors.erb +20 -0
  276. data/lib/slack/web/api/templates/method.erb +23 -3
  277. data/lib/slack/web/api/templates/method_spec.erb +40 -3
  278. data/lib/slack/web/client.rb +4 -1
  279. data/lib/slack/web/config.rb +9 -2
  280. data/lib/slack/web/faraday/connection.rb +11 -20
  281. data/lib/slack/web/faraday/options.rb +24 -0
  282. data/lib/slack/web/faraday/request.rb +6 -1
  283. data/lib/slack/web/faraday/response/raise_error.rb +14 -8
  284. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  285. data/lib/slack/web/pagination/cursor.rb +7 -7
  286. data/lib/slack-ruby-client.rb +18 -6
  287. data/lib/slack.rb +1 -0
  288. data/lib/slack_ruby_client.rb +1 -0
  289. data/lib/tasks/git.rake +1 -0
  290. data/lib/tasks/real_time.rake +51 -21
  291. data/lib/tasks/update.rake +1 -0
  292. data/lib/tasks/web.rake +43 -17
  293. data/slack-ruby-client.gemspec +10 -14
  294. metadata +191 -307
  295. data/.travis.yml +0 -30
  296. data/bin/commands/apps_permissions.rb +0 -22
  297. data/bin/commands/channels.rb +0 -175
  298. data/bin/commands/groups.rb +0 -172
  299. data/bin/commands/im.rb +0 -67
  300. data/bin/commands/mpim.rb +0 -63
  301. data/bin/commands.rb +0 -33
  302. data/examples/hi_real_time/hi.gif +0 -0
  303. data/examples/hi_real_time/hi.rb +0 -37
  304. data/examples/hi_real_time_async_celluloid/Gemfile +0 -6
  305. data/examples/hi_real_time_async_celluloid/hi.rb +0 -36
  306. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  307. data/lib/slack/real_time/concurrency/celluloid.rb +0 -117
  308. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -60
  309. data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -35
  310. data/lib/slack/web/api/endpoints/channels.rb +0 -265
  311. data/lib/slack/web/api/endpoints/groups.rb +0 -255
  312. data/lib/slack/web/api/endpoints/im.rb +0 -113
  313. data/lib/slack/web/api/endpoints/mpim.rb +0 -98
  314. data/lib/slack/web/api/endpoints/presence.rb +0 -23
  315. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  316. data/lib/slack/web/api/mixins/channels.id.rb +0 -26
  317. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  318. data/lib/slack/web/api/mixins/groups.id.rb +0 -26
  319. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  320. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  321. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  322. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  323. data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +0 -17
  324. data/lib/slack/web/api/templates/commands.erb +0 -5
  325. data/screenshots/register-bot.png +0 -0
  326. data/spec/fixtures/slack/web/429_error.yml +0 -85
  327. data/spec/fixtures/slack/web/auth_test_error.yml +0 -48
  328. data/spec/fixtures/slack/web/auth_test_success.yml +0 -57
  329. data/spec/fixtures/slack/web/channels_info.yml +0 -46
  330. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  331. data/spec/fixtures/slack/web/paginated_users_list.yml +0 -181
  332. data/spec/fixtures/slack/web/rtm_connect.yml +0 -70
  333. data/spec/fixtures/slack/web/rtm_start.yml +0 -104
  334. data/spec/fixtures/slack/web/users_info.yml +0 -130
  335. data/spec/fixtures/slack/web/users_list.yml +0 -72
  336. data/spec/integration/integration_spec.rb +0 -139
  337. data/spec/slack/config_spec.rb +0 -14
  338. data/spec/slack/messages/formatting_spec.rb +0 -43
  339. data/spec/slack/real_time/api/message_spec.rb +0 -15
  340. data/spec/slack/real_time/api/ping_spec.rb +0 -15
  341. data/spec/slack/real_time/api/typing_spec.rb +0 -15
  342. data/spec/slack/real_time/client_spec.rb +0 -425
  343. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -62
  344. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -47
  345. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +0 -19
  346. data/spec/slack/real_time/event_handlers/bot_spec.rb +0 -44
  347. data/spec/slack/real_time/event_handlers/channel_spec.rb +0 -116
  348. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +0 -15
  349. data/spec/slack/real_time/event_handlers/group_spec.rb +0 -90
  350. data/spec/slack/real_time/event_handlers/im_spec.rb +0 -47
  351. data/spec/slack/real_time/event_handlers/team_spec.rb +0 -62
  352. data/spec/slack/real_time/event_handlers/user_spec.rb +0 -63
  353. data/spec/slack/real_time/rtm_connect_spec.rb +0 -13
  354. data/spec/slack/real_time/rtm_start_spec.rb +0 -13
  355. data/spec/slack/real_time/store_spec.rb +0 -11
  356. data/spec/slack/slack_spec.rb +0 -58
  357. data/spec/slack/version_spec.rb +0 -7
  358. data/spec/slack/web/api/endpoints/api_spec.rb +0 -7
  359. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -15
  360. data/spec/slack/web/api/endpoints/bots_spec.rb +0 -7
  361. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -100
  362. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +0 -25
  363. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -11
  364. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +0 -105
  365. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +0 -28
  366. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -11
  367. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +0 -33
  368. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -12
  369. data/spec/slack/web/api/endpoints/emoji_spec.rb +0 -7
  370. data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -34
  371. data/spec/slack/web/api/endpoints/files_spec.rb +0 -43
  372. data/spec/slack/web/api/endpoints/im_spec.rb +0 -38
  373. data/spec/slack/web/api/endpoints/migration_spec.rb +0 -12
  374. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -38
  375. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -29
  376. data/spec/slack/web/api/endpoints/pins_spec.rb +0 -22
  377. data/spec/slack/web/api/endpoints/reactions_spec.rb +0 -17
  378. data/spec/slack/web/api/endpoints/reminders_spec.rb +0 -30
  379. data/spec/slack/web/api/endpoints/rtm_spec.rb +0 -7
  380. data/spec/slack/web/api/endpoints/search_spec.rb +0 -22
  381. data/spec/slack/web/api/endpoints/stars_spec.rb +0 -7
  382. data/spec/slack/web/api/endpoints/team_profile_spec.rb +0 -7
  383. data/spec/slack/web/api/endpoints/team_spec.rb +0 -7
  384. data/spec/slack/web/api/endpoints/usergroups_spec.rb +0 -27
  385. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +0 -20
  386. data/spec/slack/web/api/endpoints/users_admin_spec.rb +0 -17
  387. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +0 -7
  388. data/spec/slack/web/api/endpoints/users_profile_spec.rb +0 -7
  389. data/spec/slack/web/api/error_spec.rb +0 -14
  390. data/spec/slack/web/api/errors/slack_error_spec.rb +0 -14
  391. data/spec/slack/web/api/mixins/channels_spec.rb +0 -31
  392. data/spec/slack/web/api/mixins/groups_spec.rb +0 -31
  393. data/spec/slack/web/api/mixins/users_spec.rb +0 -39
  394. data/spec/slack/web/api/pagination/cursor_spec.rb +0 -70
  395. data/spec/slack/web/client_spec.rb +0 -174
  396. data/spec/spec_helper.rb +0 -14
  397. data/spec/support/queue_with_timeout.rb +0 -34
  398. data/spec/support/real_time/concurrency/mock.rb +0 -30
  399. data/spec/support/real_time/connected_client.rb +0 -21
  400. data/spec/support/real_time/event.rb +0 -11
  401. data/spec/support/token.rb +0 -10
  402. data/spec/support/vcr.rb +0 -9
  403. /data/examples/{hi_real_time_async_celluloid → hi_real_time_async_async}/Procfile +0 -0
@@ -1,178 +1,262 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
- desc "Interface with all kinds of conversations the same way, whether they're public or private channels, direct messages, or otherwise."
4
- command 'conversations' do |g|
5
- g.desc 'Archives a conversation.'
6
- g.long_desc %( Archives a conversation. )
7
- g.command 'archive' do |c|
8
- c.flag 'channel', desc: 'ID of conversation to archive.'
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.conversations_archive(options))
11
- end
12
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Conversations methods.'
8
+ command 'conversations' do |g|
9
+ g.desc 'Accepts an invitation to a Slack Connect channel.'
10
+ g.long_desc %( Accepts an invitation to a Slack Connect channel. )
11
+ g.command 'acceptSharedInvite' do |c|
12
+ 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.'
13
+ c.flag 'channel_id', desc: "ID of the channel that you'd like to accept. Must provide either invite_id or channel_id."
14
+ c.flag 'free_trial_accepted', desc: "Whether you'd like to use your workspace's free trial to begin using Slack Connect."
15
+ c.flag 'invite_id', desc: "ID of the invite that you'd like to accept. Must provide either invite_id or channel_id. See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation."
16
+ c.flag 'is_private', desc: 'Whether the channel should be private.'
17
+ 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.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump(@client.conversations_acceptSharedInvite(options))
20
+ end
21
+ end
13
22
 
14
- g.desc 'Closes a direct message or multi-person direct message.'
15
- g.long_desc %( Closes a direct message or multi-person direct message. )
16
- g.command 'close' do |c|
17
- c.flag 'channel', desc: 'Conversation to close.'
18
- c.action do |_global_options, options, _args|
19
- puts JSON.dump($client.conversations_close(options))
20
- end
21
- end
23
+ g.desc 'Approves an invitation to a Slack Connect channel'
24
+ g.long_desc %( Approves an invitation to a Slack Connect channel )
25
+ g.command 'approveSharedInvite' do |c|
26
+ c.flag 'invite_id', desc: 'ID of the shared channel invite to approve.'
27
+ c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are approving.'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump(@client.conversations_approveSharedInvite(options))
30
+ end
31
+ end
22
32
 
23
- g.desc 'Initiates a public or private channel-based conversation'
24
- g.long_desc %( Initiates a public or private channel-based conversation )
25
- g.command 'create' do |c|
26
- c.flag 'name', desc: 'Name of the public or private channel to create.'
27
- c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
28
- c.action do |_global_options, options, _args|
29
- puts JSON.dump($client.conversations_create(options))
30
- end
31
- end
33
+ g.desc 'Archives a conversation.'
34
+ g.long_desc %( Archives a conversation. )
35
+ g.command 'archive' do |c|
36
+ c.flag 'channel', desc: 'ID of conversation to archive.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.conversations_archive(options))
39
+ end
40
+ end
32
41
 
33
- g.desc "Fetches a conversation's history of messages and events."
34
- g.long_desc %( Fetches a conversation's history of messages and events. )
35
- g.command 'history' do |c|
36
- c.flag 'channel', desc: 'Conversation ID to fetch history for.'
37
- 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."
38
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
39
- 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."
40
- c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
41
- c.action do |_global_options, options, _args|
42
- puts JSON.dump($client.conversations_history(options))
43
- end
44
- end
42
+ g.desc 'Closes a direct message or multi-person direct message.'
43
+ g.long_desc %( Closes a direct message or multi-person direct message. )
44
+ g.command 'close' do |c|
45
+ c.flag 'channel', desc: 'Conversation to close.'
46
+ c.action do |_global_options, options, _args|
47
+ puts JSON.dump(@client.conversations_close(options))
48
+ end
49
+ end
45
50
 
46
- g.desc 'Retrieve information about a conversation.'
47
- g.long_desc %( Retrieve information about a conversation. )
48
- g.command 'info' do |c|
49
- c.flag 'channel', desc: 'Conversation ID to learn more about.'
50
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this conversation. Defaults to false.'
51
- c.action do |_global_options, options, _args|
52
- puts JSON.dump($client.conversations_info(options))
53
- end
54
- end
51
+ g.desc 'Initiates a public or private channel-based conversation'
52
+ g.long_desc %( Initiates a public or private channel-based conversation )
53
+ g.command 'create' do |c|
54
+ c.flag 'name', desc: 'Name of the public or private channel to create.'
55
+ c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
56
+ c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
57
+ c.action do |_global_options, options, _args|
58
+ puts JSON.dump(@client.conversations_create(options))
59
+ end
60
+ end
55
61
 
56
- g.desc 'Invites users to a channel.'
57
- g.long_desc %( Invites users to a channel. )
58
- g.command 'invite' do |c|
59
- c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
60
- c.flag 'users', desc: 'A comma separated list of user IDs. Up to 30 users may be listed.'
61
- c.action do |_global_options, options, _args|
62
- puts JSON.dump($client.conversations_invite(options))
63
- end
64
- end
62
+ g.desc 'Declines a Slack Connect channel invite.'
63
+ g.long_desc %( Declines a Slack Connect channel invite. )
64
+ g.command 'declineSharedInvite' do |c|
65
+ 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.'
66
+ c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are declining.'
67
+ c.action do |_global_options, options, _args|
68
+ puts JSON.dump(@client.conversations_declineSharedInvite(options))
69
+ end
70
+ end
65
71
 
66
- g.desc 'Joins an existing conversation.'
67
- g.long_desc %( Joins an existing conversation. )
68
- g.command 'join' do |c|
69
- c.flag 'channel', desc: 'ID of conversation to join.'
70
- c.action do |_global_options, options, _args|
71
- puts JSON.dump($client.conversations_join(options))
72
- end
73
- end
72
+ g.desc "Fetches a conversation's history of messages and events."
73
+ g.long_desc %( Fetches a conversation's history of messages and events. )
74
+ g.command 'history' do |c|
75
+ c.flag 'channel', desc: 'Conversation ID to fetch history for.'
76
+ 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."
77
+ c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
78
+ c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
79
+ c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results. Default is the current time.'
80
+ 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 conversation history hasn't been reached. Maximum of 999."
81
+ c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
82
+ c.action do |_global_options, options, _args|
83
+ puts JSON.dump(@client.conversations_history(options))
84
+ end
85
+ end
74
86
 
75
- g.desc 'Removes a user from a conversation.'
76
- g.long_desc %( Removes a user from a conversation. )
77
- g.command 'kick' do |c|
78
- c.flag 'channel', desc: 'ID of conversation to remove user from.'
79
- c.flag 'user', desc: 'User ID to be removed.'
80
- c.action do |_global_options, options, _args|
81
- puts JSON.dump($client.conversations_kick(options))
82
- end
83
- end
87
+ g.desc 'Retrieve information about a conversation.'
88
+ g.long_desc %( Retrieve information about a conversation. )
89
+ g.command 'info' do |c|
90
+ c.flag 'channel', desc: 'Conversation ID to learn more about.'
91
+ c.flag 'include_locale', desc: 'Set this to true to receive the locale for this conversation. Defaults to false.'
92
+ c.flag 'include_num_members', desc: 'Set to true to include the member count for the specified conversation. Defaults to false.'
93
+ c.action do |_global_options, options, _args|
94
+ puts JSON.dump(@client.conversations_info(options))
95
+ end
96
+ end
84
97
 
85
- g.desc 'Leaves a conversation.'
86
- g.long_desc %( Leaves a conversation. )
87
- g.command 'leave' do |c|
88
- c.flag 'channel', desc: 'Conversation to leave.'
89
- c.action do |_global_options, options, _args|
90
- puts JSON.dump($client.conversations_leave(options))
91
- end
92
- end
98
+ g.desc 'Invites users to a channel.'
99
+ g.long_desc %( Invites users to a channel. )
100
+ g.command 'invite' do |c|
101
+ c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
102
+ c.flag 'users', desc: 'A comma separated list of user IDs. Up to 1000 users may be listed.'
103
+ c.flag 'force', desc: 'When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false.'
104
+ c.action do |_global_options, options, _args|
105
+ puts JSON.dump(@client.conversations_invite(options))
106
+ end
107
+ end
93
108
 
94
- g.desc 'Lists all channels in a Slack team.'
95
- g.long_desc %( Lists all channels in a Slack team. )
96
- g.command 'list' do |c|
97
- 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."
98
- c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
99
- 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."
100
- 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.'
101
- c.action do |_global_options, options, _args|
102
- puts JSON.dump($client.conversations_list(options))
103
- end
104
- end
109
+ g.desc 'Sends an invitation to a Slack Connect channel'
110
+ g.long_desc %( Sends an invitation to a Slack Connect channel )
111
+ g.command 'inviteShared' do |c|
112
+ c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
113
+ c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.'
114
+ c.flag 'external_limited', desc: 'Optional boolean on whether invite is to an external limited member. Defaults to true.'
115
+ c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.'
116
+ c.action do |_global_options, options, _args|
117
+ puts JSON.dump(@client.conversations_inviteShared(options))
118
+ end
119
+ end
105
120
 
106
- g.desc 'Retrieve members of a conversation.'
107
- g.long_desc %( Retrieve members of a conversation. )
108
- g.command 'members' do |c|
109
- c.flag 'channel', desc: 'ID of the conversation to retrieve members for.'
110
- 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."
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.conversations_members(options))
114
- end
115
- end
121
+ g.desc 'Joins an existing conversation.'
122
+ g.long_desc %( Joins an existing conversation. )
123
+ g.command 'join' do |c|
124
+ c.flag 'channel', desc: 'ID of conversation to join.'
125
+ c.action do |_global_options, options, _args|
126
+ puts JSON.dump(@client.conversations_join(options))
127
+ end
128
+ end
116
129
 
117
- g.desc 'Opens or resumes a direct message or multi-person direct message.'
118
- g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
119
- g.command 'open' do |c|
120
- c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
121
- c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
122
- 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.'
123
- c.action do |_global_options, options, _args|
124
- puts JSON.dump($client.conversations_open(options))
125
- end
126
- end
130
+ g.desc 'Removes a user from a conversation.'
131
+ g.long_desc %( Removes a user from a conversation. )
132
+ g.command 'kick' do |c|
133
+ c.flag 'channel', desc: 'ID of conversation to remove user from.'
134
+ c.flag 'user', desc: 'User ID to be removed.'
135
+ c.action do |_global_options, options, _args|
136
+ puts JSON.dump(@client.conversations_kick(options))
137
+ end
138
+ end
127
139
 
128
- g.desc 'Renames a conversation.'
129
- g.long_desc %( Renames a conversation. )
130
- g.command 'rename' do |c|
131
- c.flag 'channel', desc: 'ID of conversation to rename.'
132
- c.flag 'name', desc: 'New name for conversation.'
133
- c.action do |_global_options, options, _args|
134
- puts JSON.dump($client.conversations_rename(options))
135
- end
136
- end
140
+ g.desc 'Leaves a conversation.'
141
+ g.long_desc %( Leaves a conversation. )
142
+ g.command 'leave' do |c|
143
+ c.flag 'channel', desc: 'Conversation to leave.'
144
+ c.action do |_global_options, options, _args|
145
+ puts JSON.dump(@client.conversations_leave(options))
146
+ end
147
+ end
137
148
 
138
- g.desc 'Retrieve a thread of messages posted to a conversation'
139
- g.long_desc %( Retrieve a thread of messages posted to a conversation )
140
- g.command 'replies' do |c|
141
- c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
142
- c.flag 'ts', desc: "Unique identifier of a thread's parent message."
143
- 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."
144
- 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."
145
- c.action do |_global_options, options, _args|
146
- puts JSON.dump($client.conversations_replies(options))
147
- end
148
- end
149
+ g.desc 'Lists all channels in a Slack team.'
150
+ g.long_desc %( Lists all channels in a Slack team. )
151
+ g.command 'list' do |c|
152
+ 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."
153
+ c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
154
+ 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 under 1000."
155
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
156
+ 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.'
157
+ c.action do |_global_options, options, _args|
158
+ puts JSON.dump(@client.conversations_list(options))
159
+ end
160
+ end
149
161
 
150
- g.desc 'Sets the purpose for a conversation.'
151
- g.long_desc %( Sets the purpose for a conversation. )
152
- g.command 'setPurpose' do |c|
153
- c.flag 'channel', desc: 'Conversation to set the purpose of.'
154
- c.flag 'purpose', desc: 'A new, specialer purpose.'
155
- c.action do |_global_options, options, _args|
156
- puts JSON.dump($client.conversations_setPurpose(options))
157
- end
158
- end
162
+ g.desc 'Lists shared channel invites that have been generated or received but have not been approved by all parties'
163
+ g.long_desc %( Lists shared channel invites that have been generated or received but have not been approved by all parties )
164
+ g.command 'listConnectInvites' do |c|
165
+ c.flag 'cursor', desc: 'Set to next_cursor returned by previous call to list items in subsequent page.'
166
+ c.flag 'team_id', desc: 'Encoded team id for the workspace to retrieve invites for, required if org token is used.'
167
+ c.action do |_global_options, options, _args|
168
+ puts JSON.dump(@client.conversations_listConnectInvites(options))
169
+ end
170
+ end
159
171
 
160
- g.desc 'Sets the topic for a conversation.'
161
- g.long_desc %( Sets the topic for a conversation. )
162
- g.command 'setTopic' do |c|
163
- c.flag 'channel', desc: 'Conversation to set the topic of.'
164
- c.flag 'topic', desc: 'The new topic string. Does not support formatting or linkification.'
165
- c.action do |_global_options, options, _args|
166
- puts JSON.dump($client.conversations_setTopic(options))
167
- end
168
- end
172
+ g.desc 'Sets the read cursor in a channel.'
173
+ g.long_desc %( Sets the read cursor in a channel. )
174
+ g.command 'mark' do |c|
175
+ c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
176
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
177
+ c.action do |_global_options, options, _args|
178
+ puts JSON.dump(@client.conversations_mark(options))
179
+ end
180
+ end
181
+
182
+ g.desc 'Retrieve members of a conversation.'
183
+ g.long_desc %( Retrieve members of a conversation. )
184
+ g.command 'members' do |c|
185
+ c.flag 'channel', desc: 'ID of the conversation to retrieve members for.'
186
+ 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."
187
+ 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."
188
+ c.action do |_global_options, options, _args|
189
+ puts JSON.dump(@client.conversations_members(options))
190
+ end
191
+ end
192
+
193
+ g.desc 'Opens or resumes a direct message or multi-person direct message.'
194
+ g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
195
+ g.command 'open' do |c|
196
+ c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
197
+ 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.'
198
+ c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
199
+ 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.'
200
+ c.action do |_global_options, options, _args|
201
+ puts JSON.dump(@client.conversations_open(options))
202
+ end
203
+ end
204
+
205
+ g.desc 'Renames a conversation.'
206
+ g.long_desc %( Renames a conversation. )
207
+ g.command 'rename' do |c|
208
+ c.flag 'channel', desc: 'ID of conversation to rename.'
209
+ c.flag 'name', desc: 'New name for conversation.'
210
+ c.action do |_global_options, options, _args|
211
+ puts JSON.dump(@client.conversations_rename(options))
212
+ end
213
+ end
214
+
215
+ g.desc 'Retrieve a thread of messages posted to a conversation'
216
+ g.long_desc %( Retrieve a thread of messages posted to a conversation )
217
+ g.command 'replies' do |c|
218
+ c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
219
+ 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."
220
+ 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."
221
+ c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
222
+ c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
223
+ c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results.'
224
+ 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."
225
+ c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
226
+ c.action do |_global_options, options, _args|
227
+ puts JSON.dump(@client.conversations_replies(options))
228
+ end
229
+ end
230
+
231
+ g.desc 'Sets the channel description.'
232
+ g.long_desc %( Sets the channel description. )
233
+ g.command 'setPurpose' do |c|
234
+ c.flag 'channel', desc: 'Channel to set the description of.'
235
+ c.flag 'purpose', desc: 'The description.'
236
+ c.action do |_global_options, options, _args|
237
+ puts JSON.dump(@client.conversations_setPurpose(options))
238
+ end
239
+ end
240
+
241
+ g.desc 'Sets the topic for a conversation.'
242
+ g.long_desc %( Sets the topic for a conversation. )
243
+ g.command 'setTopic' do |c|
244
+ c.flag 'channel', desc: 'Conversation to set the topic of.'
245
+ c.flag 'topic', desc: 'The new topic string. Does not support formatting or linkification.'
246
+ c.action do |_global_options, options, _args|
247
+ puts JSON.dump(@client.conversations_setTopic(options))
248
+ end
249
+ end
169
250
 
170
- g.desc 'Reverses conversation archival.'
171
- g.long_desc %( Reverses conversation archival. )
172
- g.command 'unarchive' do |c|
173
- c.flag 'channel', desc: 'ID of conversation to unarchive.'
174
- c.action do |_global_options, options, _args|
175
- puts JSON.dump($client.conversations_unarchive(options))
251
+ g.desc 'Reverses conversation archival.'
252
+ g.long_desc %( Reverses conversation archival. )
253
+ g.command 'unarchive' do |c|
254
+ c.flag 'channel', desc: 'ID of conversation to unarchive.'
255
+ c.action do |_global_options, options, _args|
256
+ puts JSON.dump(@client.conversations_unarchive(options))
257
+ end
258
+ end
259
+ end
176
260
  end
177
261
  end
178
262
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'ConversationsCanvases methods.'
8
+ command 'conversations_canvases' do |g|
9
+ g.desc 'Create a channel canvas for a channel'
10
+ g.long_desc %( Create a channel canvas for a channel )
11
+ g.command 'create' do |c|
12
+ c.flag 'channel_id', desc: 'Channel ID of the channel we create the channel canvas for.'
13
+ c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
14
+ c.flag 'title', desc: 'Title of the newly created canvas.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.conversations_canvases_create(options))
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'ConversationsExternalinvitepermissions methods.'
8
+ command 'conversations_externalInvitePermissions' do |g|
9
+ g.desc "Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'."
10
+ g.long_desc %( Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'. )
11
+ g.command 'set' do |c|
12
+ c.flag 'action', desc: 'Type of action to be taken: upgrade or downgrade.'
13
+ c.flag 'channel', desc: 'The channel ID to change external invite permissions for.'
14
+ c.flag 'target_team', desc: 'The encoded team ID of the target team. Must be in the specified channel.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.conversations_externalInvitePermissions_set(options))
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'ConversationsRequestsharedinvite methods.'
8
+ command 'conversations_requestSharedInvite' do |g|
9
+ g.desc 'Approves a request to add an external user to a channel and sends them a Slack Connect invite'
10
+ g.long_desc %( Approves a request to add an external user to a channel and sends them a Slack Connect invite )
11
+ g.command 'approve' do |c|
12
+ c.flag 'invite_id', desc: 'ID of the requested shared channel invite to approve.'
13
+ c.flag 'channel_id', desc: 'Optional channel_id to which external user will be invited to. Will override the value on the requested invite.'
14
+ c.flag 'is_external_limited', desc: 'Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite.'
15
+ c.flag 'message', desc: 'Object describing the text to send along with the invite. If this object is specified, both text and is_override are required properties. If is_override is set to true, text will override the original invitation message. Otherwise, text will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If is_override is set to false, the length of text and the user specified message on the invite request in total must be less than 560 characters.'
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump(@client.conversations_requestSharedInvite_approve(options))
18
+ end
19
+ end
20
+
21
+ g.desc 'Denies a request to invite an external user to a channel'
22
+ g.long_desc %( Denies a request to invite an external user to a channel )
23
+ g.command 'deny' do |c|
24
+ c.flag 'invite_id', desc: 'ID of the requested shared channel invite to deny.'
25
+ c.flag 'message', desc: 'Optional message explaining why the request to invite was denied.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.conversations_requestSharedInvite_deny(options))
28
+ end
29
+ end
30
+
31
+ g.desc 'Lists requests to add external users to channels with ability to filter.'
32
+ g.long_desc %( Lists requests to add external users to channels with ability to filter. )
33
+ g.command 'list' do |c|
34
+ 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. See pagination for more detail."
35
+ c.flag 'include_approved', desc: 'When true approved invitation requests will be returned, otherwise they will be excluded.'
36
+ c.flag 'include_denied', desc: 'When true denied invitation requests will be returned, otherwise they will be excluded.'
37
+ c.flag 'include_expired', desc: 'When true expired invitation requests will be returned, otherwise they will be excluded.'
38
+ c.flag 'invite_ids', desc: 'An optional list of invitation ids to look up.'
39
+ c.flag 'limit', desc: 'The number of items to return. Must be between 1 - 1000 (inclusive).'
40
+ c.flag 'user_id', desc: 'Optional filter to return invitation requests for the inviting user.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.conversations_requestSharedInvite_list(options))
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,14 +1,21 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
- desc 'Dialog methods.'
4
- command 'dialog' do |g|
5
- g.desc 'Open a dialog with a user'
6
- g.long_desc %( Open a dialog with a user )
7
- g.command 'open' do |c|
8
- c.flag 'dialog', desc: 'The dialog definition. This must be a JSON-encoded string.'
9
- c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.dialog_open(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Dialog methods.'
8
+ command 'dialog' do |g|
9
+ g.desc 'Open a dialog with a user'
10
+ g.long_desc %( Open a dialog with a user )
11
+ g.command 'open' do |c|
12
+ c.flag 'dialog', desc: 'The dialog definition. This must be a JSON-encoded string.'
13
+ c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.dialog_open(options))
16
+ end
17
+ end
18
+ end
12
19
  end
13
20
  end
14
21
  end