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
data/bin/commands/chat.rb CHANGED
@@ -1,159 +1,165 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Chat methods.'
5
- command 'chat' do |g|
6
- g.desc 'Execute a slash command in a public channel (undocumented)'
7
- g.long_desc %( Execute a slash command in a public channel )
8
- g.command 'command' do |c|
9
- c.flag 'channel', desc: 'Channel to execute the command in.'
10
- c.flag 'command', desc: 'Slash command to be executed. Leading backslash is required.'
11
- c.flag 'text', desc: 'Additional parameters provided to the slash command.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.chat_command(options))
14
- end
15
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Chat methods.'
8
+ command 'chat' do |g|
9
+ g.desc 'Execute a slash command in a public channel (undocumented)'
10
+ g.long_desc %( Execute a slash command in a public channel )
11
+ g.command 'command' do |c|
12
+ c.flag 'channel', desc: 'Channel to execute the command in.'
13
+ c.flag 'command', desc: 'Slash command to be executed. Leading backslash is required.'
14
+ c.flag 'text', desc: 'Additional parameters provided to the slash command.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.chat_command(options))
17
+ end
18
+ end
16
19
 
17
- g.desc 'Deletes a message.'
18
- g.long_desc %( Deletes a message. )
19
- g.command 'delete' do |c|
20
- c.flag 'channel', desc: 'Channel containing the message to be deleted.'
21
- c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
22
- c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
23
- c.action do |_global_options, options, _args|
24
- puts JSON.dump($client.chat_delete(options))
25
- end
26
- end
20
+ g.desc 'Deletes a message.'
21
+ g.long_desc %( Deletes a message. )
22
+ g.command 'delete' do |c|
23
+ c.flag 'channel', desc: 'Channel containing the message to be deleted.'
24
+ c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
25
+ c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.chat_delete(options))
28
+ end
29
+ end
27
30
 
28
- g.desc 'Deletes a pending scheduled message from the queue.'
29
- g.long_desc %( Deletes a pending scheduled message from the queue. )
30
- g.command 'deleteScheduledMessage' do |c|
31
- c.flag 'channel', desc: 'The channel the scheduled_message is posting to.'
32
- c.flag 'scheduled_message_id', desc: 'scheduled_message_id returned from call to chat.scheduleMessage.'
33
- c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
34
- c.action do |_global_options, options, _args|
35
- puts JSON.dump($client.chat_deleteScheduledMessage(options))
36
- end
37
- end
31
+ g.desc 'Deletes a pending scheduled message from the queue.'
32
+ g.long_desc %( Deletes a pending scheduled message from the queue. )
33
+ g.command 'deleteScheduledMessage' do |c|
34
+ c.flag 'channel', desc: 'The channel the scheduled_message is posting to.'
35
+ c.flag 'scheduled_message_id', desc: 'scheduled_message_id returned from call to chat.scheduleMessage.'
36
+ c.flag 'as_user', desc: 'Pass true to delete the message as the authed user with chat:write:user scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with chat:write:bot scope.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.chat_deleteScheduledMessage(options))
39
+ end
40
+ end
38
41
 
39
- g.desc 'Retrieve a permalink URL for a specific extant message'
40
- g.long_desc %( Retrieve a permalink URL for a specific extant message )
41
- g.command 'getPermalink' do |c|
42
- c.flag 'channel', desc: 'The ID of the conversation or channel containing the message.'
43
- c.flag 'message_ts', desc: "A message's ts value, uniquely identifying it within a channel."
44
- c.action do |_global_options, options, _args|
45
- puts JSON.dump($client.chat_getPermalink(options))
46
- end
47
- end
42
+ g.desc 'Retrieve a permalink URL for a specific extant message'
43
+ g.long_desc %( Retrieve a permalink URL for a specific extant message )
44
+ g.command 'getPermalink' do |c|
45
+ c.flag 'channel', desc: 'The ID of the conversation or channel containing the message.'
46
+ c.flag 'message_ts', desc: "A message's ts value, uniquely identifying it within a channel."
47
+ c.action do |_global_options, options, _args|
48
+ puts JSON.dump(@client.chat_getPermalink(options))
49
+ end
50
+ end
48
51
 
49
- g.desc 'Share a me message into a channel.'
50
- g.long_desc %( Share a me message into a channel. )
51
- g.command 'meMessage' do |c|
52
- c.flag 'channel', desc: 'Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.'
53
- c.flag 'text', desc: 'Text of the message to send.'
54
- c.action do |_global_options, options, _args|
55
- puts JSON.dump($client.chat_meMessage(options))
56
- end
57
- end
52
+ g.desc 'Share a me message into a channel.'
53
+ g.long_desc %( Share a me message into a channel. )
54
+ g.command 'meMessage' do |c|
55
+ c.flag 'channel', desc: 'Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.'
56
+ c.flag 'text', desc: 'Text of the message to send.'
57
+ c.action do |_global_options, options, _args|
58
+ puts JSON.dump(@client.chat_meMessage(options))
59
+ end
60
+ end
58
61
 
59
- g.desc 'Sends an ephemeral message to a user in a channel.'
60
- g.long_desc %( Sends an ephemeral message to a user in a channel. )
61
- g.command 'postEphemeral' do |c|
62
- c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
63
- c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
64
- c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
65
- c.flag 'as_user', desc: 'Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
66
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
67
- c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
68
- c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
69
- c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
70
- c.flag 'link_names', desc: 'Find and link channel names and usernames.'
71
- c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
72
- c.flag 'thread_ts', desc: "Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread."
73
- c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
74
- c.action do |_global_options, options, _args|
75
- puts JSON.dump($client.chat_postEphemeral(options))
76
- end
77
- end
62
+ g.desc 'Sends an ephemeral message to a user in a channel.'
63
+ g.long_desc %( Sends an ephemeral message to a user in a channel. )
64
+ g.command 'postEphemeral' do |c|
65
+ c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
66
+ c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
67
+ c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
68
+ c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
69
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
70
+ c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
71
+ c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
72
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
73
+ c.flag 'link_names', desc: 'Find and link channel names and usernames.'
74
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
75
+ c.flag 'thread_ts', desc: "Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread."
76
+ c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
77
+ c.action do |_global_options, options, _args|
78
+ puts JSON.dump(@client.chat_postEphemeral(options))
79
+ end
80
+ end
78
81
 
79
- g.desc 'Sends a message to a channel.'
80
- g.long_desc %( Sends a message to a channel. )
81
- g.command 'postMessage' do |c|
82
- c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
83
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
84
- c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
85
- c.flag 'text', desc: 'The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.'
86
- c.flag 'as_user', desc: 'Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See authorship below.'
87
- c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
88
- c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
89
- c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
90
- c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
91
- c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
92
- c.flag 'parse', desc: 'Change how messages are treated. See below.'
93
- c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
94
- c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
95
- c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
96
- c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
97
- c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
98
- c.action do |_global_options, options, _args|
99
- puts JSON.dump($client.chat_postMessage(options))
100
- end
101
- end
82
+ g.desc 'Sends a message to a channel.'
83
+ g.long_desc %( Sends a message to a channel. )
84
+ g.command 'postMessage' do |c|
85
+ c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
86
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
87
+ c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
88
+ c.flag 'text', desc: 'The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.'
89
+ c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic Slack apps. See authorship below.'
90
+ c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
91
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
92
+ c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
93
+ c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
94
+ c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
95
+ c.flag 'parse', desc: 'Change how messages are treated. See below.'
96
+ c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
97
+ c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
98
+ c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
99
+ c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
100
+ c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
101
+ c.action do |_global_options, options, _args|
102
+ puts JSON.dump(@client.chat_postMessage(options))
103
+ end
104
+ end
102
105
 
103
- g.desc 'Schedules a message to be sent to a channel.'
104
- g.long_desc %( Schedules a message to be sent to a channel. )
105
- g.command 'scheduleMessage' do |c|
106
- c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
107
- c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
108
- c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
109
- c.flag 'as_user', desc: 'Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.'
110
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
111
- c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
112
- c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
113
- c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
114
- c.flag 'parse', desc: 'Change how messages are treated. See chat.postMessage.'
115
- c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
116
- c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
117
- c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
118
- c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
119
- c.action do |_global_options, options, _args|
120
- puts JSON.dump($client.chat_scheduleMessage(options))
121
- end
122
- end
106
+ g.desc 'Schedules a message to be sent to a channel.'
107
+ g.long_desc %( Schedules a message to be sent to a channel. )
108
+ g.command 'scheduleMessage' do |c|
109
+ c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
110
+ c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
111
+ c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
112
+ c.flag 'as_user', desc: 'Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.'
113
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
114
+ c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
115
+ c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
116
+ c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
117
+ c.flag 'parse', desc: 'Change how messages are treated. See chat.postMessage.'
118
+ c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
119
+ c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
120
+ c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
121
+ c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
122
+ c.action do |_global_options, options, _args|
123
+ puts JSON.dump(@client.chat_scheduleMessage(options))
124
+ end
125
+ end
123
126
 
124
- g.desc 'Provide custom unfurl behavior for user-posted URLs'
125
- g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
126
- g.command 'unfurl' do |c|
127
- c.flag 'channel', desc: 'Channel ID of the message. Both channel and ts must be provided together, or unfurl_id and source must be provided together.'
128
- c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
129
- c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.'
130
- c.flag 'source', desc: 'The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.'
131
- c.flag 'unfurl_id', desc: 'The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.'
132
- c.flag 'user_auth_blocks', desc: 'Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
133
- c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.'
134
- c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
135
- c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
136
- c.action do |_global_options, options, _args|
137
- puts JSON.dump($client.chat_unfurl(options))
138
- end
139
- end
127
+ g.desc 'Provide custom unfurl behavior for user-posted URLs'
128
+ g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
129
+ g.command 'unfurl' do |c|
130
+ c.flag 'channel', desc: 'Channel ID of the message. Both channel and ts must be provided together, or unfurl_id and source must be provided together.'
131
+ c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
132
+ c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.'
133
+ c.flag 'source', desc: 'The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.'
134
+ c.flag 'unfurl_id', desc: 'The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.'
135
+ c.flag 'user_auth_blocks', desc: 'Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
136
+ c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.'
137
+ c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
138
+ c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
139
+ c.action do |_global_options, options, _args|
140
+ puts JSON.dump(@client.chat_unfurl(options))
141
+ end
142
+ end
140
143
 
141
- g.desc 'Updates a message.'
142
- g.long_desc %( Updates a message. )
143
- g.command 'update' do |c|
144
- c.flag 'channel', desc: 'Channel containing the message to be updated.'
145
- c.flag 'ts', desc: 'Timestamp of the message to be updated.'
146
- c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
147
- c.flag 'attachments', desc: "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field."
148
- c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field."
149
- c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.'
150
- c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.'
151
- c.flag 'metadata', desc: "JSON object with event_type and event_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previous metadata will be retained. To remove previous metadata, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace."
152
- c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.'
153
- c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.'
154
- c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
155
- c.action do |_global_options, options, _args|
156
- puts JSON.dump($client.chat_update(options))
144
+ g.desc 'Updates a message.'
145
+ g.long_desc %( Updates a message. )
146
+ g.command 'update' do |c|
147
+ c.flag 'channel', desc: 'Channel containing the message to be updated.'
148
+ c.flag 'ts', desc: 'Timestamp of the message to be updated.'
149
+ c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
150
+ c.flag 'attachments', desc: "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field."
151
+ c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field."
152
+ c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.'
153
+ c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.'
154
+ c.flag 'metadata', desc: "JSON object with event_type and event_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previous metadata will be retained. To remove previous metadata, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace."
155
+ c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.'
156
+ c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.'
157
+ c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
158
+ c.action do |_global_options, options, _args|
159
+ puts JSON.dump(@client.chat_update(options))
160
+ end
161
+ end
162
+ end
157
163
  end
158
164
  end
159
165
  end
@@ -1,19 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'ChatScheduledmessages methods.'
5
- command 'chat_scheduledMessages' do |g|
6
- g.desc 'Returns a list of scheduled messages.'
7
- g.long_desc %( Returns a list of scheduled messages. )
8
- g.command 'list' do |c|
9
- c.flag 'channel', desc: 'The channel of the scheduled messages.'
10
- c.flag 'cursor', desc: 'For pagination purposes, this is the cursor value returned from a previous call to chat.scheduledmessages.list indicating where you want to start this call from.'
11
- c.flag 'latest', desc: 'A UNIX timestamp of the latest value in the time range.'
12
- c.flag 'limit', desc: 'Maximum number of original entries to return.'
13
- c.flag 'oldest', desc: 'A UNIX timestamp of the oldest value in the time range.'
14
- c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
15
- c.action do |_global_options, options, _args|
16
- puts JSON.dump($client.chat_scheduledMessages_list(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'ChatScheduledmessages methods.'
8
+ command 'chat_scheduledMessages' do |g|
9
+ g.desc 'Returns a list of scheduled messages.'
10
+ g.long_desc %( Returns a list of scheduled messages. )
11
+ g.command 'list' do |c|
12
+ c.flag 'channel', desc: 'The channel of the scheduled messages.'
13
+ c.flag 'cursor', desc: 'For pagination purposes, this is the cursor value returned from a previous call to chat.scheduledmessages.list indicating where you want to start this call from.'
14
+ c.flag 'latest', desc: 'A UNIX timestamp of the latest value in the time range.'
15
+ c.flag 'limit', desc: 'Maximum number of original entries to return.'
16
+ c.flag 'oldest', desc: 'A UNIX timestamp of the oldest value in the time range.'
17
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump(@client.chat_scheduledMessages_list(options))
20
+ end
21
+ end
22
+ end
17
23
  end
18
24
  end
19
25
  end