slack-ruby-client 2.0.0 → 2.1.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 (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +19 -0
  4. data/.github/workflows/pr_lint.yml +1 -1
  5. data/.github/workflows/test.yml +1 -0
  6. data/CHANGELOG.md +9 -0
  7. data/README.md +18 -14
  8. data/SECURITY.md +9 -0
  9. data/bin/commands/admin_analytics.rb +16 -10
  10. data/bin/commands/admin_apps.rb +48 -42
  11. data/bin/commands/admin_apps_approved.rb +17 -11
  12. data/bin/commands/admin_apps_requests.rb +27 -21
  13. data/bin/commands/admin_apps_restricted.rb +17 -11
  14. data/bin/commands/admin_audit_anomaly_allow.rb +22 -16
  15. data/bin/commands/admin_auth_policy.rb +37 -31
  16. data/bin/commands/admin_barriers.rb +44 -38
  17. data/bin/commands/admin_conversations.rb +221 -165
  18. data/bin/commands/admin_conversations_ekm.rb +17 -11
  19. data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
  20. data/bin/commands/admin_emoji.rb +50 -44
  21. data/bin/commands/admin_inviteRequests.rb +34 -28
  22. data/bin/commands/admin_inviteRequests_approved.rb +16 -10
  23. data/bin/commands/admin_inviteRequests_denied.rb +16 -10
  24. data/bin/commands/admin_roles.rb +46 -0
  25. data/bin/commands/admin_teams.rb +26 -20
  26. data/bin/commands/admin_teams_admins.rb +16 -10
  27. data/bin/commands/admin_teams_owners.rb +16 -10
  28. data/bin/commands/admin_teams_settings.rb +59 -53
  29. data/bin/commands/admin_usergroups.rb +45 -39
  30. data/bin/commands/admin_users.rb +91 -85
  31. data/bin/commands/admin_users_session.rb +72 -66
  32. data/bin/commands/admin_users_unsupportedVersions.rb +15 -9
  33. data/bin/commands/api.rb +14 -8
  34. data/bin/commands/apps.rb +15 -9
  35. data/bin/commands/apps_connections.rb +13 -7
  36. data/bin/commands/apps_event_authorizations.rb +16 -10
  37. data/bin/commands/apps_manifest.rb +48 -42
  38. data/bin/commands/auth.rb +21 -15
  39. data/bin/commands/auth_teams.rb +16 -10
  40. data/bin/commands/bookmarks.rb +50 -44
  41. data/bin/commands/bots.rb +15 -9
  42. data/bin/commands/calls.rb +49 -43
  43. data/bin/commands/calls_participants.rb +24 -18
  44. data/bin/commands/chat.rb +150 -144
  45. data/bin/commands/chat_scheduledMessages.rb +19 -13
  46. data/bin/commands/conversations.rb +233 -227
  47. data/bin/commands/dialog.rb +15 -9
  48. data/bin/commands/dnd.rb +46 -40
  49. data/bin/commands/emoji.rb +14 -7
  50. data/bin/commands/files.rb +110 -105
  51. data/bin/commands/files_comments.rb +15 -9
  52. data/bin/commands/files_remote.rb +73 -67
  53. data/bin/commands/functions_workflows_steps.rb +22 -0
  54. data/bin/commands/functions_workflows_steps_responses.rb +22 -0
  55. data/bin/commands/migration.rb +16 -10
  56. data/bin/commands/oauth.rb +18 -12
  57. data/bin/commands/oauth_v2.rb +28 -22
  58. data/bin/commands/openid_connect.rb +26 -20
  59. data/bin/commands/pins.rb +33 -26
  60. data/bin/commands/reactions.rb +52 -46
  61. data/bin/commands/reminders.rb +53 -47
  62. data/bin/commands/rtm.rb +15 -9
  63. data/bin/commands/search.rb +43 -37
  64. data/bin/commands/stars.rb +38 -32
  65. data/bin/commands/team.rb +47 -39
  66. data/bin/commands/team_billing.rb +13 -7
  67. data/bin/commands/team_preferences.rb +13 -7
  68. data/bin/commands/team_profile.rb +14 -8
  69. data/bin/commands/tooling_tokens.rb +14 -8
  70. data/bin/commands/usergroups.rb +64 -58
  71. data/bin/commands/usergroups_users.rb +27 -21
  72. data/bin/commands/users.rb +111 -105
  73. data/bin/commands/users_admin.rb +28 -22
  74. data/bin/commands/users_prefs.rb +13 -7
  75. data/bin/commands/users_profile.rb +26 -20
  76. data/bin/commands/views.rb +47 -41
  77. data/bin/commands/workflows.rb +36 -30
  78. data/bin/slack +48 -43
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
  81. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
  82. data/lib/slack/web/api/endpoints/admin_conversations.rb +78 -0
  83. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  84. data/lib/slack/web/api/endpoints/chat.rb +2 -2
  85. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  86. data/lib/slack/web/api/endpoints/emoji.rb +2 -0
  87. data/lib/slack/web/api/endpoints/files.rb +0 -2
  88. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
  89. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
  90. data/lib/slack/web/api/endpoints/pins.rb +2 -0
  91. data/lib/slack/web/api/endpoints/team.rb +11 -1
  92. data/lib/slack/web/api/endpoints/usergroups.rb +1 -1
  93. data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
  94. data/lib/slack/web/api/endpoints.rb +6 -0
  95. data/lib/slack/web/api/errors.rb +62 -0
  96. data/lib/slack/web/api/templates/command.erb +18 -12
  97. data/lib/tasks/web.rake +0 -6
  98. data/slack-ruby-client.gemspec +0 -1
  99. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
  100. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
  101. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
  102. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
  103. metadata +13 -19
  104. data/bin/commands.rb +0 -69
  105. data/lib/slack/web/api/templates/commands.erb +0 -6
@@ -1,16 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Migration methods.'
5
- command 'migration' do |g|
6
- g.desc 'For Enterprise Grid workspaces, map local user IDs to global user IDs'
7
- g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
8
- g.command 'exchange' do |c|
9
- c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
10
- c.flag 'team_id', desc: 'Specify team_id starts with T in case of Org Token.'
11
- c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.migration_exchange(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Migration methods.'
8
+ command 'migration' do |g|
9
+ g.desc 'For Enterprise Grid workspaces, map local user IDs to global user IDs'
10
+ g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
11
+ g.command 'exchange' do |c|
12
+ c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
13
+ c.flag 'team_id', desc: 'Specify team_id starts with T in case of Org Token.'
14
+ c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.migration_exchange(options))
17
+ end
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -1,18 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Oauth methods.'
5
- command 'oauth' do |g|
6
- g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
7
- g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
8
- g.command 'access' do |c|
9
- c.flag 'client_id', desc: 'Issued when you created your application.'
10
- c.flag 'client_secret', desc: 'Issued when you created your application.'
11
- c.flag 'code', desc: 'The code param returned via the OAuth callback.'
12
- c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
13
- c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel. Only valid with a legacy workspace app.'
14
- c.action do |_global_options, options, _args|
15
- puts JSON.dump($client.oauth_access(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Oauth methods.'
8
+ command 'oauth' do |g|
9
+ g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
10
+ g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
11
+ g.command 'access' do |c|
12
+ c.flag 'client_id', desc: 'Issued when you created your application.'
13
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
14
+ c.flag 'code', desc: 'The code param returned via the OAuth callback.'
15
+ c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
16
+ c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel. Only valid with a legacy workspace app.'
17
+ c.action do |_global_options, options, _args|
18
+ puts JSON.dump(@client.oauth_access(options))
19
+ end
20
+ end
21
+ end
16
22
  end
17
23
  end
18
24
  end
@@ -1,29 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'OauthV2 methods.'
5
- command 'oauth_v2' do |g|
6
- g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
7
- g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
8
- g.command 'access' do |c|
9
- c.flag 'client_id', desc: 'Issued when you created your application.'
10
- c.flag 'client_secret', desc: 'Issued when you created your application.'
11
- c.flag 'code', desc: 'The code param returned via the OAuth callback.'
12
- c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
13
- c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
14
- c.flag 'refresh_token', desc: 'The refresh_token param as described in the OAuth spec.'
15
- c.action do |_global_options, options, _args|
16
- puts JSON.dump($client.oauth_v2_access(options))
17
- end
18
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'OauthV2 methods.'
8
+ command 'oauth_v2' do |g|
9
+ g.desc 'Exchanges a temporary OAuth verifier code for an access token.'
10
+ g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. )
11
+ g.command 'access' do |c|
12
+ c.flag 'client_id', desc: 'Issued when you created your application.'
13
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
14
+ c.flag 'code', desc: 'The code param returned via the OAuth callback.'
15
+ c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
16
+ c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
17
+ c.flag 'refresh_token', desc: 'The refresh_token param as described in the OAuth spec.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump(@client.oauth_v2_access(options))
20
+ end
21
+ end
19
22
 
20
- g.desc 'Exchanges a legacy access token for a new expiring access token and refresh token'
21
- g.long_desc %( Exchanges a legacy access token for a new expiring access token and refresh token )
22
- g.command 'exchange' do |c|
23
- c.flag 'client_id', desc: 'Issued when you created your application.'
24
- c.flag 'client_secret', desc: 'Issued when you created your application.'
25
- c.action do |_global_options, options, _args|
26
- puts JSON.dump($client.oauth_v2_exchange(options))
23
+ g.desc 'Exchanges a legacy access token for a new expiring access token and refresh token'
24
+ g.long_desc %( Exchanges a legacy access token for a new expiring access token and refresh token )
25
+ g.command 'exchange' do |c|
26
+ c.flag 'client_id', desc: 'Issued when you created your application.'
27
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump(@client.oauth_v2_exchange(options))
30
+ end
31
+ end
32
+ end
27
33
  end
28
34
  end
29
35
  end
@@ -1,27 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'OpenidConnect methods.'
5
- command 'openid_connect' do |g|
6
- g.desc 'Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack.'
7
- g.long_desc %( Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. )
8
- g.command 'token' do |c|
9
- c.flag 'client_id', desc: 'Issued when you created your application.'
10
- c.flag 'client_secret', desc: 'Issued when you created your application.'
11
- c.flag 'code', desc: 'The code param returned via the OAuth callback.'
12
- c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
13
- c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
14
- c.flag 'refresh_token', desc: 'The refresh_token param as described in the OAuth spec.'
15
- c.action do |_global_options, options, _args|
16
- puts JSON.dump($client.openid_connect_token(options))
17
- end
18
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'OpenidConnect methods.'
8
+ command 'openid_connect' do |g|
9
+ g.desc 'Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack.'
10
+ g.long_desc %( Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. )
11
+ g.command 'token' do |c|
12
+ c.flag 'client_id', desc: 'Issued when you created your application.'
13
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
14
+ c.flag 'code', desc: 'The code param returned via the OAuth callback.'
15
+ c.flag 'grant_type', desc: 'The grant_type param as described in the OAuth spec.'
16
+ c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
17
+ c.flag 'refresh_token', desc: 'The refresh_token param as described in the OAuth spec.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump(@client.openid_connect_token(options))
20
+ end
21
+ end
19
22
 
20
- g.desc 'Get the identity of a user who has authorized Sign in with Slack.'
21
- g.long_desc %( Get the identity of a user who has authorized Sign in with Slack. )
22
- g.command 'userInfo' do |c|
23
- c.action do |_global_options, options, _args|
24
- puts JSON.dump($client.openid_connect_userInfo(options))
23
+ g.desc 'Get the identity of a user who has authorized Sign in with Slack.'
24
+ g.long_desc %( Get the identity of a user who has authorized Sign in with Slack. )
25
+ g.command 'userInfo' do |c|
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.openid_connect_userInfo(options))
28
+ end
29
+ end
30
+ end
25
31
  end
26
32
  end
27
33
  end
data/bin/commands/pins.rb CHANGED
@@ -1,34 +1,41 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Pins methods.'
5
- command 'pins' do |g|
6
- g.desc 'Pins an item to a channel.'
7
- g.long_desc %( Pins an item to a channel. )
8
- g.command 'add' do |c|
9
- c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
10
- c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.pins_add(options))
13
- end
14
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Pins methods.'
8
+ command 'pins' do |g|
9
+ g.desc 'Pins an item to a channel.'
10
+ g.long_desc %( Pins an item to a channel. )
11
+ g.command 'add' do |c|
12
+ c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
13
+ c.flag 'quip_component_id', desc: 'Component ID for the pins component that was inserted into the channel canvas, if any.'
14
+ c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.pins_add(options))
17
+ end
18
+ end
15
19
 
16
- g.desc 'Lists items pinned to a channel.'
17
- g.long_desc %( Lists items pinned to a channel. )
18
- g.command 'list' do |c|
19
- c.flag 'channel', desc: 'Channel to get pinned items for.'
20
- c.action do |_global_options, options, _args|
21
- puts JSON.dump($client.pins_list(options))
22
- end
23
- end
20
+ g.desc 'Lists items pinned to a channel.'
21
+ g.long_desc %( Lists items pinned to a channel. )
22
+ g.command 'list' do |c|
23
+ c.flag 'channel', desc: 'Channel to get pinned items for.'
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump(@client.pins_list(options))
26
+ end
27
+ end
24
28
 
25
- g.desc 'Un-pins an item from a channel.'
26
- g.long_desc %( Un-pins an item from a channel. )
27
- g.command 'remove' do |c|
28
- c.flag 'channel', desc: 'Channel where the item is pinned to.'
29
- c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
30
- c.action do |_global_options, options, _args|
31
- puts JSON.dump($client.pins_remove(options))
29
+ g.desc 'Un-pins an item from a channel.'
30
+ g.long_desc %( Un-pins an item from a channel. )
31
+ g.command 'remove' do |c|
32
+ c.flag 'channel', desc: 'Channel where the item is pinned to.'
33
+ c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
34
+ c.action do |_global_options, options, _args|
35
+ puts JSON.dump(@client.pins_remove(options))
36
+ end
37
+ end
38
+ end
32
39
  end
33
40
  end
34
41
  end
@@ -1,55 +1,61 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Reactions methods.'
5
- command 'reactions' do |g|
6
- g.desc 'Adds a reaction to an item.'
7
- g.long_desc %( Adds a reaction to an item. )
8
- g.command 'add' do |c|
9
- c.flag 'channel', desc: 'Channel where the message to add reaction to was posted.'
10
- c.flag 'name', desc: 'Reaction (emoji) name.'
11
- c.flag 'timestamp', desc: 'Timestamp of the message to add reaction to.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.reactions_add(options))
14
- end
15
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Reactions methods.'
8
+ command 'reactions' do |g|
9
+ g.desc 'Adds a reaction to an item.'
10
+ g.long_desc %( Adds a reaction to an item. )
11
+ g.command 'add' do |c|
12
+ c.flag 'channel', desc: 'Channel where the message to add reaction to was posted.'
13
+ c.flag 'name', desc: 'Reaction (emoji) name.'
14
+ c.flag 'timestamp', desc: 'Timestamp of the message to add reaction to.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.reactions_add(options))
17
+ end
18
+ end
16
19
 
17
- g.desc 'Gets reactions for an item.'
18
- g.long_desc %( Gets reactions for an item. )
19
- g.command 'get' do |c|
20
- c.flag 'channel', desc: 'Channel where the message to get reactions for was posted.'
21
- c.flag 'file', desc: 'File to get reactions for.'
22
- c.flag 'file_comment', desc: 'File comment to get reactions for.'
23
- c.flag 'full', desc: 'If true always return the complete reaction list.'
24
- c.flag 'timestamp', desc: 'Timestamp of the message to get reactions for.'
25
- c.action do |_global_options, options, _args|
26
- puts JSON.dump($client.reactions_get(options))
27
- end
28
- end
20
+ g.desc 'Gets reactions for an item.'
21
+ g.long_desc %( Gets reactions for an item. )
22
+ g.command 'get' do |c|
23
+ c.flag 'channel', desc: 'Channel where the message to get reactions for was posted.'
24
+ c.flag 'file', desc: 'File to get reactions for.'
25
+ c.flag 'file_comment', desc: 'File comment to get reactions for.'
26
+ c.flag 'full', desc: 'If true always return the complete reaction list.'
27
+ c.flag 'timestamp', desc: 'Timestamp of the message to get reactions for.'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump(@client.reactions_get(options))
30
+ end
31
+ end
29
32
 
30
- g.desc 'Lists reactions made by a user.'
31
- g.long_desc %( Lists reactions made by a user. )
32
- g.command 'list' do |c|
33
- 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."
34
- c.flag 'full', desc: 'If true always return the complete reaction list.'
35
- 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."
36
- c.flag 'team_id', desc: 'encoded team id to list reactions in, required if org token is used.'
37
- c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
38
- c.action do |_global_options, options, _args|
39
- puts JSON.dump($client.reactions_list(options))
40
- end
41
- end
33
+ g.desc 'Lists reactions made by a user.'
34
+ g.long_desc %( Lists reactions made by a user. )
35
+ g.command 'list' do |c|
36
+ 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."
37
+ c.flag 'full', desc: 'If true always return the complete reaction list.'
38
+ 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."
39
+ c.flag 'team_id', desc: 'encoded team id to list reactions in, required if org token is used.'
40
+ c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.reactions_list(options))
43
+ end
44
+ end
42
45
 
43
- g.desc 'Removes a reaction from an item.'
44
- g.long_desc %( Removes a reaction from an item. )
45
- g.command 'remove' do |c|
46
- c.flag 'name', desc: 'Reaction (emoji) name.'
47
- c.flag 'channel', desc: 'Channel where the message to remove reaction from was posted.'
48
- c.flag 'file', desc: 'File to remove reaction from.'
49
- c.flag 'file_comment', desc: 'File comment to remove reaction from.'
50
- c.flag 'timestamp', desc: 'Timestamp of the message to remove reaction from.'
51
- c.action do |_global_options, options, _args|
52
- puts JSON.dump($client.reactions_remove(options))
46
+ g.desc 'Removes a reaction from an item.'
47
+ g.long_desc %( Removes a reaction from an item. )
48
+ g.command 'remove' do |c|
49
+ c.flag 'name', desc: 'Reaction (emoji) name.'
50
+ c.flag 'channel', desc: 'Channel where the message to remove reaction from was posted.'
51
+ c.flag 'file', desc: 'File to remove reaction from.'
52
+ c.flag 'file_comment', desc: 'File comment to remove reaction from.'
53
+ c.flag 'timestamp', desc: 'Timestamp of the message to remove reaction from.'
54
+ c.action do |_global_options, options, _args|
55
+ puts JSON.dump(@client.reactions_remove(options))
56
+ end
57
+ end
58
+ end
53
59
  end
54
60
  end
55
61
  end
@@ -1,57 +1,63 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Reminders methods.'
5
- command 'reminders' do |g|
6
- g.desc 'Creates a reminder.'
7
- g.long_desc %( Creates a reminder. )
8
- g.command 'add' do |c|
9
- c.flag 'text', desc: 'The content of the reminder.'
10
- c.flag 'time', desc: 'When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
11
- c.flag 'recurrence', desc: 'Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.'
12
- c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
13
- c.flag 'user', desc: 'The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.'
14
- c.action do |_global_options, options, _args|
15
- puts JSON.dump($client.reminders_add(options))
16
- end
17
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Reminders methods.'
8
+ command 'reminders' do |g|
9
+ g.desc 'Creates a reminder.'
10
+ g.long_desc %( Creates a reminder. )
11
+ g.command 'add' do |c|
12
+ c.flag 'text', desc: 'The content of the reminder.'
13
+ c.flag 'time', desc: 'When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").'
14
+ c.flag 'recurrence', desc: 'Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.'
15
+ c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
16
+ c.flag 'user', desc: 'The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.'
17
+ c.action do |_global_options, options, _args|
18
+ puts JSON.dump(@client.reminders_add(options))
19
+ end
20
+ end
18
21
 
19
- g.desc 'Marks a reminder as complete.'
20
- g.long_desc %( Marks a reminder as complete. )
21
- g.command 'complete' do |c|
22
- c.flag 'reminder', desc: 'The ID of the reminder to be marked as complete.'
23
- c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
24
- c.action do |_global_options, options, _args|
25
- puts JSON.dump($client.reminders_complete(options))
26
- end
27
- end
22
+ g.desc 'Marks a reminder as complete.'
23
+ g.long_desc %( Marks a reminder as complete. )
24
+ g.command 'complete' do |c|
25
+ c.flag 'reminder', desc: 'The ID of the reminder to be marked as complete.'
26
+ c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
27
+ c.action do |_global_options, options, _args|
28
+ puts JSON.dump(@client.reminders_complete(options))
29
+ end
30
+ end
28
31
 
29
- g.desc 'Deletes a reminder.'
30
- g.long_desc %( Deletes a reminder. )
31
- g.command 'delete' do |c|
32
- c.flag 'reminder', desc: 'The ID of the reminder.'
33
- c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
34
- c.action do |_global_options, options, _args|
35
- puts JSON.dump($client.reminders_delete(options))
36
- end
37
- end
32
+ g.desc 'Deletes a reminder.'
33
+ g.long_desc %( Deletes a reminder. )
34
+ g.command 'delete' do |c|
35
+ c.flag 'reminder', desc: 'The ID of the reminder.'
36
+ c.flag 'team_id', desc: 'Encoded team id, required if org token is used.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.reminders_delete(options))
39
+ end
40
+ end
38
41
 
39
- g.desc 'Gets information about a reminder.'
40
- g.long_desc %( Gets information about a reminder. )
41
- g.command 'info' do |c|
42
- c.flag 'reminder', desc: 'The ID of the reminder.'
43
- c.flag 'team_id', desc: 'Encoded team id, required if org token is passed.'
44
- c.action do |_global_options, options, _args|
45
- puts JSON.dump($client.reminders_info(options))
46
- end
47
- end
42
+ g.desc 'Gets information about a reminder.'
43
+ g.long_desc %( Gets information about a reminder. )
44
+ g.command 'info' do |c|
45
+ c.flag 'reminder', desc: 'The ID of the reminder.'
46
+ c.flag 'team_id', desc: 'Encoded team id, required if org token is passed.'
47
+ c.action do |_global_options, options, _args|
48
+ puts JSON.dump(@client.reminders_info(options))
49
+ end
50
+ end
48
51
 
49
- g.desc 'Lists all reminders created by or for a given user.'
50
- g.long_desc %( Lists all reminders created by or for a given user. )
51
- g.command 'list' do |c|
52
- c.flag 'team_id', desc: 'Encoded team id, required if org token is passed.'
53
- c.action do |_global_options, options, _args|
54
- puts JSON.dump($client.reminders_list(options))
52
+ g.desc 'Lists all reminders created by or for a given user.'
53
+ g.long_desc %( Lists all reminders created by or for a given user. )
54
+ g.command 'list' do |c|
55
+ c.flag 'team_id', desc: 'Encoded team id, required if org token is passed.'
56
+ c.action do |_global_options, options, _args|
57
+ puts JSON.dump(@client.reminders_list(options))
58
+ end
59
+ end
60
+ end
55
61
  end
56
62
  end
57
63
  end
data/bin/commands/rtm.rb CHANGED
@@ -1,15 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Rtm methods.'
5
- command 'rtm' do |g|
6
- g.desc 'Starts a Real Time Messaging session.'
7
- g.long_desc %( Starts a Real Time Messaging session. )
8
- g.command 'connect' do |c|
9
- c.flag 'batch_presence_aware', desc: 'Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.'
10
- c.flag 'presence_sub', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.rtm_connect(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Rtm methods.'
8
+ command 'rtm' do |g|
9
+ g.desc 'Starts a Real Time Messaging session.'
10
+ g.long_desc %( Starts a Real Time Messaging session. )
11
+ g.command 'connect' do |c|
12
+ c.flag 'batch_presence_aware', desc: 'Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.'
13
+ c.flag 'presence_sub', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.rtm_connect(options))
16
+ end
17
+ end
18
+ end
13
19
  end
14
20
  end
15
21
  end
@@ -1,45 +1,51 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Search methods.'
5
- command 'search' do |g|
6
- g.desc 'Searches for messages and files matching a query.'
7
- g.long_desc %( Searches for messages and files matching a query. )
8
- g.command 'all' do |c|
9
- c.flag 'query', desc: 'Search query. May contains booleans, etc.'
10
- c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
11
- c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
12
- c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
13
- c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
14
- c.action do |_global_options, options, _args|
15
- puts JSON.dump($client.search_all(options))
16
- end
17
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Search methods.'
8
+ command 'search' do |g|
9
+ g.desc 'Searches for messages and files matching a query.'
10
+ g.long_desc %( Searches for messages and files matching a query. )
11
+ g.command 'all' do |c|
12
+ c.flag 'query', desc: 'Search query. May contains booleans, etc.'
13
+ c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
14
+ c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
15
+ c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
16
+ c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
17
+ c.action do |_global_options, options, _args|
18
+ puts JSON.dump(@client.search_all(options))
19
+ end
20
+ end
18
21
 
19
- g.desc 'Searches for files matching a query.'
20
- g.long_desc %( Searches for files matching a query. )
21
- g.command 'files' do |c|
22
- c.flag 'query', desc: 'Search query.'
23
- c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
24
- c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
25
- c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
26
- c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
27
- c.action do |_global_options, options, _args|
28
- puts JSON.dump($client.search_files(options))
29
- end
30
- end
22
+ g.desc 'Searches for files matching a query.'
23
+ g.long_desc %( Searches for files matching a query. )
24
+ g.command 'files' do |c|
25
+ c.flag 'query', desc: 'Search query.'
26
+ c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
27
+ c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
28
+ c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
29
+ c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
30
+ c.action do |_global_options, options, _args|
31
+ puts JSON.dump(@client.search_files(options))
32
+ end
33
+ end
31
34
 
32
- g.desc 'Searches for messages matching a query.'
33
- g.long_desc %( Searches for messages matching a query. )
34
- g.command 'messages' do |c|
35
- c.flag 'query', desc: 'Search query.'
36
- c.flag 'cursor', desc: "Use this when getting results with cursormark pagination. For first call send * for subsequent calls, send the value of next_cursor returned in the previous call's results."
37
- c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
38
- c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
39
- c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
40
- c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
41
- c.action do |_global_options, options, _args|
42
- puts JSON.dump($client.search_messages(options))
35
+ g.desc 'Searches for messages matching a query.'
36
+ g.long_desc %( Searches for messages matching a query. )
37
+ g.command 'messages' do |c|
38
+ c.flag 'query', desc: 'Search query.'
39
+ c.flag 'cursor', desc: "Use this when getting results with cursormark pagination. For first call send * for subsequent calls, send the value of next_cursor returned in the previous call's results."
40
+ c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
41
+ c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
42
+ c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
43
+ c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
44
+ c.action do |_global_options, options, _args|
45
+ puts JSON.dump(@client.search_messages(options))
46
+ end
47
+ end
48
+ end
43
49
  end
44
50
  end
45
51
  end