slack-ruby-client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,255 +1,261 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Conversations methods.'
5
- command 'conversations' do |g|
6
- g.desc 'Accepts an invitation to a Slack Connect channel.'
7
- g.long_desc %( Accepts an invitation to a Slack Connect channel. )
8
- g.command 'acceptSharedInvite' do |c|
9
- c.flag 'channel_name', desc: 'Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.'
10
- c.flag 'channel_id', desc: "ID of the channel that you'd like to accept. Must provide either invite_id or channel_id."
11
- c.flag 'free_trial_accepted', desc: "Whether you'd like to use your workspace's free trial to begin using Slack Connect."
12
- c.flag 'invite_id', desc: 'See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.'
13
- c.flag 'is_private', desc: 'Whether the channel should be private.'
14
- c.flag 'team_id', desc: 'The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.'
15
- c.action do |_global_options, options, _args|
16
- puts JSON.dump($client.conversations_acceptSharedInvite(options))
17
- end
18
- end
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: '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
19
22
 
20
- g.desc 'Approves an invitation to a Slack Connect channel'
21
- g.long_desc %( Approves an invitation to a Slack Connect channel )
22
- g.command 'approveSharedInvite' do |c|
23
- c.flag 'invite_id', desc: 'ID of the shared channel invite to approve.'
24
- c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are approving.'
25
- c.action do |_global_options, options, _args|
26
- puts JSON.dump($client.conversations_approveSharedInvite(options))
27
- end
28
- end
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
29
32
 
30
- g.desc 'Archives a conversation.'
31
- g.long_desc %( Archives a conversation. )
32
- g.command 'archive' do |c|
33
- c.flag 'channel', desc: 'ID of conversation to archive.'
34
- c.action do |_global_options, options, _args|
35
- puts JSON.dump($client.conversations_archive(options))
36
- end
37
- 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
38
41
 
39
- g.desc 'Closes a direct message or multi-person direct message.'
40
- g.long_desc %( Closes a direct message or multi-person direct message. )
41
- g.command 'close' do |c|
42
- c.flag 'channel', desc: 'Conversation to close.'
43
- c.action do |_global_options, options, _args|
44
- puts JSON.dump($client.conversations_close(options))
45
- end
46
- 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
47
50
 
48
- g.desc 'Initiates a public or private channel-based conversation'
49
- g.long_desc %( Initiates a public or private channel-based conversation )
50
- g.command 'create' do |c|
51
- c.flag 'name', desc: 'Name of the public or private channel to create.'
52
- c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
53
- c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
54
- c.action do |_global_options, options, _args|
55
- puts JSON.dump($client.conversations_create(options))
56
- end
57
- 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
58
61
 
59
- g.desc 'Declines a Slack Connect channel invite.'
60
- g.long_desc %( Declines a Slack Connect channel invite. )
61
- g.command 'declineSharedInvite' do |c|
62
- c.flag 'invite_id', desc: 'ID of the Slack Connect invite to decline. Subscribe to the shared_channel_invite_accepted event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.'
63
- c.flag 'target_team', desc: 'The team or enterprise id of the other party involved in the invitation you are declining.'
64
- c.action do |_global_options, options, _args|
65
- puts JSON.dump($client.conversations_declineSharedInvite(options))
66
- end
67
- end
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
68
71
 
69
- g.desc "Fetches a conversation's history of messages and events."
70
- g.long_desc %( Fetches a conversation's history of messages and events. )
71
- g.command 'history' do |c|
72
- c.flag 'channel', desc: 'Conversation ID to fetch history for.'
73
- c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
74
- c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
75
- c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
76
- c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results. Default is the current time.'
77
- 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."
78
- c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
79
- c.action do |_global_options, options, _args|
80
- puts JSON.dump($client.conversations_history(options))
81
- end
82
- 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 users list hasn't been reached."
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
83
86
 
84
- g.desc 'Retrieve information about a conversation.'
85
- g.long_desc %( Retrieve information about a conversation. )
86
- g.command 'info' do |c|
87
- c.flag 'channel', desc: 'Conversation ID to learn more about.'
88
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this conversation. Defaults to false.'
89
- c.flag 'include_num_members', desc: 'Set to true to include the member count for the specified conversation. Defaults to false.'
90
- c.action do |_global_options, options, _args|
91
- puts JSON.dump($client.conversations_info(options))
92
- end
93
- 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
94
97
 
95
- g.desc 'Invites users to a channel.'
96
- g.long_desc %( Invites users to a channel. )
97
- g.command 'invite' do |c|
98
- c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
99
- c.flag 'users', desc: 'A comma separated list of user IDs. Up to 1000 users may be listed.'
100
- c.action do |_global_options, options, _args|
101
- puts JSON.dump($client.conversations_invite(options))
102
- end
103
- 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.action do |_global_options, options, _args|
104
+ puts JSON.dump(@client.conversations_invite(options))
105
+ end
106
+ end
104
107
 
105
- g.desc 'Sends an invitation to a Slack Connect channel'
106
- g.long_desc %( Sends an invitation to a Slack Connect channel )
107
- g.command 'inviteShared' do |c|
108
- c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
109
- c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided.'
110
- c.flag 'external_limited', desc: 'Optional boolean on whether invite is to a external limited member. Defaults to true.'
111
- c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided.'
112
- c.action do |_global_options, options, _args|
113
- puts JSON.dump($client.conversations_inviteShared(options))
114
- end
115
- end
108
+ g.desc 'Sends an invitation to a Slack Connect channel'
109
+ g.long_desc %( Sends an invitation to a Slack Connect channel )
110
+ g.command 'inviteShared' do |c|
111
+ c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
112
+ c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided.'
113
+ c.flag 'external_limited', desc: 'Optional boolean on whether invite is to a external limited member. Defaults to true.'
114
+ c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided.'
115
+ c.action do |_global_options, options, _args|
116
+ puts JSON.dump(@client.conversations_inviteShared(options))
117
+ end
118
+ end
116
119
 
117
- g.desc 'Joins an existing conversation.'
118
- g.long_desc %( Joins an existing conversation. )
119
- g.command 'join' do |c|
120
- c.flag 'channel', desc: 'ID of conversation to join.'
121
- c.action do |_global_options, options, _args|
122
- puts JSON.dump($client.conversations_join(options))
123
- end
124
- end
120
+ g.desc 'Joins an existing conversation.'
121
+ g.long_desc %( Joins an existing conversation. )
122
+ g.command 'join' do |c|
123
+ c.flag 'channel', desc: 'ID of conversation to join.'
124
+ c.action do |_global_options, options, _args|
125
+ puts JSON.dump(@client.conversations_join(options))
126
+ end
127
+ end
125
128
 
126
- g.desc 'Removes a user from a conversation.'
127
- g.long_desc %( Removes a user from a conversation. )
128
- g.command 'kick' do |c|
129
- c.flag 'channel', desc: 'ID of conversation to remove user from.'
130
- c.flag 'user', desc: 'User ID to be removed.'
131
- c.action do |_global_options, options, _args|
132
- puts JSON.dump($client.conversations_kick(options))
133
- end
134
- end
129
+ g.desc 'Removes a user from a conversation.'
130
+ g.long_desc %( Removes a user from a conversation. )
131
+ g.command 'kick' do |c|
132
+ c.flag 'channel', desc: 'ID of conversation to remove user from.'
133
+ c.flag 'user', desc: 'User ID to be removed.'
134
+ c.action do |_global_options, options, _args|
135
+ puts JSON.dump(@client.conversations_kick(options))
136
+ end
137
+ end
135
138
 
136
- g.desc 'Leaves a conversation.'
137
- g.long_desc %( Leaves a conversation. )
138
- g.command 'leave' do |c|
139
- c.flag 'channel', desc: 'Conversation to leave.'
140
- c.action do |_global_options, options, _args|
141
- puts JSON.dump($client.conversations_leave(options))
142
- end
143
- end
139
+ g.desc 'Leaves a conversation.'
140
+ g.long_desc %( Leaves a conversation. )
141
+ g.command 'leave' do |c|
142
+ c.flag 'channel', desc: 'Conversation to leave.'
143
+ c.action do |_global_options, options, _args|
144
+ puts JSON.dump(@client.conversations_leave(options))
145
+ end
146
+ end
144
147
 
145
- g.desc 'Lists all channels in a Slack team.'
146
- g.long_desc %( Lists all channels in a Slack team. )
147
- g.command 'list' do |c|
148
- 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."
149
- c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
150
- 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."
151
- c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
152
- 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.'
153
- c.action do |_global_options, options, _args|
154
- puts JSON.dump($client.conversations_list(options))
155
- end
156
- end
148
+ g.desc 'Lists all channels in a Slack team.'
149
+ g.long_desc %( Lists all channels in a Slack team. )
150
+ g.command 'list' do |c|
151
+ 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."
152
+ c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
153
+ 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."
154
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if token belongs to org-wide app.'
155
+ 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.'
156
+ c.action do |_global_options, options, _args|
157
+ puts JSON.dump(@client.conversations_list(options))
158
+ end
159
+ end
157
160
 
158
- g.desc 'Lists shared channel invites that have been generated or received but have not been approved by all parties'
159
- g.long_desc %( Lists shared channel invites that have been generated or received but have not been approved by all parties )
160
- g.command 'listConnectInvites' do |c|
161
- c.flag 'cursor', desc: 'Set to next_cursor returned by previous call to list items in subsequent page.'
162
- c.flag 'team_id', desc: 'Encoded team id for the workspace to retrieve invites for, required if org token is used.'
163
- c.action do |_global_options, options, _args|
164
- puts JSON.dump($client.conversations_listConnectInvites(options))
165
- end
166
- end
161
+ g.desc 'Lists shared channel invites that have been generated or received but have not been approved by all parties'
162
+ g.long_desc %( Lists shared channel invites that have been generated or received but have not been approved by all parties )
163
+ g.command 'listConnectInvites' do |c|
164
+ c.flag 'cursor', desc: 'Set to next_cursor returned by previous call to list items in subsequent page.'
165
+ c.flag 'team_id', desc: 'Encoded team id for the workspace to retrieve invites for, required if org token is used.'
166
+ c.action do |_global_options, options, _args|
167
+ puts JSON.dump(@client.conversations_listConnectInvites(options))
168
+ end
169
+ end
167
170
 
168
- g.desc 'Sets the read cursor in a channel.'
169
- g.long_desc %( Sets the read cursor in a channel. )
170
- g.command 'mark' do |c|
171
- c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
172
- c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
173
- c.action do |_global_options, options, _args|
174
- puts JSON.dump($client.conversations_mark(options))
175
- end
176
- end
171
+ g.desc 'Sets the read cursor in a channel.'
172
+ g.long_desc %( Sets the read cursor in a channel. )
173
+ g.command 'mark' do |c|
174
+ c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
175
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
176
+ c.action do |_global_options, options, _args|
177
+ puts JSON.dump(@client.conversations_mark(options))
178
+ end
179
+ end
177
180
 
178
- g.desc 'Retrieve members of a conversation.'
179
- g.long_desc %( Retrieve members of a conversation. )
180
- g.command 'members' do |c|
181
- c.flag 'channel', desc: 'ID of the conversation to retrieve members for.'
182
- 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."
183
- 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."
184
- c.action do |_global_options, options, _args|
185
- puts JSON.dump($client.conversations_members(options))
186
- end
187
- end
181
+ g.desc 'Retrieve members of a conversation.'
182
+ g.long_desc %( Retrieve members of a conversation. )
183
+ g.command 'members' do |c|
184
+ c.flag 'channel', desc: 'ID of the conversation to retrieve members for.'
185
+ 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."
186
+ 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."
187
+ c.action do |_global_options, options, _args|
188
+ puts JSON.dump(@client.conversations_members(options))
189
+ end
190
+ end
188
191
 
189
- g.desc 'Opens or resumes a direct message or multi-person direct message.'
190
- g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
191
- g.command 'open' do |c|
192
- c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
193
- 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.'
194
- c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
195
- 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.'
196
- c.action do |_global_options, options, _args|
197
- puts JSON.dump($client.conversations_open(options))
198
- end
199
- end
192
+ g.desc 'Opens or resumes a direct message or multi-person direct message.'
193
+ g.long_desc %( Opens or resumes a direct message or multi-person direct message. )
194
+ g.command 'open' do |c|
195
+ c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead."
196
+ 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.'
197
+ c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
198
+ 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.'
199
+ c.action do |_global_options, options, _args|
200
+ puts JSON.dump(@client.conversations_open(options))
201
+ end
202
+ end
200
203
 
201
- g.desc 'Renames a conversation.'
202
- g.long_desc %( Renames a conversation. )
203
- g.command 'rename' do |c|
204
- c.flag 'channel', desc: 'ID of conversation to rename.'
205
- c.flag 'name', desc: 'New name for conversation.'
206
- c.action do |_global_options, options, _args|
207
- puts JSON.dump($client.conversations_rename(options))
208
- end
209
- end
204
+ g.desc 'Renames a conversation.'
205
+ g.long_desc %( Renames a conversation. )
206
+ g.command 'rename' do |c|
207
+ c.flag 'channel', desc: 'ID of conversation to rename.'
208
+ c.flag 'name', desc: 'New name for conversation.'
209
+ c.action do |_global_options, options, _args|
210
+ puts JSON.dump(@client.conversations_rename(options))
211
+ end
212
+ end
210
213
 
211
- g.desc 'Retrieve a thread of messages posted to a conversation'
212
- g.long_desc %( Retrieve a thread of messages posted to a conversation )
213
- g.command 'replies' do |c|
214
- c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
215
- 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."
216
- 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."
217
- c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
218
- c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
219
- c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results.'
220
- 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."
221
- c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
222
- c.action do |_global_options, options, _args|
223
- puts JSON.dump($client.conversations_replies(options))
224
- end
225
- end
214
+ g.desc 'Retrieve a thread of messages posted to a conversation'
215
+ g.long_desc %( Retrieve a thread of messages posted to a conversation )
216
+ g.command 'replies' do |c|
217
+ c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
218
+ 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."
219
+ 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."
220
+ c.flag 'include_all_metadata', desc: 'Return all metadata associated with this message.'
221
+ c.flag 'inclusive', desc: 'Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.'
222
+ c.flag 'latest', desc: 'Only messages before this Unix timestamp will be included in results.'
223
+ 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."
224
+ c.flag 'oldest', desc: 'Only messages after this Unix timestamp will be included in results.'
225
+ c.action do |_global_options, options, _args|
226
+ puts JSON.dump(@client.conversations_replies(options))
227
+ end
228
+ end
226
229
 
227
- g.desc 'Sets the purpose for a conversation.'
228
- g.long_desc %( Sets the purpose for a conversation. )
229
- g.command 'setPurpose' do |c|
230
- c.flag 'channel', desc: 'Conversation to set the purpose of.'
231
- c.flag 'purpose', desc: 'A new, specialer purpose.'
232
- c.action do |_global_options, options, _args|
233
- puts JSON.dump($client.conversations_setPurpose(options))
234
- end
235
- end
230
+ g.desc 'Sets the purpose for a conversation.'
231
+ g.long_desc %( Sets the purpose for a conversation. )
232
+ g.command 'setPurpose' do |c|
233
+ c.flag 'channel', desc: 'Conversation to set the purpose of.'
234
+ c.flag 'purpose', desc: 'A new, specialer purpose.'
235
+ c.action do |_global_options, options, _args|
236
+ puts JSON.dump(@client.conversations_setPurpose(options))
237
+ end
238
+ end
236
239
 
237
- g.desc 'Sets the topic for a conversation.'
238
- g.long_desc %( Sets the topic for a conversation. )
239
- g.command 'setTopic' do |c|
240
- c.flag 'channel', desc: 'Conversation to set the topic of.'
241
- c.flag 'topic', desc: 'The new topic string. Does not support formatting or linkification.'
242
- c.action do |_global_options, options, _args|
243
- puts JSON.dump($client.conversations_setTopic(options))
244
- end
245
- end
240
+ g.desc 'Sets the topic for a conversation.'
241
+ g.long_desc %( Sets the topic for a conversation. )
242
+ g.command 'setTopic' do |c|
243
+ c.flag 'channel', desc: 'Conversation to set the topic of.'
244
+ c.flag 'topic', desc: 'The new topic string. Does not support formatting or linkification.'
245
+ c.action do |_global_options, options, _args|
246
+ puts JSON.dump(@client.conversations_setTopic(options))
247
+ end
248
+ end
246
249
 
247
- g.desc 'Reverses conversation archival.'
248
- g.long_desc %( Reverses conversation archival. )
249
- g.command 'unarchive' do |c|
250
- c.flag 'channel', desc: 'ID of conversation to unarchive.'
251
- c.action do |_global_options, options, _args|
252
- puts JSON.dump($client.conversations_unarchive(options))
250
+ g.desc 'Reverses conversation archival.'
251
+ g.long_desc %( Reverses conversation archival. )
252
+ g.command 'unarchive' do |c|
253
+ c.flag 'channel', desc: 'ID of conversation to unarchive.'
254
+ c.action do |_global_options, options, _args|
255
+ puts JSON.dump(@client.conversations_unarchive(options))
256
+ end
257
+ end
258
+ end
253
259
  end
254
260
  end
255
261
  end
@@ -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 'Dialog methods.'
5
- command 'dialog' do |g|
6
- g.desc 'Open a dialog with a user'
7
- g.long_desc %( Open a dialog with a user )
8
- g.command 'open' do |c|
9
- c.flag 'dialog', desc: 'The dialog definition. This must be a JSON-encoded string.'
10
- c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
11
- c.action do |_global_options, options, _args|
12
- 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
13
19
  end
14
20
  end
15
21
  end