slack-ruby-client 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +2 -0
  3. data/.github/workflows/test.yml +6 -0
  4. data/.github/workflows/update_api.yml +76 -0
  5. data/.gitignore +1 -0
  6. data/.rubocop_todo.yml +17 -29
  7. data/CHANGELOG.md +23 -1
  8. data/CONTRIBUTING.md +35 -32
  9. data/Gemfile +2 -0
  10. data/README.md +123 -14
  11. data/bin/commands/admin_apps_activities.rb +32 -0
  12. data/bin/commands/admin_apps_approved.rb +1 -0
  13. data/bin/commands/admin_apps_config.rb +31 -0
  14. data/bin/commands/admin_apps_requests.rb +1 -0
  15. data/bin/commands/admin_apps_restricted.rb +1 -0
  16. data/bin/commands/admin_functions.rb +23 -0
  17. data/bin/commands/admin_functions_permissions.rb +31 -0
  18. data/bin/commands/admin_roles.rb +1 -1
  19. data/bin/commands/admin_teams.rb +1 -1
  20. data/bin/commands/admin_users.rb +2 -2
  21. data/bin/commands/admin_workflows.rb +38 -0
  22. data/bin/commands/admin_workflows_collaborators.rb +31 -0
  23. data/bin/commands/admin_workflows_permissions.rb +21 -0
  24. data/bin/commands/apps_activities.rb +32 -0
  25. data/bin/commands/apps_auth_external.rb +32 -0
  26. data/bin/commands/apps_datastore.rb +70 -0
  27. data/bin/commands/auth_teams.rb +2 -2
  28. data/bin/commands/calls.rb +1 -1
  29. data/bin/commands/chat.rb +6 -6
  30. data/bin/commands/chat_scheduledMessages.rb +2 -2
  31. data/bin/commands/conversations.rb +3 -3
  32. data/bin/commands/dnd.rb +1 -1
  33. data/bin/commands/functions_workflows_steps.rb +2 -1
  34. data/bin/commands/functions_workflows_steps_responses.rb +2 -1
  35. data/bin/commands/reminders.rb +1 -1
  36. data/bin/commands/stars.rb +4 -4
  37. data/bin/commands/team.rb +3 -1
  38. data/bin/commands/users.rb +1 -1
  39. data/lib/slack/messages/formatting.rb +44 -0
  40. data/lib/slack/real_time/client.rb +14 -2
  41. data/lib/slack/real_time/concurrency/async.rb +4 -0
  42. data/lib/slack/real_time/config.rb +3 -0
  43. data/lib/slack/real_time/socket.rb +4 -0
  44. data/lib/slack/real_time/stores/starter.rb +2 -2
  45. data/lib/slack/real_time/stores/store.rb +2 -2
  46. data/lib/slack/version.rb +1 -1
  47. data/lib/slack/web/api/endpoints/admin_apps_activities.rb +53 -0
  48. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -0
  49. data/lib/slack/web/api/endpoints/admin_apps_config.rb +40 -0
  50. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +2 -0
  51. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -0
  52. data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -0
  53. data/lib/slack/web/api/endpoints/admin_functions.rb +36 -0
  54. data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +41 -0
  55. data/lib/slack/web/api/endpoints/admin_roles.rb +1 -1
  56. data/lib/slack/web/api/endpoints/admin_teams.rb +1 -1
  57. data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
  58. data/lib/slack/web/api/endpoints/admin_workflows.rb +59 -0
  59. data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +42 -0
  60. data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +26 -0
  61. data/lib/slack/web/api/endpoints/apps_activities.rb +54 -0
  62. data/lib/slack/web/api/endpoints/apps_auth_external.rb +41 -0
  63. data/lib/slack/web/api/endpoints/apps_datastore.rb +110 -0
  64. data/lib/slack/web/api/endpoints/apps_manifest.rb +2 -0
  65. data/lib/slack/web/api/endpoints/auth_teams.rb +1 -1
  66. data/lib/slack/web/api/endpoints/calls.rb +1 -1
  67. data/lib/slack/web/api/endpoints/chat.rb +14 -45
  68. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -2
  69. data/lib/slack/web/api/endpoints/conversations.rb +3 -3
  70. data/lib/slack/web/api/endpoints/dialog.rb +1 -6
  71. data/lib/slack/web/api/endpoints/dnd.rb +1 -1
  72. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +3 -1
  73. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +3 -1
  74. data/lib/slack/web/api/endpoints/reminders.rb +1 -1
  75. data/lib/slack/web/api/endpoints/stars.rb +2 -2
  76. data/lib/slack/web/api/endpoints/team.rb +12 -2
  77. data/lib/slack/web/api/endpoints/users.rb +1 -1
  78. data/lib/slack/web/api/endpoints/users_profile.rb +1 -0
  79. data/lib/slack/web/api/endpoints/views.rb +7 -23
  80. data/lib/slack/web/api/endpoints/workflows.rb +2 -0
  81. data/lib/slack/web/api/endpoints.rb +20 -0
  82. data/lib/slack/web/api/errors.rb +66 -4
  83. data/lib/slack/web/api/options.rb +26 -0
  84. data/lib/slack/web/api/patches/chat.attachments-blocks.patch +7 -55
  85. data/lib/slack/web/api/templates/method.erb +12 -0
  86. data/lib/slack/web/api/templates/method_spec.erb +40 -4
  87. data/lib/slack/web/client.rb +1 -0
  88. data/lib/slack-ruby-client.rb +1 -0
  89. data/lib/tasks/web.rake +2 -4
  90. data/slack-ruby-client.gemspec +1 -0
  91. data/spec/slack/messages/formatting_spec.rb +60 -0
  92. data/spec/slack/real_time/client_spec.rb +25 -7
  93. data/spec/slack/real_time/concurrency/clients/async_spec.rb +16 -0
  94. data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +8 -0
  95. data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +18 -0
  96. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +6 -6
  97. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +14 -10
  98. data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +21 -0
  99. data/spec/slack/web/api/endpoints/admin_functions_spec.rb +13 -0
  100. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +6 -6
  101. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
  102. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  103. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +2 -2
  104. data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
  105. data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +24 -0
  106. data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +13 -0
  107. data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +13 -0
  108. data/spec/slack/web/api/endpoints/apps_activities_spec.rb +13 -0
  109. data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +13 -0
  110. data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +45 -0
  111. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +8 -0
  112. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  113. data/spec/slack/web/api/endpoints/auth_spec.rb +8 -0
  114. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +4 -4
  115. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  116. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  117. data/spec/slack/web/api/endpoints/chat_spec.rb +62 -0
  118. data/spec/slack/web/api/endpoints/conversations_spec.rb +8 -0
  119. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +3 -3
  120. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +1 -1
  121. data/spec/slack/web/api/endpoints/dialog_spec.rb +14 -0
  122. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  123. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  124. data/spec/slack/web/api/endpoints/files_spec.rb +2 -2
  125. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +2 -2
  126. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  127. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  128. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  129. data/spec/slack/web/api/endpoints/users_profile_spec.rb +6 -0
  130. data/spec/slack/web/api/endpoints/users_spec.rb +8 -0
  131. data/spec/slack/web/api/endpoints/views_spec.rb +65 -0
  132. data/spec/slack/web/api/endpoints/workflows_spec.rb +8 -0
  133. data/spec/slack/web/api/options_spec.rb +69 -0
  134. data/spec/spec_helper.rb +9 -0
  135. metadata +45 -5
  136. data/lib/slack/web/api/patches/dialog.encoded-json.patch +0 -17
  137. data/lib/slack/web/api/patches/views.view-json.patch +0 -55
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-17 00:00:00.000000000 Z
11
+ date: 2023-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -87,11 +87,13 @@ executables:
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".coveralls.yml"
90
91
  - ".github/FUNDING.yml"
91
92
  - ".github/workflows/integration_test.yml"
92
93
  - ".github/workflows/lint.yml"
93
94
  - ".github/workflows/pr_lint.yml"
94
95
  - ".github/workflows/test.yml"
96
+ - ".github/workflows/update_api.yml"
95
97
  - ".gitignore"
96
98
  - ".gitmodules"
97
99
  - ".rspec"
@@ -111,7 +113,9 @@ files:
111
113
  - UPGRADING.md
112
114
  - bin/commands/admin_analytics.rb
113
115
  - bin/commands/admin_apps.rb
116
+ - bin/commands/admin_apps_activities.rb
114
117
  - bin/commands/admin_apps_approved.rb
118
+ - bin/commands/admin_apps_config.rb
115
119
  - bin/commands/admin_apps_requests.rb
116
120
  - bin/commands/admin_apps_restricted.rb
117
121
  - bin/commands/admin_audit_anomaly_allow.rb
@@ -121,6 +125,8 @@ files:
121
125
  - bin/commands/admin_conversations_ekm.rb
122
126
  - bin/commands/admin_conversations_restrictAccess.rb
123
127
  - bin/commands/admin_emoji.rb
128
+ - bin/commands/admin_functions.rb
129
+ - bin/commands/admin_functions_permissions.rb
124
130
  - bin/commands/admin_inviteRequests.rb
125
131
  - bin/commands/admin_inviteRequests_approved.rb
126
132
  - bin/commands/admin_inviteRequests_denied.rb
@@ -133,9 +139,15 @@ files:
133
139
  - bin/commands/admin_users.rb
134
140
  - bin/commands/admin_users_session.rb
135
141
  - bin/commands/admin_users_unsupportedVersions.rb
142
+ - bin/commands/admin_workflows.rb
143
+ - bin/commands/admin_workflows_collaborators.rb
144
+ - bin/commands/admin_workflows_permissions.rb
136
145
  - bin/commands/api.rb
137
146
  - bin/commands/apps.rb
147
+ - bin/commands/apps_activities.rb
148
+ - bin/commands/apps_auth_external.rb
138
149
  - bin/commands/apps_connections.rb
150
+ - bin/commands/apps_datastore.rb
139
151
  - bin/commands/apps_event_authorizations.rb
140
152
  - bin/commands/apps_manifest.rb
141
153
  - bin/commands/auth.rb
@@ -225,7 +237,9 @@ files:
225
237
  - lib/slack/web/api/endpoints.rb
226
238
  - lib/slack/web/api/endpoints/admin_analytics.rb
227
239
  - lib/slack/web/api/endpoints/admin_apps.rb
240
+ - lib/slack/web/api/endpoints/admin_apps_activities.rb
228
241
  - lib/slack/web/api/endpoints/admin_apps_approved.rb
242
+ - lib/slack/web/api/endpoints/admin_apps_config.rb
229
243
  - lib/slack/web/api/endpoints/admin_apps_requests.rb
230
244
  - lib/slack/web/api/endpoints/admin_apps_restricted.rb
231
245
  - lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb
@@ -235,6 +249,8 @@ files:
235
249
  - lib/slack/web/api/endpoints/admin_conversations_ekm.rb
236
250
  - lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb
237
251
  - lib/slack/web/api/endpoints/admin_emoji.rb
252
+ - lib/slack/web/api/endpoints/admin_functions.rb
253
+ - lib/slack/web/api/endpoints/admin_functions_permissions.rb
238
254
  - lib/slack/web/api/endpoints/admin_inviteRequests.rb
239
255
  - lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb
240
256
  - lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb
@@ -247,9 +263,15 @@ files:
247
263
  - lib/slack/web/api/endpoints/admin_users.rb
248
264
  - lib/slack/web/api/endpoints/admin_users_session.rb
249
265
  - lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb
266
+ - lib/slack/web/api/endpoints/admin_workflows.rb
267
+ - lib/slack/web/api/endpoints/admin_workflows_collaborators.rb
268
+ - lib/slack/web/api/endpoints/admin_workflows_permissions.rb
250
269
  - lib/slack/web/api/endpoints/api.rb
251
270
  - lib/slack/web/api/endpoints/apps.rb
271
+ - lib/slack/web/api/endpoints/apps_activities.rb
272
+ - lib/slack/web/api/endpoints/apps_auth_external.rb
252
273
  - lib/slack/web/api/endpoints/apps_connections.rb
274
+ - lib/slack/web/api/endpoints/apps_datastore.rb
253
275
  - lib/slack/web/api/endpoints/apps_event_authorizations.rb
254
276
  - lib/slack/web/api/endpoints/apps_manifest.rb
255
277
  - lib/slack/web/api/endpoints/auth.rb
@@ -304,9 +326,8 @@ files:
304
326
  - lib/slack/web/api/mixins/users.id.rb
305
327
  - lib/slack/web/api/mixins/users.search.json
306
328
  - lib/slack/web/api/mixins/users.search.rb
329
+ - lib/slack/web/api/options.rb
307
330
  - lib/slack/web/api/patches/chat.attachments-blocks.patch
308
- - lib/slack/web/api/patches/dialog.encoded-json.patch
309
- - lib/slack/web/api/patches/views.view-json.patch
310
331
  - lib/slack/web/api/schema/group.json
311
332
  - lib/slack/web/api/schema/method.json
312
333
  - lib/slack/web/api/templates/command.erb
@@ -350,6 +371,7 @@ files:
350
371
  - spec/slack/real_time/api/ping_spec.rb
351
372
  - spec/slack/real_time/api/typing_spec.rb
352
373
  - spec/slack/real_time/client_spec.rb
374
+ - spec/slack/real_time/concurrency/clients/async_spec.rb
353
375
  - spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb
354
376
  - spec/slack/real_time/concurrency/with_concurrency_spec.rb
355
377
  - spec/slack/real_time/concurrency/without_concurrency_spec.rb
@@ -365,7 +387,9 @@ files:
365
387
  - spec/slack/slack_spec.rb
366
388
  - spec/slack/version_spec.rb
367
389
  - spec/slack/web/api/endpoints/admin_analytics_spec.rb
390
+ - spec/slack/web/api/endpoints/admin_apps_activities_spec.rb
368
391
  - spec/slack/web/api/endpoints/admin_apps_approved_spec.rb
392
+ - spec/slack/web/api/endpoints/admin_apps_config_spec.rb
369
393
  - spec/slack/web/api/endpoints/admin_apps_requests_spec.rb
370
394
  - spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb
371
395
  - spec/slack/web/api/endpoints/admin_apps_spec.rb
@@ -376,6 +400,8 @@ files:
376
400
  - spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb
377
401
  - spec/slack/web/api/endpoints/admin_conversations_spec.rb
378
402
  - spec/slack/web/api/endpoints/admin_emoji_spec.rb
403
+ - spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb
404
+ - spec/slack/web/api/endpoints/admin_functions_spec.rb
379
405
  - spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb
380
406
  - spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb
381
407
  - spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb
@@ -388,23 +414,33 @@ files:
388
414
  - spec/slack/web/api/endpoints/admin_users_session_spec.rb
389
415
  - spec/slack/web/api/endpoints/admin_users_spec.rb
390
416
  - spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb
417
+ - spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb
418
+ - spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb
419
+ - spec/slack/web/api/endpoints/admin_workflows_spec.rb
391
420
  - spec/slack/web/api/endpoints/api_spec.rb
421
+ - spec/slack/web/api/endpoints/apps_activities_spec.rb
422
+ - spec/slack/web/api/endpoints/apps_auth_external_spec.rb
392
423
  - spec/slack/web/api/endpoints/apps_connections_spec.rb
424
+ - spec/slack/web/api/endpoints/apps_datastore_spec.rb
393
425
  - spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb
394
426
  - spec/slack/web/api/endpoints/apps_manifest_spec.rb
395
427
  - spec/slack/web/api/endpoints/apps_spec.rb
428
+ - spec/slack/web/api/endpoints/auth_spec.rb
396
429
  - spec/slack/web/api/endpoints/auth_teams_spec.rb
397
430
  - spec/slack/web/api/endpoints/bookmarks_spec.rb
398
431
  - spec/slack/web/api/endpoints/bots_spec.rb
399
432
  - spec/slack/web/api/endpoints/calls_participants_spec.rb
400
433
  - spec/slack/web/api/endpoints/calls_spec.rb
401
434
  - spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb
435
+ - spec/slack/web/api/endpoints/chat_spec.rb
436
+ - spec/slack/web/api/endpoints/conversations_spec.rb
402
437
  - spec/slack/web/api/endpoints/custom_specs/auth_spec.rb
403
438
  - spec/slack/web/api/endpoints/custom_specs/chat_spec.rb
404
439
  - spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb
405
440
  - spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb
406
441
  - spec/slack/web/api/endpoints/custom_specs/users_spec.rb
407
442
  - spec/slack/web/api/endpoints/custom_specs/views_spec.rb
443
+ - spec/slack/web/api/endpoints/dialog_spec.rb
408
444
  - spec/slack/web/api/endpoints/dnd_spec.rb
409
445
  - spec/slack/web/api/endpoints/emoji_spec.rb
410
446
  - spec/slack/web/api/endpoints/files_comments_spec.rb
@@ -432,12 +468,15 @@ files:
432
468
  - spec/slack/web/api/endpoints/users_admin_spec.rb
433
469
  - spec/slack/web/api/endpoints/users_prefs_spec.rb
434
470
  - spec/slack/web/api/endpoints/users_profile_spec.rb
471
+ - spec/slack/web/api/endpoints/users_spec.rb
472
+ - spec/slack/web/api/endpoints/views_spec.rb
435
473
  - spec/slack/web/api/endpoints/workflows_spec.rb
436
474
  - spec/slack/web/api/error_spec.rb
437
475
  - spec/slack/web/api/errors/slack_error_spec.rb
438
476
  - spec/slack/web/api/mixins/conversations_list_spec.rb
439
477
  - spec/slack/web/api/mixins/conversations_spec.rb
440
478
  - spec/slack/web/api/mixins/users_spec.rb
479
+ - spec/slack/web/api/options_spec.rb
441
480
  - spec/slack/web/api/pagination/cursor_spec.rb
442
481
  - spec/slack/web/client_spec.rb
443
482
  - spec/slack/web/faraday/request_spec.rb
@@ -455,6 +494,7 @@ licenses:
455
494
  - MIT
456
495
  metadata:
457
496
  rubygems_mfa_required: 'true'
497
+ changelog_uri: https://github.com/slack-ruby/slack-ruby-client/blob/master/CHANGELOG.md
458
498
  post_install_message:
459
499
  rdoc_options: []
460
500
  require_paths:
@@ -470,7 +510,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
470
510
  - !ruby/object:Gem::Version
471
511
  version: 1.3.6
472
512
  requirements: []
473
- rubygems_version: 3.1.6
513
+ rubygems_version: 3.3.7
474
514
  signing_key:
475
515
  specification_version: 4
476
516
  summary: Slack Web and RealTime API client.
@@ -1,17 +0,0 @@
1
- diff --git a/lib/slack/web/api/endpoints/dialog.rb b/lib/slack/web/api/endpoints/dialog.rb
2
- index 05475c8..a4ff4ff 100644
3
- --- a/lib/slack/web/api/endpoints/dialog.rb
4
- +++ b/lib/slack/web/api/endpoints/dialog.rb
5
- @@ -18,6 +18,12 @@ module Slack
6
- def dialog_open(options = {})
7
- raise ArgumentError, 'Required arguments :dialog missing' if options[:dialog].nil?
8
- raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
9
- + # dialog must be passed as an encoded JSON string
10
- + if options.key?(:dialog)
11
- + dialog = options[:dialog]
12
- + dialog = JSON.dump(dialog) unless dialog.is_a?(String)
13
- + options = options.merge(dialog: dialog)
14
- + end
15
- post('dialog.open', options)
16
- end
17
- end
@@ -1,55 +0,0 @@
1
- diff --git a/lib/slack/web/api/endpoints/views.rb b/lib/slack/web/api/endpoints/views.rb
2
- index cfa83a5..038c5f0 100644
3
- --- a/lib/slack/web/api/endpoints/views.rb
4
- +++ b/lib/slack/web/api/endpoints/views.rb
5
- @@ -19,6 +19,12 @@ module Slack
6
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.open.json
7
- def views_open(options = {})
8
- raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
9
- + raise ArgumentError, 'One of :trigger_id, :interactivity_pointer is required' unless options[:trigger_id].nil? ^ options[:interactivity_pointer].nil?
10
- + if options.key?(:view)
11
- + view = options[:view]
12
- + view = JSON.dump(view) unless view.is_a?(String)
13
- + options = options.merge(view: view)
14
- + end
15
- post('views.open', options)
16
- end
17
-
18
- @@ -36,6 +42,11 @@ module Slack
19
- def views_publish(options = {})
20
- raise ArgumentError, 'Required arguments :user_id missing' if options[:user_id].nil?
21
- raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
22
- + if options.key?(:view)
23
- + view = options[:view]
24
- + view = JSON.dump(view) unless view.is_a?(String)
25
- + options = options.merge(view: view)
26
- + end
27
- post('views.publish', options)
28
- end
29
-
30
- @@ -52,6 +63,12 @@ module Slack
31
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.push.json
32
- def views_push(options = {})
33
- raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
34
- + raise ArgumentError, 'One of :trigger_id, :interactivity_pointer is required' unless options[:trigger_id].nil? ^ options[:interactivity_pointer].nil?
35
- + if options.key?(:view)
36
- + view = options[:view]
37
- + view = JSON.dump(view) unless view.is_a?(String)
38
- + options = options.merge(view: view)
39
- + end
40
- post('views.push', options)
41
- end
42
-
43
- @@ -70,6 +87,12 @@ module Slack
44
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.update.json
45
- def views_update(options = {})
46
- raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
47
- + raise ArgumentError, 'One of :external_id, :view_id is required' unless options[:external_id].nil? ^ options[:view_id].nil?
48
- + if options.key?(:view)
49
- + view = options[:view]
50
- + view = JSON.dump(view) unless view.is_a?(String)
51
- + options = options.merge(view: view)
52
- + end
53
- post('views.update', options)
54
- end
55
- end