diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 989f072a..467672f5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -136,6 +136,7 @@ RSpec/FilePath: - 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb' - 'spec/slack/web/api/endpoints/custom_specs/groups_spec.rb' - 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb' + - 'spec/slack/web/api/endpoints/custom_specs/views_spec.rb' - 'spec/slack/web/api/errors/service_unavailable_spec.rb' # Offense count: 13 diff --git a/CHANGELOG.md b/CHANGELOG.md index 65a909f1..6dd9e6be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ * [#293](https://github.com/slack-ruby/slack-ruby-client/pull/293): Rubocop auto-correct and comprehensive todo - [@jcraigk](https://github.com/jcraigk). * [#297](https://github.com/slack-ruby/slack-ruby-client/pull/297): Various Rubocop fixes - [@jcraigk](https://github.com/jcraigk). - +* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Add `admin.apps`, `admin.app.requests` and `views` endpoints - [@jmanian](https://github.com/jmanian). * Your contribution here. ### 0.14.4 (2019/7/28) diff --git a/bin/commands.rb b/bin/commands.rb index d29b9df3..be1a8fa0 100644 --- a/bin/commands.rb +++ b/bin/commands.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake +require 'commands/admin_apps' +require 'commands/admin_apps_requests' require 'commands/admin_users_session' require 'commands/api' require 'commands/apps' @@ -39,3 +41,4 @@ require 'commands/users_admin' require 'commands/users_prefs' require 'commands/users_profile' +require 'commands/views' diff --git a/bin/commands/admin_apps.rb b/bin/commands/admin_apps.rb new file mode 100644 index 00000000..7bf16ab2 --- /dev/null +++ b/bin/commands/admin_apps.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'AdminApps methods.' +command 'admin_apps' do |g| + g.desc 'Approve an app for installation on a workspace.' + g.long_desc %( Approve an app for installation on a workspace. ) + g.command 'approve' do |c| + c.flag 'app_id', desc: 'The id of the app to approve.' + c.flag 'request_id', desc: 'The id of the request to approve.' + c.flag 'team_id', desc: '.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_apps_approve(options)) + end + end + + g.desc 'Restrict an app for installation on a workspace.' + g.long_desc %( Restrict an app for installation on a workspace. ) + g.command 'restrict' do |c| + c.flag 'app_id', desc: 'The id of the app to restrict.' + c.flag 'request_id', desc: 'The id of the request to restrict.' + c.flag 'team_id', desc: '.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_apps_restrict(options)) + end + end +end diff --git a/bin/commands/admin_apps_requests.rb b/bin/commands/admin_apps_requests.rb new file mode 100644 index 00000000..d02f299e --- /dev/null +++ b/bin/commands/admin_apps_requests.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'AdminAppsRequests methods.' +command 'admin_apps_requests' do |g| + g.desc 'List app requests for a team/workspace.' + g.long_desc %( List app requests for a team/workspace. ) + g.command 'list' do |c| + c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' + c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.' + c.flag 'team_id', desc: '.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_apps_requests_list(options)) + end + end +end diff --git a/bin/commands/admin_users_session.rb b/bin/commands/admin_users_session.rb index 7ed99933..a03302fd 100644 --- a/bin/commands/admin_users_session.rb +++ b/bin/commands/admin_users_session.rb @@ -3,8 +3,8 @@ desc 'AdminUsersSession methods.' command 'admin_users_session' do |g| - g.desc "This method wipes a user session, leaving the user unauthenticated. The user's Slack client will reset its local cache." - g.long_desc %( This method wipes a user session, leaving the user unauthenticated. The user's Slack client will reset its local cache. ) + g.desc 'Wipes all valid sessions on all devices for a given user' + g.long_desc %( Wipes all valid sessions on all devices for a given user ) g.command 'reset' do |c| c.flag 'user_id', desc: 'The ID of the user to wipe sessions for.' c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).' diff --git a/bin/commands/api.rb b/bin/commands/api.rb index 1a211e7b..9b66ffeb 100644 --- a/bin/commands/api.rb +++ b/bin/commands/api.rb @@ -3,8 +3,8 @@ desc 'Api methods.' command 'api' do |g| - g.desc 'This method helps you test your calling code.' - g.long_desc %( This method helps you test your calling code. ) + g.desc 'Checks API calling code.' + g.long_desc %( Checks API calling code. ) g.command 'test' do |c| c.flag 'error', desc: 'Error response to return.' c.flag 'foo', desc: 'example property to return.' diff --git a/bin/commands/apps.rb b/bin/commands/apps.rb index 1fed0493..64058159 100644 --- a/bin/commands/apps.rb +++ b/bin/commands/apps.rb @@ -3,8 +3,8 @@ desc 'Apps methods.' command 'apps' do |g| - g.desc 'This method uninstalls an app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of an app.' - g.long_desc %( This method uninstalls an app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of an app. ) + g.desc 'Uninstalls your app from a workspace.' + g.long_desc %( Uninstalls your app from a workspace. ) g.command 'uninstall' do |c| c.flag 'client_id', desc: 'Issued when you created your application.' c.flag 'client_secret', desc: 'Issued when you created your application.' diff --git a/bin/commands/apps_permissions.rb b/bin/commands/apps_permissions.rb index 6bd53b89..b8c6aeea 100644 --- a/bin/commands/apps_permissions.rb +++ b/bin/commands/apps_permissions.rb @@ -3,16 +3,16 @@ desc 'AppsPermissions methods.' command 'apps_permissions' do |g| - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Returns list of permissions this app has on a team.' + g.long_desc %( Returns list of permissions this app has on a team. ) g.command 'info' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.apps_permissions_info(options)) end end - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Allows an app to request additional scopes' + g.long_desc %( Allows an app to request additional scopes ) g.command 'request' do |c| c.flag 'scopes', desc: 'A comma separated list of scopes to request for.' c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.' diff --git a/bin/commands/apps_permissions_resources.rb b/bin/commands/apps_permissions_resources.rb index 4424af38..fa00c219 100644 --- a/bin/commands/apps_permissions_resources.rb +++ b/bin/commands/apps_permissions_resources.rb @@ -3,8 +3,8 @@ desc 'AppsPermissionsResources methods.' command 'apps_permissions_resources' do |g| - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Returns list of resource grants this app has on a team.' + g.long_desc %( Returns list of resource grants this app has on a team. ) g.command 'list' do |c| 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." c.flag 'limit', desc: 'The maximum number of items to return.' diff --git a/bin/commands/apps_permissions_scopes.rb b/bin/commands/apps_permissions_scopes.rb index 30ac276d..68326a2e 100644 --- a/bin/commands/apps_permissions_scopes.rb +++ b/bin/commands/apps_permissions_scopes.rb @@ -3,8 +3,8 @@ desc 'AppsPermissionsScopes methods.' command 'apps_permissions_scopes' do |g| - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Returns list of scopes this app has on a team.' + g.long_desc %( Returns list of scopes this app has on a team. ) g.command 'list' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.apps_permissions_scopes_list(options)) diff --git a/bin/commands/apps_permissions_users.rb b/bin/commands/apps_permissions_users.rb index 8fd065b0..5302fb6f 100644 --- a/bin/commands/apps_permissions_users.rb +++ b/bin/commands/apps_permissions_users.rb @@ -3,8 +3,8 @@ desc 'AppsPermissionsUsers methods.' command 'apps_permissions_users' do |g| - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Returns list of user grants and corresponding scopes this app has on a team.' + g.long_desc %( Returns list of user grants and corresponding scopes this app has on a team. ) g.command 'list' do |c| 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." c.flag 'limit', desc: 'The maximum number of items to return.' @@ -13,8 +13,8 @@ end end - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Enables an app to trigger a permissions modal to grant an app access to a user access scope.' + g.long_desc %( Enables an app to trigger a permissions modal to grant an app access to a user access scope. ) g.command 'request' do |c| c.flag 'scopes', desc: 'A comma separated list of user scopes to request for.' c.flag 'trigger_id', desc: 'Token used to trigger the request.' diff --git a/bin/commands/auth.rb b/bin/commands/auth.rb index 17c067f3..1e93804d 100644 --- a/bin/commands/auth.rb +++ b/bin/commands/auth.rb @@ -3,8 +3,8 @@ desc 'Auth methods.' command 'auth' do |g| - g.desc 'This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out.' - g.long_desc %( This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out. ) + g.desc 'Revokes a token.' + g.long_desc %( Revokes a token. ) g.command 'revoke' do |c| c.flag 'test', desc: 'Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This method checks authentication and tells "you" who you are, even if you might be a bot.' - g.long_desc %( This method checks authentication and tells "you" who you are, even if you might be a bot. ) + g.desc 'Checks authentication & identity.' + g.long_desc %( Checks authentication & identity. ) g.command 'test' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.auth_test(options)) diff --git a/bin/commands/bots.rb b/bin/commands/bots.rb index 394e95a9..165579df 100644 --- a/bin/commands/bots.rb +++ b/bin/commands/bots.rb @@ -3,8 +3,8 @@ desc 'Bots methods.' command 'bots' do |g| - g.desc 'This method returns extended information about a bot user.' - g.long_desc %( This method returns extended information about a bot user. ) + g.desc 'Gets information about a bot user.' + g.long_desc %( Gets information about a bot user. ) g.command 'info' do |c| c.flag 'bot', desc: 'Bot user to get info on.' c.action do |_global_options, options, _args| diff --git a/bin/commands/channels.rb b/bin/commands/channels.rb index f66db23b..3c202434 100644 --- a/bin/commands/channels.rb +++ b/bin/commands/channels.rb @@ -3,8 +3,8 @@ desc 'Channels methods.' command 'channels' do |g| - g.desc 'This method archives a channel.' - g.long_desc %( This method archives a channel. ) + g.desc 'Archives a channel.' + g.long_desc %( Archives a channel. ) g.command 'archive' do |c| c.flag 'channel', desc: 'Channel to archive.' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This method is used to create a channel.' - g.long_desc %( This method is used to create a channel. ) + g.desc 'Creates a channel.' + g.long_desc %( Creates a channel. ) g.command 'create' do |c| c.flag 'name', desc: 'Name of channel to create.' c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.' @@ -31,8 +31,8 @@ end end - g.desc 'This method returns a portion of message events from the specified public channel.' - g.long_desc %( This method returns a portion of message events from the specified public channel. ) + g.desc 'Fetches history of messages and events from a channel.' + g.long_desc %( Fetches history of messages and events from a channel. ) g.command 'history' do |c| c.flag 'channel', desc: 'Channel to fetch history for.' c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.' @@ -53,8 +53,8 @@ end end - g.desc 'This method returns information about a team channel.' - g.long_desc %( This method returns information about a team channel. ) + g.desc 'Gets information about a channel.' + g.long_desc %( Gets information about a channel. ) g.command 'info' do |c| c.flag 'channel', desc: 'Channel to get info on.' c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.' @@ -63,8 +63,8 @@ end end - g.desc 'This method is used to invite a user to a channel. The calling user must be a member of the channel.' - g.long_desc %( This method is used to invite a user to a channel. The calling user must be a member of the channel. ) + g.desc 'Invites a user to a channel.' + g.long_desc %( Invites a user to a channel. ) g.command 'invite' do |c| c.flag 'channel', desc: 'Channel to invite user to.' c.flag 'user', desc: 'User to invite to channel.' @@ -73,8 +73,8 @@ end end - g.desc 'This method is used to join a channel. If the channel does not exist, it is' - g.long_desc %( This method is used to join a channel. If the channel does not exist, it is created. ) + g.desc 'Joins a channel, creating it if needed.' + g.long_desc %( Joins a channel, creating it if needed. ) g.command 'join' do |c| c.flag 'name', desc: 'Name of channel to join.' c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.' @@ -83,8 +83,8 @@ end end - g.desc 'This method allows a user to remove another member from a team channel.' - g.long_desc %( This method allows a user to remove another member from a team channel. ) + g.desc 'Removes a user from a channel.' + g.long_desc %( Removes a user from a channel. ) g.command 'kick' do |c| c.flag 'channel', desc: 'Channel to remove user from.' c.flag 'user', desc: 'User to remove from channel.' @@ -93,8 +93,8 @@ end end - g.desc 'This method is used to leave a channel.' - g.long_desc %( This method is used to leave a channel. ) + g.desc 'Leaves a channel.' + g.long_desc %( Leaves a channel. ) g.command 'leave' do |c| c.flag 'channel', desc: 'Channel to leave.' c.action do |_global_options, options, _args| @@ -102,8 +102,8 @@ end end - g.desc "Don't use this method. Use conversations.list instead." - g.long_desc %( Don't use this method. Use conversations.list instead. ) + g.desc 'Lists all channels in a Slack team.' + g.long_desc %( Lists all channels in a Slack team. ) g.command 'list' do |c| 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." c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.' @@ -114,8 +114,8 @@ end end - g.desc 'This method moves the read cursor in a channel.' - g.long_desc %( This method moves the read cursor in a channel. ) + g.desc 'Sets the read cursor in a channel.' + g.long_desc %( Sets the read cursor in a channel. ) g.command 'mark' do |c| c.flag 'channel', desc: 'Channel to set reading cursor in.' c.flag 'ts', desc: 'Timestamp of the most recently seen message.' @@ -124,8 +124,8 @@ end end - g.desc 'This method renames a team channel.' - g.long_desc %( This method renames a team channel. ) + g.desc 'Renames a channel.' + g.long_desc %( Renames a channel. ) g.command 'rename' do |c| c.flag 'channel', desc: 'Channel to rename.' c.flag 'name', desc: 'New name for channel.' @@ -135,8 +135,8 @@ end end - g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).' - g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). ) + g.desc 'Retrieve a thread of messages posted to a channel' + g.long_desc %( Retrieve a thread of messages posted to a channel ) g.command 'replies' do |c| c.flag 'channel', desc: 'Channel to fetch thread from.' c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message." @@ -145,8 +145,8 @@ end end - g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.' - g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. ) + g.desc 'Sets the purpose for a channel.' + g.long_desc %( Sets the purpose for a channel. ) g.command 'setPurpose' do |c| c.flag 'channel', desc: 'Channel to set the purpose of.' c.flag 'purpose', desc: 'The new purpose.' @@ -156,8 +156,8 @@ end end - g.desc 'This method is used to change the topic of a channel. The calling user must be a member of the channel.' - g.long_desc %( This method is used to change the topic of a channel. The calling user must be a member of the channel. ) + g.desc 'Sets the topic for a channel.' + g.long_desc %( Sets the topic for a channel. ) g.command 'setTopic' do |c| c.flag 'channel', desc: 'Channel to set the topic of.' c.flag 'topic', desc: 'The new topic.' @@ -166,8 +166,8 @@ end end - g.desc 'This method unarchives a channel. The calling user is added to the channel.' - g.long_desc %( This method unarchives a channel. The calling user is added to the channel. ) + g.desc 'Unarchives a channel.' + g.long_desc %( Unarchives a channel. ) g.command 'unarchive' do |c| c.flag 'channel', desc: 'Channel to unarchive.' c.action do |_global_options, options, _args| diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index b58b966a..69900148 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -14,8 +14,8 @@ end end - g.desc 'This method deletes a message from a channel.' - g.long_desc %( This method deletes a message from a channel. ) + g.desc 'Deletes a message.' + g.long_desc %( Deletes a message. ) g.command 'delete' do |c| c.flag 'channel', desc: 'Channel containing the message to be deleted.' c.flag 'ts', desc: 'Timestamp of the message to be deleted.' @@ -25,8 +25,8 @@ end end - g.desc 'This method deletes a pending scheduled message before it is sent.' - g.long_desc %( This method deletes a pending scheduled message before it is sent. ) + g.desc 'Deletes a pending scheduled message from the queue.' + g.long_desc %( Deletes a pending scheduled message from the queue. ) g.command 'deleteScheduledMessage' do |c| c.flag 'channel', desc: 'The channel the scheduled_message is posting to.' c.flag 'scheduled_message_id', desc: 'scheduled_message_id returned from call to chat.scheduleMessage.' @@ -36,8 +36,8 @@ end end - g.desc 'Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types.' - g.long_desc %( Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types. ) + g.desc 'Retrieve a permalink URL for a specific extant message' + g.long_desc %( Retrieve a permalink URL for a specific extant message ) g.command 'getPermalink' do |c| c.flag 'channel', desc: 'The ID of the conversation or channel containing the message.' c.flag 'message_ts', desc: "A message's ts value, uniquely identifying it within a channel." @@ -46,8 +46,8 @@ end end - g.desc 'This method sends a me message to a channel from the calling user.' - g.long_desc %( This method sends a me message to a channel from the calling user. ) + g.desc 'Share a me message into a channel.' + g.long_desc %( Share a me message into a channel. ) g.command 'meMessage' do |c| 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.' c.flag 'text', desc: 'Text of the message to send.' @@ -56,8 +56,8 @@ end end - g.desc 'This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation.' - g.long_desc %( This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation. ) + g.desc 'Sends an ephemeral message to a user in a channel.' + g.long_desc %( Sends an ephemeral message to a user in a channel. ) g.command 'postEphemeral' do |c| c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.' c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.' @@ -76,8 +76,8 @@ end end - g.desc 'This method posts a message to a public channel, private channel, or direct message/IM channel.' - g.long_desc %( This method posts a message to a public channel, private channel, or direct message/IM channel. ) + g.desc 'Sends a message to a channel.' + g.long_desc %( Sends a message to a channel. ) g.command 'postMessage' do |c| 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.' c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation." @@ -99,8 +99,8 @@ end end - g.desc 'This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future.' - g.long_desc %( This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future. ) + g.desc 'Schedules a message to be sent to a channel.' + g.long_desc %( Schedules a message to be sent to a channel. ) g.command 'scheduleMessage' do |c| 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.' c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.' @@ -119,8 +119,8 @@ end end - g.desc 'This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens.' - g.long_desc %( This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens. ) + g.desc 'Provide custom unfurl behavior for user-posted URLs' + g.long_desc %( Provide custom unfurl behavior for user-posted URLs ) g.command 'unfurl' do |c| c.flag 'channel', desc: 'Channel ID of the message.' c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.' @@ -133,8 +133,8 @@ end end - g.desc 'This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.' - g.long_desc %( This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently. ) + g.desc 'Updates a message.' + g.long_desc %( Updates a message. ) g.command 'update' do |c| c.flag 'channel', desc: 'Channel containing the message to be updated.' c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting attachments." diff --git a/bin/commands/chat_scheduledMessages.rb b/bin/commands/chat_scheduledMessages.rb index da2dec62..30a25d81 100644 --- a/bin/commands/chat_scheduledMessages.rb +++ b/bin/commands/chat_scheduledMessages.rb @@ -3,8 +3,8 @@ desc 'ChatScheduledmessages methods.' command 'chat_scheduledMessages' do |g| - g.desc 'This method returns a list of pending scheduled messages.' - g.long_desc %( This method returns a list of pending scheduled messages. ) + g.desc 'Returns a list of scheduled messages.' + g.long_desc %( Returns a list of scheduled messages. ) g.command 'list' do |c| c.flag 'channel', desc: 'The channel of the scheduled messages.' 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.' diff --git a/bin/commands/conversations.rb b/bin/commands/conversations.rb index 21a99c5e..6e6f9fd4 100644 --- a/bin/commands/conversations.rb +++ b/bin/commands/conversations.rb @@ -3,8 +3,8 @@ desc 'Conversations methods.' command 'conversations' do |g| - g.desc 'This method archives a conversation. Not all types of conversations can be archived.' - g.long_desc %( This method archives a conversation. Not all types of conversations can be archived. ) + g.desc 'Archives a conversation.' + g.long_desc %( Archives a conversation. ) g.command 'archive' do |c| c.flag 'channel', desc: 'ID of conversation to archive.' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This Conversations API method closes direct messages, multi-person or 1:1 or otherwise.' - g.long_desc %( This Conversations API method closes direct messages, multi-person or 1:1 or otherwise. ) + g.desc 'Closes a direct message or multi-person direct message.' + g.long_desc %( Closes a direct message or multi-person direct message. ) g.command 'close' do |c| c.flag 'channel', desc: 'Conversation to close.' c.action do |_global_options, options, _args| @@ -21,8 +21,8 @@ end end - g.desc 'Create a public or private channel using this Conversations API method.' - g.long_desc %( Create a public or private channel using this Conversations API method. ) + g.desc 'Initiates a public or private channel-based conversation' + g.long_desc %( Initiates a public or private channel-based conversation ) g.command 'create' do |c| c.flag 'name', desc: 'Name of the public or private channel to create.' c.flag 'is_private', desc: 'Create a private channel instead of a public one.' @@ -32,8 +32,8 @@ end end - g.desc 'This method returns a portion of message events from the specified conversation.' - g.long_desc %( This method returns a portion of message events from the specified conversation. ) + g.desc "Fetches a conversation's history of messages and events." + g.long_desc %( Fetches a conversation's history of messages and events. ) g.command 'history' do |c| c.flag 'channel', desc: 'Conversation ID to fetch history for.' 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." @@ -46,8 +46,8 @@ end end - g.desc 'This Conversations API method returns information about a workspace conversation.' - g.long_desc %( This Conversations API method returns information about a workspace conversation. ) + g.desc 'Retrieve information about a conversation.' + g.long_desc %( Retrieve information about a conversation. ) g.command 'info' do |c| c.flag 'channel', desc: 'Conversation ID to learn more about.' c.flag 'include_locale', desc: 'Set this to true to receive the locale for this conversation. Defaults to false.' @@ -57,8 +57,8 @@ end end - g.desc 'This Conversations API method invites 1-30 users to a public or private channel. The calling user must be a member of the channel.' - g.long_desc %( This Conversations API method invites 1-30 users to a public or private channel. The calling user must be a member of the channel. ) + g.desc 'Invites users to a channel.' + g.long_desc %( Invites users to a channel. ) g.command 'invite' do |c| c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.' c.flag 'users', desc: 'A comma separated list of user IDs. Up to 30 users may be listed.' @@ -67,8 +67,8 @@ end end - g.desc 'This Conversations API method joins a user to an existing conversation.' - g.long_desc %( This Conversations API method joins a user to an existing conversation. ) + g.desc 'Joins an existing conversation.' + g.long_desc %( Joins an existing conversation. ) g.command 'join' do |c| c.flag 'channel', desc: 'ID of conversation to join.' c.action do |_global_options, options, _args| @@ -76,8 +76,8 @@ end end - g.desc 'This Conversations API method allows a user to remove another member from a channel.' - g.long_desc %( This Conversations API method allows a user to remove another member from a channel. ) + g.desc 'Removes a user from a conversation.' + g.long_desc %( Removes a user from a conversation. ) g.command 'kick' do |c| c.flag 'channel', desc: 'ID of conversation to remove user from.' c.flag 'user', desc: 'User ID to be removed.' @@ -86,8 +86,8 @@ end end - g.desc 'This Conversations API method makes like a tree and leaves a conversation.' - g.long_desc %( This Conversations API method makes like a tree and leaves a conversation. ) + g.desc 'Leaves a conversation.' + g.long_desc %( Leaves a conversation. ) g.command 'leave' do |c| c.flag 'channel', desc: 'Conversation to leave.' c.action do |_global_options, options, _args| @@ -95,8 +95,8 @@ end end - g.desc 'This Conversations API method returns a list of all channel-like conversations in a workspace. The "channels" returned depend on what the calling token has access to and the directives placed in the types parameter.' - g.long_desc %( This Conversations API method returns a list of all channel-like conversations in a workspace. The "channels" returned depend on what the calling token has access to and the directives placed in the types parameter. ) + g.desc 'Lists all channels in a Slack team.' + g.long_desc %( Lists all channels in a Slack team. ) g.command 'list' do |c| 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." c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.' @@ -107,8 +107,8 @@ end end - g.desc 'This Conversations API method returns a paginated list of members party to a conversation.' - g.long_desc %( This Conversations API method returns a paginated list of members party to a conversation. ) + g.desc 'Retrieve members of a conversation.' + g.long_desc %( Retrieve members of a conversation. ) g.command 'members' do |c| c.flag 'channel', desc: 'ID of the conversation to retrieve members for.' 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." @@ -118,8 +118,8 @@ end end - g.desc 'This Conversations API method opens a multi-person direct message or just a 1:1 direct message.' - g.long_desc %( This Conversations API method opens a multi-person direct message or just a 1:1 direct message. ) + g.desc 'Opens or resumes a direct message or multi-person direct message.' + g.long_desc %( Opens or resumes a direct message or multi-person direct message. ) g.command 'open' do |c| c.flag 'channel', desc: "Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead." c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.' @@ -129,8 +129,8 @@ end end - g.desc 'This method renames a conversation. Some types of conversations cannot be renamed.' - g.long_desc %( This method renames a conversation. Some types of conversations cannot be renamed. ) + g.desc 'Renames a conversation.' + g.long_desc %( Renames a conversation. ) g.command 'rename' do |c| c.flag 'channel', desc: 'ID of conversation to rename.' c.flag 'name', desc: 'New name for conversation.' @@ -139,8 +139,8 @@ end end - g.desc 'This Conversations API method returns an entire thread (a message plus all the messages in reply to it), while conversations.history method returns only parent messages.' - g.long_desc %( This Conversations API method returns an entire thread (a message plus all the messages in reply to it), while conversations.history method returns only parent messages. ) + g.desc 'Retrieve a thread of messages posted to a conversation' + g.long_desc %( Retrieve a thread of messages posted to a conversation ) g.command 'replies' do |c| c.flag 'channel', desc: 'Conversation ID to fetch thread from.' c.flag 'ts', desc: "Unique identifier of a thread's parent message." @@ -154,8 +154,8 @@ end end - g.desc 'This method is used to change the purpose of a conversation. The calling user must be a member of the conversation. Not all conversation types may have a purpose set.' - g.long_desc %( This method is used to change the purpose of a conversation. The calling user must be a member of the conversation. Not all conversation types may have a purpose set. ) + g.desc 'Sets the purpose for a conversation.' + g.long_desc %( Sets the purpose for a conversation. ) g.command 'setPurpose' do |c| c.flag 'channel', desc: 'Conversation to set the purpose of.' c.flag 'purpose', desc: 'A new, specialer purpose.' @@ -164,8 +164,8 @@ end end - g.desc 'This method is used to change the topic of a conversation. The calling user must be a member of the conversation. Not all conversation types support a new topic.' - g.long_desc %( This method is used to change the topic of a conversation. The calling user must be a member of the conversation. Not all conversation types support a new topic. ) + g.desc 'Sets the topic for a conversation.' + g.long_desc %( Sets the topic for a conversation. ) g.command 'setTopic' do |c| c.flag 'channel', desc: 'Conversation to set the topic of.' c.flag 'topic', desc: 'The new topic string. Does not support formatting or linkification.' @@ -174,8 +174,8 @@ end end - g.desc 'This method unarchives a conversation. The calling user is added to the conversation.' - g.long_desc %( This method unarchives a conversation. The calling user is added to the conversation. ) + g.desc 'Reverses conversation archival.' + g.long_desc %( Reverses conversation archival. ) g.command 'unarchive' do |c| c.flag 'channel', desc: 'ID of conversation to unarchive.' c.action do |_global_options, options, _args| diff --git a/bin/commands/dialog.rb b/bin/commands/dialog.rb index 1ca7c46f..699f6479 100644 --- a/bin/commands/dialog.rb +++ b/bin/commands/dialog.rb @@ -3,8 +3,8 @@ desc 'Dialog methods.' command 'dialog' do |g| - g.desc 'Open a dialog with a user by exchanging a trigger_id received from another interaction. See the dialogs documentation to learn how to obtain triggers define form elements.' - g.long_desc %( Open a dialog with a user by exchanging a trigger_id received from another interaction. See the dialogs documentation to learn how to obtain triggers define form elements. ) + g.desc 'Open a dialog with a user' + g.long_desc %( Open a dialog with a user ) g.command 'open' do |c| c.flag 'dialog', desc: 'The dialog definition. This must be a JSON-encoded string.' c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.' diff --git a/bin/commands/dnd.rb b/bin/commands/dnd.rb index 324ffe76..6dae132b 100644 --- a/bin/commands/dnd.rb +++ b/bin/commands/dnd.rb @@ -3,8 +3,8 @@ desc 'Dnd methods.' command 'dnd' do |g| - g.desc "Ends the user's currently scheduled Do Not Disturb session immediately." - g.long_desc %( Ends the user's currently scheduled Do Not Disturb session immediately. ) + g.desc "Ends the current user's Do Not Disturb session immediately." + g.long_desc %( Ends the current user's Do Not Disturb session immediately. ) g.command 'endDnd' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.dnd_endDnd(options)) @@ -19,8 +19,8 @@ end end - g.desc "Provides information about a user's current Do Not Disturb settings." - g.long_desc %( Provides information about a user's current Do Not Disturb settings. ) + g.desc "Retrieves a user's current Do Not Disturb status." + g.long_desc %( Retrieves a user's current Do Not Disturb status. ) g.command 'info' do |c| c.flag 'user', desc: 'User to fetch status for (defaults to current user).' c.action do |_global_options, options, _args| @@ -28,8 +28,8 @@ end end - g.desc "Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration." - g.long_desc %( Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration. ) + g.desc 'Turns on Do Not Disturb mode for the current user, or changes its duration.' + g.long_desc %( Turns on Do Not Disturb mode for the current user, or changes its duration. ) g.command 'setSnooze' do |c| c.flag 'num_minutes', desc: 'Number of minutes, from now, to snooze until.' c.action do |_global_options, options, _args| @@ -37,8 +37,8 @@ end end - g.desc 'Provides information about the current Do Not Disturb settings for a list of users in a Slack team.' - g.long_desc %( Provides information about the current Do Not Disturb settings for a list of users in a Slack team. ) + g.desc 'Retrieves the Do Not Disturb status for up to 50 users on a team.' + g.long_desc %( Retrieves the Do Not Disturb status for up to 50 users on a team. ) g.command 'teamInfo' do |c| c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.' c.action do |_global_options, options, _args| diff --git a/bin/commands/emoji.rb b/bin/commands/emoji.rb index 1d2c729d..2cb96706 100644 --- a/bin/commands/emoji.rb +++ b/bin/commands/emoji.rb @@ -3,8 +3,8 @@ desc 'Emoji methods.' command 'emoji' do |g| - g.desc 'This method lists the custom emoji for a team.' - g.long_desc %( This method lists the custom emoji for a team. ) + g.desc 'Lists custom emoji for a team.' + g.long_desc %( Lists custom emoji for a team. ) g.command 'list' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.emoji_list(options)) diff --git a/bin/commands/files.rb b/bin/commands/files.rb index bfd893e7..43afbaa5 100644 --- a/bin/commands/files.rb +++ b/bin/commands/files.rb @@ -3,8 +3,8 @@ desc 'Files methods.' command 'files' do |g| - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Deletes a file.' + g.long_desc %( Deletes a file. ) g.command 'delete' do |c| c.flag 'file', desc: 'ID of file to delete.' c.action do |_global_options, options, _args| @@ -23,8 +23,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Gets information about a team file.' + g.long_desc %( Gets information about a team file. ) g.command 'info' do |c| c.flag 'file', desc: 'Specify a file by providing its ID.' c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. 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 of comments. See pagination for more details." @@ -34,8 +34,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Lists & filters team files.' + g.long_desc %( Lists & filters team files. ) g.command 'list' do |c| c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.' c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).' @@ -47,8 +47,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Revokes public/external sharing access for a file' + g.long_desc %( Revokes public/external sharing access for a file ) g.command 'revokePublicURL' do |c| c.flag 'file', desc: 'File to revoke.' c.action do |_global_options, options, _args| @@ -66,8 +66,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Enables a file for public/external sharing.' + g.long_desc %( Enables a file for public/external sharing. ) g.command 'sharedPublicURL' do |c| c.flag 'file', desc: 'File to share.' c.action do |_global_options, options, _args| @@ -75,8 +75,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Uploads or creates a file.' + g.long_desc %( Uploads or creates a file. ) g.command 'upload' do |c| c.flag 'channels', desc: 'Comma-separated list of channel names or IDs where the file will be shared.' c.flag 'content', desc: 'File contents via a POST variable. If omitting this parameter, you must provide a file.' diff --git a/bin/commands/files_comments.rb b/bin/commands/files_comments.rb index 223082ac..2eb117ef 100644 --- a/bin/commands/files_comments.rb +++ b/bin/commands/files_comments.rb @@ -3,8 +3,8 @@ desc 'FilesComments methods.' command 'files_comments' do |g| - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Deletes an existing comment on a file.' + g.long_desc %( Deletes an existing comment on a file. ) g.command 'delete' do |c| c.flag 'file', desc: 'File to delete a comment from.' c.flag 'id', desc: 'The comment to delete.' diff --git a/bin/commands/files_remote.rb b/bin/commands/files_remote.rb index 557e6788..7abd13ca 100644 --- a/bin/commands/files_remote.rb +++ b/bin/commands/files_remote.rb @@ -3,8 +3,8 @@ desc 'FilesRemote methods.' command 'files_remote' do |g| - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Adds a file from a remote service' + g.long_desc %( Adds a file from a remote service ) g.command 'add' do |c| c.flag 'external_id', desc: 'Creator defined GUID for the file.' c.flag 'external_url', desc: 'URL of the remote file.' @@ -17,8 +17,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Retrieve information about a remote file added to Slack' + g.long_desc %( Retrieve information about a remote file added to Slack ) g.command 'info' do |c| c.flag 'external_id', desc: 'Creator defined GUID for the file.' c.flag 'file', desc: 'Specify a file by providing its ID.' @@ -27,8 +27,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Retrieve information about a remote file added to Slack' + g.long_desc %( Retrieve information about a remote file added to Slack ) g.command 'list' do |c| c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.' 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." @@ -40,8 +40,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Remove a remote file.' + g.long_desc %( Remove a remote file. ) g.command 'remove' do |c| c.flag 'external_id', desc: 'Creator defined GUID for the file.' c.flag 'file', desc: 'Specify a file by providing its ID.' @@ -50,8 +50,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Share a remote file into a channel.' + g.long_desc %( Share a remote file into a channel. ) g.command 'share' do |c| c.flag 'channels', desc: 'Comma-separated list of channel IDs where the file will be shared.' c.flag 'external_id', desc: 'Creator defined GUID for the file.' @@ -61,8 +61,8 @@ end end - g.desc "A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments." - g.long_desc %( A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. ) + g.desc 'Updates an existing remote file.' + g.long_desc %( Updates an existing remote file. ) g.command 'update' do |c| c.flag 'external_id', desc: 'Creator defined GUID for the file.' c.flag 'external_url', desc: 'URL of the remote file.' diff --git a/bin/commands/groups.rb b/bin/commands/groups.rb index bbeba698..c09d2b2d 100644 --- a/bin/commands/groups.rb +++ b/bin/commands/groups.rb @@ -3,8 +3,8 @@ desc 'Groups methods.' command 'groups' do |g| - g.desc 'This method archives a private channel.' - g.long_desc %( This method archives a private channel. ) + g.desc 'Archives a private channel.' + g.long_desc %( Archives a private channel. ) g.command 'archive' do |c| c.flag 'channel', desc: 'Private channel to archive.' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This method creates a private channel.' - g.long_desc %( This method creates a private channel. ) + g.desc 'Creates a private channel.' + g.long_desc %( Creates a private channel. ) g.command 'create' do |c| c.flag 'name', desc: 'Name of private channel to create.' c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.' @@ -22,8 +22,8 @@ end end - g.desc 'This method takes an existing private channel and performs the following steps:' - g.long_desc %( This method takes an existing private channel and performs the following steps: - Renames the existing private channel (from "example" to "example-archived"). - Archives the existing private channel. - Creates a new private channel with the name of the existing private channel. - Adds all members of the existing private channel to the new private channel. ) + g.desc 'Clones and archives a private channel.' + g.long_desc %( Clones and archives a private channel. ) g.command 'createChild' do |c| c.flag 'channel', desc: 'Private channel to clone and archive.' c.action do |_global_options, options, _args| @@ -31,8 +31,8 @@ end end - g.desc 'This method returns a portion of messages/events from the specified private channel.' - g.long_desc %( This method returns a portion of messages/events from the specified private channel. To read the entire history for a private channel, call the method with no latest or oldest arguments, and then continue paging using the instructions below. ) + g.desc 'Fetches history of messages and events from a private channel.' + g.long_desc %( Fetches history of messages and events from a private channel. ) g.command 'history' do |c| c.flag 'channel', desc: 'Private channel to fetch history for.' c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.' @@ -53,8 +53,8 @@ end end - g.desc "Don't use this method. Use conversations.info instead." - g.long_desc %( Don't use this method. Use conversations.info instead. ) + g.desc 'Gets information about a private channel.' + g.long_desc %( Gets information about a private channel. ) g.command 'info' do |c| c.flag 'channel', desc: 'Private channel to get info on.' c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.' @@ -63,8 +63,8 @@ end end - g.desc 'This method is used to invite a user to a private channel. The calling user must be a member of the private channel.' - g.long_desc %( This method is used to invite a user to a private channel. The calling user must be a member of the private channel. ) + g.desc 'Invites a user to a private channel.' + g.long_desc %( Invites a user to a private channel. ) g.command 'invite' do |c| c.flag 'channel', desc: 'Private channel to invite user to.' c.flag 'user', desc: 'User to invite.' @@ -73,8 +73,8 @@ end end - g.desc 'This method allows a user to remove another member from a private channel.' - g.long_desc %( This method allows a user to remove another member from a private channel. ) + g.desc 'Removes a user from a private channel.' + g.long_desc %( Removes a user from a private channel. ) g.command 'kick' do |c| c.flag 'channel', desc: 'Private channel to remove user from.' c.flag 'user', desc: 'User to remove from private channel.' @@ -83,8 +83,8 @@ end end - g.desc 'This method is used to leave a private channel.' - g.long_desc %( This method is used to leave a private channel. ) + g.desc 'Leaves a private channel.' + g.long_desc %( Leaves a private channel. ) g.command 'leave' do |c| c.flag 'channel', desc: 'Private channel to leave.' c.action do |_global_options, options, _args| @@ -92,8 +92,8 @@ end end - g.desc "Don't use this method. Use conversations.list instead." - g.long_desc %( Don't use this method. Use conversations.list instead. ) + g.desc 'Lists private channels that the calling user has access to.' + g.long_desc %( Lists private channels that the calling user has access to. ) g.command 'list' do |c| 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." c.flag 'exclude_archived', desc: "Don't return archived private channels." @@ -104,8 +104,8 @@ end end - g.desc 'This method moves the read cursor in a private channel.' - g.long_desc %( This method moves the read cursor in a private channel. ) + g.desc 'Sets the read cursor in a private channel.' + g.long_desc %( Sets the read cursor in a private channel. ) g.command 'mark' do |c| c.flag 'channel', desc: 'Private channel to set reading cursor in.' c.flag 'ts', desc: 'Timestamp of the most recently seen message.' @@ -114,8 +114,8 @@ end end - g.desc 'This method opens a private channel.' - g.long_desc %( This method opens a private channel. ) + g.desc 'Opens a private channel.' + g.long_desc %( Opens a private channel. ) g.command 'open' do |c| c.flag 'channel', desc: 'Private channel to open.' c.action do |_global_options, options, _args| @@ -123,8 +123,8 @@ end end - g.desc 'This method renames a private channel.' - g.long_desc %( This method renames a private channel. ) + g.desc 'Renames a private channel.' + g.long_desc %( Renames a private channel. ) g.command 'rename' do |c| c.flag 'channel', desc: 'Private channel to rename.' c.flag 'name', desc: 'New name for private channel.' @@ -134,8 +134,8 @@ end end - g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).' - g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). ) + g.desc 'Retrieve a thread of messages posted to a private channel' + g.long_desc %( Retrieve a thread of messages posted to a private channel ) g.command 'replies' do |c| c.flag 'channel', desc: 'Private channel to fetch thread from.' c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message." @@ -144,8 +144,8 @@ end end - g.desc 'This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.' - g.long_desc %( This method is used to change the purpose of a private channel. The calling user must be a member of the private channel. ) + g.desc 'Sets the purpose for a private channel.' + g.long_desc %( Sets the purpose for a private channel. ) g.command 'setPurpose' do |c| c.flag 'channel', desc: 'Private channel to set the purpose of.' c.flag 'purpose', desc: 'The new purpose.' @@ -154,8 +154,8 @@ end end - g.desc 'This method is used to change the topic of a private channel. The calling user must be a member of the private channel.' - g.long_desc %( This method is used to change the topic of a private channel. The calling user must be a member of the private channel. ) + g.desc 'Sets the topic for a private channel.' + g.long_desc %( Sets the topic for a private channel. ) g.command 'setTopic' do |c| c.flag 'channel', desc: 'Private channel to set the topic of.' c.flag 'topic', desc: 'The new topic.' @@ -164,8 +164,8 @@ end end - g.desc 'This method unarchives a private channel.' - g.long_desc %( This method unarchives a private channel. ) + g.desc 'Unarchives a private channel.' + g.long_desc %( Unarchives a private channel. ) g.command 'unarchive' do |c| c.flag 'channel', desc: 'Private channel to unarchive.' c.action do |_global_options, options, _args| diff --git a/bin/commands/im.rb b/bin/commands/im.rb index 2d579bc4..d7568ce6 100644 --- a/bin/commands/im.rb +++ b/bin/commands/im.rb @@ -3,8 +3,8 @@ desc 'Im methods.' command 'im' do |g| - g.desc 'This method closes a direct message channel.' - g.long_desc %( This method closes a direct message channel. ) + g.desc 'Close a direct message channel.' + g.long_desc %( Close a direct message channel. ) g.command 'close' do |c| c.flag 'channel', desc: 'Direct message channel to close.' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This method returns a portion of messages/events from the specified direct message channel.' - g.long_desc %( This method returns a portion of messages/events from the specified direct message channel. To read the entire history for a direct message channel, call the method with no latest or oldest arguments, and then continue paging using the instructions below. ) + g.desc 'Fetches history of messages and events from direct message channel.' + g.long_desc %( Fetches history of messages and events from direct message channel. ) g.command 'history' do |c| c.flag 'channel', desc: 'Direct message channel to fetch history for.' c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.' @@ -25,8 +25,8 @@ end end - g.desc "Don't use this method. Use conversations.list instead." - g.long_desc %( Don't use this method. Use conversations.list instead. ) + g.desc 'Lists direct message channels for the calling user.' + g.long_desc %( Lists direct message channels for the calling user. ) g.command 'list' do |c| 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." 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." @@ -35,8 +35,8 @@ end end - g.desc 'This method moves the read cursor in a direct message channel.' - g.long_desc %( This method moves the read cursor in a direct message channel. ) + g.desc 'Sets the read cursor in a direct message channel.' + g.long_desc %( Sets the read cursor in a direct message channel. ) g.command 'mark' do |c| c.flag 'channel', desc: 'Direct message channel to set reading cursor in.' c.flag 'ts', desc: 'Timestamp of the most recently seen message.' @@ -45,8 +45,8 @@ end end - g.desc 'This method opens a direct message channel with another member of your Slack team.' - g.long_desc %( This method opens a direct message channel with another member of your Slack team. ) + g.desc 'Opens a direct message channel.' + g.long_desc %( Opens a direct message channel. ) g.command 'open' do |c| c.flag 'user', desc: 'User to open a direct message channel with.' c.flag 'include_locale', desc: 'Set this to true to receive the locale for this im. Defaults to false.' @@ -56,8 +56,8 @@ end end - g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).' - g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). ) + g.desc 'Retrieve a thread of messages posted to a direct message conversation' + g.long_desc %( Retrieve a thread of messages posted to a direct message conversation ) g.command 'replies' do |c| c.flag 'channel', desc: 'Direct message channel to fetch thread from.' c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message." diff --git a/bin/commands/migration.rb b/bin/commands/migration.rb index b532b864..4f5c9d61 100644 --- a/bin/commands/migration.rb +++ b/bin/commands/migration.rb @@ -3,8 +3,8 @@ desc 'Migration methods.' command 'migration' do |g| - g.desc 'Easily convert your vintage user IDs to Enterprise Grid-friendly global user IDs.' - g.long_desc %( Easily convert your vintage user IDs to Enterprise Grid-friendly global user IDs. ) + g.desc 'For Enterprise Grid workspaces, map local user IDs to global user IDs' + g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs ) g.command 'exchange' do |c| c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.' c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.' diff --git a/bin/commands/mpim.rb b/bin/commands/mpim.rb index 3aec7242..7ec22831 100644 --- a/bin/commands/mpim.rb +++ b/bin/commands/mpim.rb @@ -3,8 +3,8 @@ desc 'Mpim methods.' command 'mpim' do |g| - g.desc 'This method closes a multiparty direct message channel.' - g.long_desc %( This method closes a multiparty direct message channel. ) + g.desc 'Closes a multiparty direct message channel.' + g.long_desc %( Closes a multiparty direct message channel. ) g.command 'close' do |c| c.flag 'channel', desc: 'MPIM to close.' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This method returns a portion of messages/events from the specified multiparty direct message channel.' - g.long_desc %( This method returns a portion of messages/events from the specified multiparty direct message channel. To read the entire history for a multiparty direct message, call the method with no latest or oldest arguments, and then continue paging using the instructions below. ) + g.desc 'Fetches history of messages and events from a multiparty direct message.' + g.long_desc %( Fetches history of messages and events from a multiparty direct message. ) g.command 'history' do |c| c.flag 'channel', desc: 'Multiparty direct message to fetch history for.' c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.' @@ -25,8 +25,8 @@ end end - g.desc "Don't use this method. Use conversations.list instead." - g.long_desc %( Don't use this method. Use conversations.list instead. ) + g.desc 'Lists multiparty direct message channels for the calling user.' + g.long_desc %( Lists multiparty direct message channels for the calling user. ) g.command 'list' do |c| 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." 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." @@ -35,8 +35,8 @@ end end - g.desc 'This method moves the read cursor in a multiparty direct message channel.' - g.long_desc %( This method moves the read cursor in a multiparty direct message channel. ) + g.desc 'Sets the read cursor in a multiparty direct message channel.' + g.long_desc %( Sets the read cursor in a multiparty direct message channel. ) g.command 'mark' do |c| c.flag 'channel', desc: 'multiparty direct message channel to set reading cursor in.' c.flag 'ts', desc: 'Timestamp of the most recently seen message.' @@ -54,8 +54,8 @@ end end - g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).' - g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). ) + g.desc 'Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.' + g.long_desc %( Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message. ) g.command 'replies' do |c| c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.' c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message." diff --git a/bin/commands/oauth.rb b/bin/commands/oauth.rb index 97ebd5b9..0f01902f 100644 --- a/bin/commands/oauth.rb +++ b/bin/commands/oauth.rb @@ -3,8 +3,8 @@ desc 'Oauth methods.' command 'oauth' do |g| - g.desc 'This method allows you to exchange a temporary OAuth code for an API access token.' - g.long_desc %( This method allows you to exchange a temporary OAuth code for an API access token. ) + g.desc 'Exchanges a temporary OAuth verifier code for an access token.' + g.long_desc %( Exchanges a temporary OAuth verifier code for an access token. ) g.command 'access' do |c| c.flag 'client_id', desc: 'Issued when you created your application.' c.flag 'client_secret', desc: 'Issued when you created your application.' @@ -16,8 +16,8 @@ end end - g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.' - g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. ) + g.desc 'Exchanges a temporary OAuth verifier code for a workspace token.' + g.long_desc %( Exchanges a temporary OAuth verifier code for a workspace token. ) g.command 'token' do |c| c.flag 'client_id', desc: 'Issued when you created your application.' c.flag 'client_secret', desc: 'Issued when you created your application.' diff --git a/bin/commands/pins.rb b/bin/commands/pins.rb index 7a53ce61..7abd5aa5 100644 --- a/bin/commands/pins.rb +++ b/bin/commands/pins.rb @@ -3,20 +3,18 @@ desc 'Pins methods.' command 'pins' do |g| - g.desc 'This method pins a channel message or group message to a particular channel.' - g.long_desc %( This method pins a channel message or group message to a particular channel. The channel argument is required and timestamp must also be specified. ) + g.desc 'Pins an item to a channel.' + g.long_desc %( Pins an item to a channel. ) g.command 'add' do |c| c.flag 'channel', desc: 'Channel to pin the item in.' - c.flag 'file', desc: 'File to pin.' - c.flag 'file_comment', desc: 'File comment to pin.' c.flag 'timestamp', desc: 'Timestamp of the message to pin.' c.action do |_global_options, options, _args| puts JSON.dump($client.pins_add(options)) end end - g.desc 'This method lists the items pinned to a channel.' - g.long_desc %( This method lists the items pinned to a channel. ) + g.desc 'Lists items pinned to a channel.' + g.long_desc %( Lists items pinned to a channel. ) g.command 'list' do |c| c.flag 'channel', desc: 'Channel to get pinned items for.' c.action do |_global_options, options, _args| @@ -24,8 +22,8 @@ end end - g.desc 'This method un-pins an item (file, file comment, channel message, or group message) from a channel.' - g.long_desc %( This method un-pins an item (file, file comment, channel message, or group message) from a channel. The channel argument is required and one of file, file_comment, or timestamp must also be specified. ) + g.desc 'Un-pins an item from a channel.' + g.long_desc %( Un-pins an item from a channel. ) g.command 'remove' do |c| c.flag 'channel', desc: 'Channel where the item is pinned to.' c.flag 'file', desc: 'File to un-pin.' diff --git a/bin/commands/reactions.rb b/bin/commands/reactions.rb index d4f12bb8..8ac6fe88 100644 --- a/bin/commands/reactions.rb +++ b/bin/commands/reactions.rb @@ -3,8 +3,8 @@ desc 'Reactions methods.' command 'reactions' do |g| - g.desc 'This method adds a reaction (emoji) to a message.' - g.long_desc %( This method adds a reaction (emoji) to a message. Now that file threads work the way you'd expect, the file and file_comment arguments are deprecated. Specify channel and timestamp instead. ) + g.desc 'Adds a reaction to an item.' + g.long_desc %( Adds a reaction to an item. ) g.command 'add' do |c| c.flag 'name', desc: 'Reaction (emoji) name.' c.flag 'channel', desc: 'Channel where the message to add reaction to was posted.' @@ -16,8 +16,8 @@ end end - g.desc 'This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message).' - g.long_desc %( This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message). ) + g.desc 'Gets reactions for an item.' + g.long_desc %( Gets reactions for an item. ) g.command 'get' do |c| c.flag 'channel', desc: 'Channel where the message to get reactions for was posted.' c.flag 'file', desc: 'File to get reactions for.' @@ -29,8 +29,8 @@ end end - g.desc 'This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user.' - g.long_desc %( This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user. ) + g.desc 'Lists reactions made by a user.' + g.long_desc %( Lists reactions made by a user. ) g.command 'list' do |c| 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." c.flag 'full', desc: 'If true always return the complete reaction list.' @@ -41,8 +41,8 @@ end end - g.desc 'This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message).' - g.long_desc %( This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message). One of file, file_comment, or the combination of channel and timestamp must be specified. ) + g.desc 'Removes a reaction from an item.' + g.long_desc %( Removes a reaction from an item. ) g.command 'remove' do |c| c.flag 'name', desc: 'Reaction (emoji) name.' c.flag 'channel', desc: 'Channel where the message to remove reaction from was posted.' diff --git a/bin/commands/reminders.rb b/bin/commands/reminders.rb index 705bd98e..b65cc246 100644 --- a/bin/commands/reminders.rb +++ b/bin/commands/reminders.rb @@ -3,8 +3,8 @@ desc 'Reminders methods.' command 'reminders' do |g| - g.desc 'This method creates a reminder.' - g.long_desc %( This method creates a reminder. ) + g.desc 'Creates a reminder.' + g.long_desc %( Creates a reminder. ) g.command 'add' do |c| c.flag 'text', desc: 'The content of the reminder.' 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,8 +14,8 @@ end end - g.desc 'This method completes a reminder.' - g.long_desc %( This method completes a reminder. ) + g.desc 'Marks a reminder as complete.' + g.long_desc %( Marks a reminder as complete. ) g.command 'complete' do |c| c.flag 'reminder', desc: 'The ID of the reminder to be marked as complete.' c.action do |_global_options, options, _args| @@ -23,8 +23,8 @@ end end - g.desc 'This method deletes a reminder.' - g.long_desc %( This method deletes a reminder. ) + g.desc 'Deletes a reminder.' + g.long_desc %( Deletes a reminder. ) g.command 'delete' do |c| c.flag 'reminder', desc: 'The ID of the reminder.' c.action do |_global_options, options, _args| @@ -32,8 +32,8 @@ end end - g.desc 'This method returns information about a reminder.' - g.long_desc %( This method returns information about a reminder. ) + g.desc 'Gets information about a reminder.' + g.long_desc %( Gets information about a reminder. ) g.command 'info' do |c| c.flag 'reminder', desc: 'The ID of the reminder.' c.action do |_global_options, options, _args| @@ -41,8 +41,8 @@ end end - g.desc 'This method lists all reminders created by or for a given user.' - g.long_desc %( This method lists all reminders created by or for a given user. ) + g.desc 'Lists all reminders created by or for a given user.' + g.long_desc %( Lists all reminders created by or for a given user. ) g.command 'list' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.reminders_list(options)) diff --git a/bin/commands/rtm.rb b/bin/commands/rtm.rb index 82d77c9c..c23b0b04 100644 --- a/bin/commands/rtm.rb +++ b/bin/commands/rtm.rb @@ -3,8 +3,8 @@ desc 'Rtm methods.' command 'rtm' do |g| - g.desc 'This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket.' - g.long_desc %( This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket. ) + g.desc 'Starts a Real Time Messaging session.' + g.long_desc %( Starts a Real Time Messaging session. ) g.command 'connect' do |c| c.flag 'batch_presence_aware', desc: 'Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.' c.flag 'presence_sub', desc: 'Only deliver presence events when requested by subscription. See presence subscriptions.' @@ -13,8 +13,8 @@ end end - g.desc 'This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket.' - g.long_desc %( This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket. ) + g.desc 'Starts a Real Time Messaging session.' + g.long_desc %( Starts a Real Time Messaging session. ) g.command 'start' do |c| c.flag 'batch_presence_aware', desc: 'Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.' c.flag 'include_locale', desc: 'Set this to true to receive the locale for users and channels. Defaults to false.' diff --git a/bin/commands/search.rb b/bin/commands/search.rb index 262d91eb..3f423336 100644 --- a/bin/commands/search.rb +++ b/bin/commands/search.rb @@ -3,8 +3,8 @@ desc 'Search methods.' command 'search' do |g| - g.desc 'This method allows users and applications to search both messages and files in a single call.' - g.long_desc %( This method allows users and applications to search both messages and files in a single call. ) + g.desc 'Searches for messages and files matching a query.' + g.long_desc %( Searches for messages and files matching a query. ) g.command 'all' do |c| c.flag 'query', desc: 'Search query. May contains booleans, etc.' c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).' @@ -15,8 +15,8 @@ end end - g.desc 'This method returns files matching a search query.' - g.long_desc %( This method returns files matching a search query. ) + g.desc 'Searches for files matching a query.' + g.long_desc %( Searches for files matching a query. ) g.command 'files' do |c| c.flag 'query', desc: 'Search query.' c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).' @@ -27,8 +27,8 @@ end end - g.desc 'This method returns messages matching a search query.' - g.long_desc %( This method returns messages matching a search query. ) + g.desc 'Searches for messages matching a query.' + g.long_desc %( Searches for messages matching a query. ) g.command 'messages' do |c| c.flag 'query', desc: 'Search query.' c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).' diff --git a/bin/commands/stars.rb b/bin/commands/stars.rb index 3251fe06..f0f60646 100644 --- a/bin/commands/stars.rb +++ b/bin/commands/stars.rb @@ -3,8 +3,8 @@ desc 'Stars methods.' command 'stars' do |g| - g.desc 'This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.' - g.long_desc %( This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. One of file, file_comment, channel, or the combination of channel and timestamp must be specified. ) + g.desc 'Adds a star to an item.' + g.long_desc %( Adds a star to an item. ) g.command 'add' do |c| c.flag 'channel', desc: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).' c.flag 'file', desc: 'File to add star to.' @@ -15,8 +15,8 @@ end end - g.desc 'This method lists the items starred by the authed user.' - g.long_desc %( This method lists the items starred by the authed user. ) + g.desc 'Lists stars for a user.' + g.long_desc %( Lists stars for a user. ) g.command 'list' do |c| 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." 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." @@ -25,8 +25,8 @@ end end - g.desc 'This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.' - g.long_desc %( This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. One of file, file_comment, channel, or the combination of channel and timestamp must be specified. ) + g.desc 'Removes a star from an item.' + g.long_desc %( Removes a star from an item. ) g.command 'remove' do |c| c.flag 'channel', desc: 'Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).' c.flag 'file', desc: 'File to remove star from.' diff --git a/bin/commands/team.rb b/bin/commands/team.rb index d0d7eda4..ed956f08 100644 --- a/bin/commands/team.rb +++ b/bin/commands/team.rb @@ -3,8 +3,8 @@ desc 'Team methods.' command 'team' do |g| - g.desc 'This method is used to retrieve the "access logs" for users on a workspace.' - g.long_desc %( This method is used to retrieve the "access logs" for users on a workspace. ) + g.desc 'Gets the access logs for the current team.' + g.long_desc %( Gets the access logs for the current team. ) g.command 'accessLogs' do |c| c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).' c.action do |_global_options, options, _args| @@ -12,8 +12,8 @@ end end - g.desc 'This method lists billable information for each user on the team. Currently this consists solely of whether the user is' - g.long_desc %( This method lists billable information for each user on the team. Currently this consists solely of whether the user is subject to billing per Slack's Fair Billing policy. ) + g.desc 'Gets billable users information for the current team.' + g.long_desc %( Gets billable users information for the current team. ) g.command 'billableInfo' do |c| c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.' c.action do |_global_options, options, _args| @@ -21,8 +21,8 @@ end end - g.desc 'This method provides information about your team.' - g.long_desc %( This method provides information about your team. ) + g.desc 'Gets information about the current team.' + g.long_desc %( Gets information about the current team. ) g.command 'info' do |c| c.flag 'team', desc: 'Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.' c.action do |_global_options, options, _args| @@ -30,8 +30,8 @@ end end - g.desc 'This method lists the integration activity logs for a team, including when integrations are added, modified and removed. This method can only be called by Admins.' - g.long_desc %( This method lists the integration activity logs for a team, including when integrations are added, modified and removed. This method can only be called by Admins. ) + g.desc 'Gets the integration logs for the current team.' + g.long_desc %( Gets the integration logs for the current team. ) g.command 'integrationLogs' do |c| c.flag 'app_id', desc: 'Filter logs to this Slack app. Defaults to all logs.' c.flag 'change_type', desc: 'Filter logs with this change type. Defaults to all logs.' diff --git a/bin/commands/team_profile.rb b/bin/commands/team_profile.rb index 630325f5..18ad1fd6 100644 --- a/bin/commands/team_profile.rb +++ b/bin/commands/team_profile.rb @@ -3,8 +3,8 @@ desc 'TeamProfile methods.' command 'team_profile' do |g| - g.desc 'This method is used to get the profile field definitions for this team.' - g.long_desc %( This method is used to get the profile field definitions for this team. ) + g.desc "Retrieve a team's profile." + g.long_desc %( Retrieve a team's profile. ) g.command 'get' do |c| c.flag 'visibility', desc: 'Filter by visibility.' c.action do |_global_options, options, _args| diff --git a/bin/commands/usergroups.rb b/bin/commands/usergroups.rb index ecf447da..0766442d 100644 --- a/bin/commands/usergroups.rb +++ b/bin/commands/usergroups.rb @@ -3,8 +3,8 @@ desc 'Usergroups methods.' command 'usergroups' do |g| - g.desc 'This method is used to create a User Group.' - g.long_desc %( This method is used to create a User Group. ) + g.desc 'Create a User Group' + g.long_desc %( Create a User Group ) g.command 'create' do |c| c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.' c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.' @@ -16,8 +16,8 @@ end end - g.desc 'This method disables an existing User Group.' - g.long_desc %( This method disables an existing User Group. ) + g.desc 'Disable an existing User Group' + g.long_desc %( Disable an existing User Group ) g.command 'disable' do |c| c.flag 'usergroup', desc: 'The encoded ID of the User Group to disable.' c.flag 'include_count', desc: 'Include the number of users in the User Group.' @@ -26,8 +26,8 @@ end end - g.desc 'This method enables a User Group which was previously disabled.' - g.long_desc %( This method enables a User Group which was previously disabled. ) + g.desc 'Enable a User Group' + g.long_desc %( Enable a User Group ) g.command 'enable' do |c| c.flag 'usergroup', desc: 'The encoded ID of the User Group to enable.' c.flag 'include_count', desc: 'Include the number of users in the User Group.' @@ -36,8 +36,8 @@ end end - g.desc 'This method returns a list of all User Groups in the team. This can optionally include disabled User Groups.' - g.long_desc %( This method returns a list of all User Groups in the team. This can optionally include disabled User Groups. ) + g.desc 'List all User Groups for a team' + g.long_desc %( List all User Groups for a team ) g.command 'list' do |c| c.flag 'include_count', desc: 'Include the number of users in each User Group.' c.flag 'include_disabled', desc: 'Include disabled User Groups.' @@ -47,8 +47,8 @@ end end - g.desc 'This method updates the properties of an existing User Group.' - g.long_desc %( This method updates the properties of an existing User Group. ) + g.desc 'Update an existing User Group' + g.long_desc %( Update an existing User Group ) g.command 'update' do |c| c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.' c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.' diff --git a/bin/commands/usergroups_users.rb b/bin/commands/usergroups_users.rb index 0cc92301..a1a57b96 100644 --- a/bin/commands/usergroups_users.rb +++ b/bin/commands/usergroups_users.rb @@ -3,8 +3,8 @@ desc 'UsergroupsUsers methods.' command 'usergroups_users' do |g| - g.desc 'This method returns a list of all users within a User Group.' - g.long_desc %( This method returns a list of all users within a User Group. ) + g.desc 'List all users in a User Group' + g.long_desc %( List all users in a User Group ) g.command 'list' do |c| c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.' c.flag 'include_disabled', desc: 'Allow results that involve disabled User Groups.' @@ -13,8 +13,8 @@ end end - g.desc 'This method updates the list of users that belong to a User Group. This method replaces all users in a User Group with the list of users provided in the users parameter.' - g.long_desc %( This method updates the list of users that belong to a User Group. This method replaces all users in a User Group with the list of users provided in the users parameter. ) + g.desc 'Update the list of users for a User Group' + g.long_desc %( Update the list of users for a User Group ) g.command 'update' do |c| c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.' c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the User Group.' diff --git a/bin/commands/users.rb b/bin/commands/users.rb index 79a5cf51..cf751028 100644 --- a/bin/commands/users.rb +++ b/bin/commands/users.rb @@ -3,8 +3,8 @@ desc 'Users methods.' command 'users' do |g| - g.desc 'This method helps answer questions like:' - g.long_desc %( This method helps answer questions like: - Which conversations am I a member of? - Which public channels is my bot user in? - Do I have any direct messages open with my friend Suzy? - Is my bot a member of any private channels? ) + g.desc 'List conversations the calling user may access.' + g.long_desc %( List conversations the calling user may access. ) g.command 'conversations' do |c| 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." c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.' @@ -16,16 +16,16 @@ end end - g.desc 'This method allows the user to delete their profile image. It will clear whatever image is currently set.' - g.long_desc %( This method allows the user to delete their profile image. It will clear whatever image is currently set. ) + g.desc 'Delete the user profile photo' + g.long_desc %( Delete the user profile photo ) g.command 'deletePhoto' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.users_deletePhoto(options)) end end - g.desc "This method lets you find out information about a user's presence." - g.long_desc %( This method lets you find out information about a user's presence. Consult the presence documentation for more details. ) + g.desc 'Gets user presence information.' + g.long_desc %( Gets user presence information. ) g.command 'getPresence' do |c| c.flag 'user', desc: 'User to get presence info on. Defaults to the authed user.' c.action do |_global_options, options, _args| @@ -42,16 +42,16 @@ end end - g.desc "After your Slack app is awarded an identity token through Sign in with Slack, use this method to retrieve a user's identity." - g.long_desc %( After your Slack app is awarded an identity token through Sign in with Slack, use this method to retrieve a user's identity. ) + g.desc "Get a user's identity." + g.long_desc %( Get a user's identity. ) g.command 'identity' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.users_identity(options)) end end - g.desc 'This method returns information about a member of a workspace.' - g.long_desc %( This method returns information about a member of a workspace. ) + g.desc 'Gets information about a user.' + g.long_desc %( Gets information about a user. ) g.command 'info' do |c| c.flag 'user', desc: 'User to get info on.' c.flag 'include_locale', desc: 'Set this to true to receive the locale for this user. Defaults to false.' @@ -60,8 +60,8 @@ end end - g.desc 'This method returns a list of all users in the workspace. This includes deleted/deactivated users.' - g.long_desc %( This method returns a list of all users in the workspace. This includes deleted/deactivated users. ) + g.desc 'Lists all users in a Slack team.' + g.long_desc %( Lists all users in a Slack team. ) g.command 'list' do |c| 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." c.flag 'include_locale', desc: 'Set this to true to receive the locale for users. Defaults to false.' @@ -71,8 +71,8 @@ end end - g.desc 'Retrieve a single user by looking them up by their registered email address. Requires users:read.email.' - g.long_desc %( Retrieve a single user by looking them up by their registered email address. Requires users:read.email. ) + g.desc 'Find a user with an email address.' + g.long_desc %( Find a user with an email address. ) g.command 'lookupByEmail' do |c| c.flag 'email', desc: 'An email address belonging to a user in the workspace.' c.action do |_global_options, options, _args| @@ -89,16 +89,16 @@ end end - g.desc 'This method is no longer functional and the behavior it controlled is no longer offered. The method will no longer exist beginning May 8, 2018.' - g.long_desc %( This method is no longer functional and the behavior it controlled is no longer offered. The method will no longer exist beginning May 8, 2018. ) + g.desc 'Marked a user as active. Deprecated and non-functional.' + g.long_desc %( Marked a user as active. Deprecated and non-functional. ) g.command 'setActive' do |c| c.action do |_global_options, options, _args| puts JSON.dump($client.users_setActive(options)) end end - g.desc 'This method allows the user to set their profile image. The caller can pass image data via image.' - g.long_desc %( This method allows the user to set their profile image. The caller can pass image data via image. ) + g.desc 'Set the user profile photo' + g.long_desc %( Set the user profile photo ) g.command 'setPhoto' do |c| c.flag 'image', desc: 'File contents via multipart/form-data.' c.flag 'crop_w', desc: 'Width/height of crop box (always square).' @@ -109,8 +109,8 @@ end end - g.desc "This method lets you set the calling user's manual presence." - g.long_desc %( This method lets you set the calling user's manual presence. Consult the presence documentation for more details. ) + g.desc 'Manually sets user presence.' + g.long_desc %( Manually sets user presence. ) g.command 'setPresence' do |c| c.flag 'presence', desc: 'Either auto or away.' c.action do |_global_options, options, _args| diff --git a/bin/commands/users_profile.rb b/bin/commands/users_profile.rb index 37aeb611..8e69047e 100644 --- a/bin/commands/users_profile.rb +++ b/bin/commands/users_profile.rb @@ -3,8 +3,8 @@ desc 'UsersProfile methods.' command 'users_profile' do |g| - g.desc "Use this method to retrieve a user's profile information." - g.long_desc %( Use this method to retrieve a user's profile information. ) + g.desc "Retrieves a user's profile information." + g.long_desc %( Retrieves a user's profile information. ) g.command 'get' do |c| c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields.' c.flag 'user', desc: 'User to retrieve profile info for.' @@ -13,8 +13,8 @@ end end - g.desc "Use this method to set a user's profile information, including name, email, current status, and other attributes." - g.long_desc %( Use this method to set a user's profile information, including name, email, current status, and other attributes. ) + g.desc 'Set the profile information for a user.' + g.long_desc %( Set the profile information for a user. ) g.command 'set' do |c| c.flag 'name', desc: 'Name of a single key to set. Usable only if profile is not passed.' c.flag 'profile', desc: 'Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.' diff --git a/bin/commands/views.rb b/bin/commands/views.rb new file mode 100644 index 00000000..32f1022a --- /dev/null +++ b/bin/commands/views.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'Views methods.' +command 'views' do |g| + g.desc 'Open a view for a user.' + g.long_desc %( Open a view for a user. ) + g.command 'open' do |c| + c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.' + c.flag 'view', desc: 'The view payload. This must be a JSON-encoded string.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.views_open(options)) + end + end + + g.desc 'Push a view onto the stack of a root view.' + g.long_desc %( Push a view onto the stack of a root view. ) + g.command 'push' do |c| + c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.' + c.flag 'view', desc: 'The view payload. This must be a JSON-encoded string.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.views_push(options)) + end + end + + g.desc 'Update an existing view.' + g.long_desc %( Update an existing view. ) + g.command 'update' do |c| + c.flag 'view', desc: 'The view payload. This must be a JSON-encoded string.' + c.flag 'external_id', desc: 'A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required.' + c.flag 'hash', desc: 'A string that represents view state to protect against possible race conditions.' + c.flag 'view_id', desc: 'A unique identifier of the view to be updated. Either view_id or external_id is required.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.views_update(options)) + end + end +end diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index d249fe38..649e3f35 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake +require_relative 'endpoints/admin_apps' +require_relative 'endpoints/admin_apps_requests' require_relative 'endpoints/admin_users_session' require_relative 'endpoints/api' require_relative 'endpoints/apps' @@ -39,6 +41,7 @@ require_relative 'endpoints/users_admin' require_relative 'endpoints/users_prefs' require_relative 'endpoints/users_profile' +require_relative 'endpoints/views' module Slack module Web @@ -48,6 +51,8 @@ module Endpoints include Slack::Web::Api::Mixins::Users include Slack::Web::Api::Mixins::Groups + include AdminApps + include AdminAppsRequests include AdminUsersSession include Api include Apps @@ -86,6 +91,7 @@ module Endpoints include UsersAdmin include UsersPrefs include UsersProfile + include Views end end end diff --git a/lib/slack/web/api/endpoints/admin_apps.rb b/lib/slack/web/api/endpoints/admin_apps.rb new file mode 100644 index 00000000..299a1b23 --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_apps.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminApps + # + # Approve an app for installation on a workspace. + # + # @option options [Object] :app_id + # The id of the app to approve. + # @option options [Object] :request_id + # The id of the request to approve. + # @option options [Object] :team_id + # . + # @see https://api.slack.com/methods/admin.apps.approve + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.approve.json + def admin_apps_approve(options = {}) + post('admin.apps.approve', options) + end + + # + # Restrict an app for installation on a workspace. + # + # @option options [Object] :app_id + # The id of the app to restrict. + # @option options [Object] :request_id + # The id of the request to restrict. + # @option options [Object] :team_id + # . + # @see https://api.slack.com/methods/admin.apps.restrict + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.restrict.json + def admin_apps_restrict(options = {}) + post('admin.apps.restrict', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_apps_requests.rb b/lib/slack/web/api/endpoints/admin_apps_requests.rb new file mode 100644 index 00000000..52d4ce97 --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_apps_requests.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminAppsRequests + # + # List app requests for a team/workspace. + # + # @option options [Object] :cursor + # Set cursor to next_cursor returned by the previous call to list items in the next page. + # @option options [Object] :limit + # The maximum number of items to return. Must be between 1 - 1000 both inclusive. + # @option options [Object] :team_id + # . + # @see https://api.slack.com/methods/admin.apps.requests.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.requests/admin.apps.requests.list.json + def admin_apps_requests_list(options = {}) + if block_given? + Pagination::Cursor.new(self, :admin_apps_requests_list, options).each do |page| + yield page + end + else + post('admin.apps.requests.list', options) + end + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_users_session.rb b/lib/slack/web/api/endpoints/admin_users_session.rb index cb993f79..570de223 100644 --- a/lib/slack/web/api/endpoints/admin_users_session.rb +++ b/lib/slack/web/api/endpoints/admin_users_session.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AdminUsersSession # - # This method wipes a user session, leaving the user unauthenticated. The user's Slack client will reset its local cache. + # Wipes all valid sessions on all devices for a given user # # @option options [Object] :user_id # The ID of the user to wipe sessions for. diff --git a/lib/slack/web/api/endpoints/api.rb b/lib/slack/web/api/endpoints/api.rb index d6d61f3d..abaf1f0d 100644 --- a/lib/slack/web/api/endpoints/api.rb +++ b/lib/slack/web/api/endpoints/api.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Api # - # This method helps you test your calling code. + # Checks API calling code. # # @option options [Object] :error # Error response to return. diff --git a/lib/slack/web/api/endpoints/apps.rb b/lib/slack/web/api/endpoints/apps.rb index 0f283c88..6b47f865 100644 --- a/lib/slack/web/api/endpoints/apps.rb +++ b/lib/slack/web/api/endpoints/apps.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Apps # - # This method uninstalls an app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of an app. + # Uninstalls your app from a workspace. # # @option options [Object] :client_id # Issued when you created your application. diff --git a/lib/slack/web/api/endpoints/apps_permissions.rb b/lib/slack/web/api/endpoints/apps_permissions.rb index 1c27eda1..28bb33e5 100644 --- a/lib/slack/web/api/endpoints/apps_permissions.rb +++ b/lib/slack/web/api/endpoints/apps_permissions.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AppsPermissions # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Returns list of permissions this app has on a team. # # @see https://api.slack.com/methods/apps.permissions.info # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.info.json @@ -16,7 +16,7 @@ def apps_permissions_info(options = {}) end # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Allows an app to request additional scopes # # @option options [Object] :scopes # A comma separated list of scopes to request for. diff --git a/lib/slack/web/api/endpoints/apps_permissions_resources.rb b/lib/slack/web/api/endpoints/apps_permissions_resources.rb index 4a5c9475..706f10de 100644 --- a/lib/slack/web/api/endpoints/apps_permissions_resources.rb +++ b/lib/slack/web/api/endpoints/apps_permissions_resources.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AppsPermissionsResources # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Returns list of resource grants this app has on a team. # # @option options [Object] :cursor # 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. diff --git a/lib/slack/web/api/endpoints/apps_permissions_scopes.rb b/lib/slack/web/api/endpoints/apps_permissions_scopes.rb index 44cb0886..e67d87fe 100644 --- a/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +++ b/lib/slack/web/api/endpoints/apps_permissions_scopes.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AppsPermissionsScopes # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Returns list of scopes this app has on a team. # # @see https://api.slack.com/methods/apps.permissions.scopes.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions.scopes/apps.permissions.scopes.list.json diff --git a/lib/slack/web/api/endpoints/apps_permissions_users.rb b/lib/slack/web/api/endpoints/apps_permissions_users.rb index 89d56291..e6fa99bf 100644 --- a/lib/slack/web/api/endpoints/apps_permissions_users.rb +++ b/lib/slack/web/api/endpoints/apps_permissions_users.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AppsPermissionsUsers # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Returns list of user grants and corresponding scopes this app has on a team. # # @option options [Object] :cursor # 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. @@ -26,7 +26,7 @@ def apps_permissions_users_list(options = {}) end # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Enables an app to trigger a permissions modal to grant an app access to a user access scope. # # @option options [Object] :scopes # A comma separated list of user scopes to request for. diff --git a/lib/slack/web/api/endpoints/auth.rb b/lib/slack/web/api/endpoints/auth.rb index 238df3e0..76a37c28 100644 --- a/lib/slack/web/api/endpoints/auth.rb +++ b/lib/slack/web/api/endpoints/auth.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Auth # - # This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out. + # Revokes a token. # # @option options [Object] :test # Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked. @@ -18,7 +18,7 @@ def auth_revoke(options = {}) end # - # This method checks authentication and tells "you" who you are, even if you might be a bot. + # Checks authentication & identity. # # @see https://api.slack.com/methods/auth.test # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth/auth.test.json diff --git a/lib/slack/web/api/endpoints/bots.rb b/lib/slack/web/api/endpoints/bots.rb index fd090689..2a84f4a2 100644 --- a/lib/slack/web/api/endpoints/bots.rb +++ b/lib/slack/web/api/endpoints/bots.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Bots # - # This method returns extended information about a bot user. + # Gets information about a bot user. # # @option options [Object] :bot # Bot user to get info on. diff --git a/lib/slack/web/api/endpoints/channels.rb b/lib/slack/web/api/endpoints/channels.rb index 67fe7161..44583f08 100644 --- a/lib/slack/web/api/endpoints/channels.rb +++ b/lib/slack/web/api/endpoints/channels.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Channels # - # This method archives a channel. + # Archives a channel. # # @option options [channel] :channel # Channel to archive. @@ -20,7 +20,7 @@ def channels_archive(options = {}) end # - # This method is used to create a channel. + # Creates a channel. # # @option options [Object] :name # Name of channel to create. @@ -47,7 +47,7 @@ def channels_delete(options = {}) end # - # This method returns a portion of message events from the specified public channel. + # Fetches history of messages and events from a channel. # # @option options [channel] :channel # Channel to fetch history for. @@ -68,7 +68,7 @@ def channels_history(options = {}) end # - # This method returns information about a team channel. + # Gets information about a channel. # # @option options [channel] :channel # Channel to get info on. @@ -83,7 +83,7 @@ def channels_info(options = {}) end # - # This method is used to invite a user to a channel. The calling user must be a member of the channel. + # Invites a user to a channel. # # @option options [channel] :channel # Channel to invite user to. @@ -100,8 +100,7 @@ def channels_invite(options = {}) end # - # This method is used to join a channel. If the channel does not exist, it is - # created. + # Joins a channel, creating it if needed. # # @option options [Object] :name # Name of channel to join. @@ -115,7 +114,7 @@ def channels_join(options = {}) end # - # This method allows a user to remove another member from a team channel. + # Removes a user from a channel. # # @option options [channel] :channel # Channel to remove user from. @@ -132,7 +131,7 @@ def channels_kick(options = {}) end # - # This method is used to leave a channel. + # Leaves a channel. # # @option options [channel] :channel # Channel to leave. @@ -145,7 +144,7 @@ def channels_leave(options = {}) end # - # Don't use this method. Use conversations.list instead. + # Lists all channels in a Slack team. # # @option options [Object] :cursor # 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. @@ -168,7 +167,7 @@ def channels_list(options = {}) end # - # This method moves the read cursor in a channel. + # Sets the read cursor in a channel. # # @option options [channel] :channel # Channel to set reading cursor in. @@ -184,7 +183,7 @@ def channels_mark(options = {}) end # - # This method renames a team channel. + # Renames a channel. # # @option options [channel] :channel # Channel to rename. @@ -202,7 +201,7 @@ def channels_rename(options = {}) end # - # This method returns an entire thread (a message plus all the messages in reply to it). + # Retrieve a thread of messages posted to a channel # # @option options [channel] :channel # Channel to fetch thread from. @@ -218,7 +217,7 @@ def channels_replies(options = {}) end # - # This method is used to change the purpose of a channel. The calling user must be a member of the channel. + # Sets the purpose for a channel. # # @option options [channel] :channel # Channel to set the purpose of. @@ -236,7 +235,7 @@ def channels_setPurpose(options = {}) end # - # This method is used to change the topic of a channel. The calling user must be a member of the channel. + # Sets the topic for a channel. # # @option options [channel] :channel # Channel to set the topic of. @@ -252,7 +251,7 @@ def channels_setTopic(options = {}) end # - # This method unarchives a channel. The calling user is added to the channel. + # Unarchives a channel. # # @option options [channel] :channel # Channel to unarchive. diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 2e2ca93e..571105ab 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -25,7 +25,7 @@ def chat_command(options = {}) end # - # This method deletes a message from a channel. + # Deletes a message. # # @option options [channel] :channel # Channel containing the message to be deleted. @@ -43,7 +43,7 @@ def chat_delete(options = {}) end # - # This method deletes a pending scheduled message before it is sent. + # Deletes a pending scheduled message from the queue. # # @option options [channel] :channel # The channel the scheduled_message is posting to. @@ -61,7 +61,7 @@ def chat_deleteScheduledMessage(options = {}) end # - # Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types. + # Retrieve a permalink URL for a specific extant message # # @option options [channel] :channel # The ID of the conversation or channel containing the message. @@ -77,7 +77,7 @@ def chat_getPermalink(options = {}) end # - # This method sends a me message to a channel from the calling user. + # Share a me message into a channel. # # @option options [channel] :channel # Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name. @@ -92,7 +92,7 @@ def chat_meMessage(options = {}) end # - # This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation. + # Sends an ephemeral message to a user in a channel. # # @option options [Object] :attachments # A JSON-based array of structured attachments, presented as a URL-encoded string. @@ -141,7 +141,7 @@ def chat_postEphemeral(options = {}) end # - # This method posts a message to a public channel, private channel, or direct message/IM channel. + # Sends a message to a channel. # # @option options [channel] :channel # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details. @@ -194,7 +194,7 @@ def chat_postMessage(options = {}) end # - # This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future. + # Schedules a message to be sent to a channel. # # @option options [channel] :channel # Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details. @@ -230,7 +230,7 @@ def chat_scheduleMessage(options = {}) end # - # This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens. + # Provide custom unfurl behavior for user-posted URLs # # @option options [channel] :channel # Channel ID of the message. @@ -255,7 +255,7 @@ def chat_unfurl(options = {}) end # - # This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently. + # Updates a message. # # @option options [channel] :channel # Channel containing the message to be updated. diff --git a/lib/slack/web/api/endpoints/chat_scheduledMessages.rb b/lib/slack/web/api/endpoints/chat_scheduledMessages.rb index 98ff24fc..c0e534c3 100644 --- a/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +++ b/lib/slack/web/api/endpoints/chat_scheduledMessages.rb @@ -7,7 +7,7 @@ module Api module Endpoints module ChatScheduledmessages # - # This method returns a list of pending scheduled messages. + # Returns a list of scheduled messages. # # @option options [channel] :channel # The channel of the scheduled messages. diff --git a/lib/slack/web/api/endpoints/conversations.rb b/lib/slack/web/api/endpoints/conversations.rb index 27070f8b..e70c8dc3 100644 --- a/lib/slack/web/api/endpoints/conversations.rb +++ b/lib/slack/web/api/endpoints/conversations.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Conversations # - # This method archives a conversation. Not all types of conversations can be archived. + # Archives a conversation. # # @option options [channel] :channel # ID of conversation to archive. @@ -20,7 +20,7 @@ def conversations_archive(options = {}) end # - # This Conversations API method closes direct messages, multi-person or 1:1 or otherwise. + # Closes a direct message or multi-person direct message. # # @option options [channel] :channel # Conversation to close. @@ -33,7 +33,7 @@ def conversations_close(options = {}) end # - # Create a public or private channel using this Conversations API method. + # Initiates a public or private channel-based conversation # # @option options [Object] :name # Name of the public or private channel to create. @@ -49,7 +49,7 @@ def conversations_create(options = {}) end # - # This method returns a portion of message events from the specified conversation. + # Fetches a conversation's history of messages and events. # # @option options [channel] :channel # Conversation ID to fetch history for. @@ -78,7 +78,7 @@ def conversations_history(options = {}) end # - # This Conversations API method returns information about a workspace conversation. + # Retrieve information about a conversation. # # @option options [channel] :channel # Conversation ID to learn more about. @@ -95,7 +95,7 @@ def conversations_info(options = {}) end # - # This Conversations API method invites 1-30 users to a public or private channel. The calling user must be a member of the channel. + # Invites users to a channel. # # @option options [channel] :channel # The ID of the public or private channel to invite user(s) to. @@ -111,7 +111,7 @@ def conversations_invite(options = {}) end # - # This Conversations API method joins a user to an existing conversation. + # Joins an existing conversation. # # @option options [channel] :channel # ID of conversation to join. @@ -124,7 +124,7 @@ def conversations_join(options = {}) end # - # This Conversations API method allows a user to remove another member from a channel. + # Removes a user from a conversation. # # @option options [channel] :channel # ID of conversation to remove user from. @@ -141,7 +141,7 @@ def conversations_kick(options = {}) end # - # This Conversations API method makes like a tree and leaves a conversation. + # Leaves a conversation. # # @option options [channel] :channel # Conversation to leave. @@ -154,7 +154,7 @@ def conversations_leave(options = {}) end # - # This Conversations API method returns a list of all channel-like conversations in a workspace. The "channels" returned depend on what the calling token has access to and the directives placed in the types parameter. + # Lists all channels in a Slack team. # # @option options [Object] :cursor # 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. @@ -177,7 +177,7 @@ def conversations_list(options = {}) end # - # This Conversations API method returns a paginated list of members party to a conversation. + # Retrieve members of a conversation. # # @option options [channel] :channel # ID of the conversation to retrieve members for. @@ -200,7 +200,7 @@ def conversations_members(options = {}) end # - # This Conversations API method opens a multi-person direct message or just a 1:1 direct message. + # Opens or resumes a direct message or multi-person direct message. # # @option options [channel] :channel # Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead. @@ -216,7 +216,7 @@ def conversations_open(options = {}) end # - # This method renames a conversation. Some types of conversations cannot be renamed. + # Renames a conversation. # # @option options [channel] :channel # ID of conversation to rename. @@ -232,7 +232,7 @@ def conversations_rename(options = {}) end # - # This Conversations API method returns an entire thread (a message plus all the messages in reply to it), while conversations.history method returns only parent messages. + # Retrieve a thread of messages posted to a conversation # # @option options [channel] :channel # Conversation ID to fetch thread from. @@ -264,7 +264,7 @@ def conversations_replies(options = {}) end # - # This method is used to change the purpose of a conversation. The calling user must be a member of the conversation. Not all conversation types may have a purpose set. + # Sets the purpose for a conversation. # # @option options [channel] :channel # Conversation to set the purpose of. @@ -280,7 +280,7 @@ def conversations_setPurpose(options = {}) end # - # This method is used to change the topic of a conversation. The calling user must be a member of the conversation. Not all conversation types support a new topic. + # Sets the topic for a conversation. # # @option options [channel] :channel # Conversation to set the topic of. @@ -296,7 +296,7 @@ def conversations_setTopic(options = {}) end # - # This method unarchives a conversation. The calling user is added to the conversation. + # Reverses conversation archival. # # @option options [channel] :channel # ID of conversation to unarchive. diff --git a/lib/slack/web/api/endpoints/dialog.rb b/lib/slack/web/api/endpoints/dialog.rb index a4d30e07..5c62fc41 100644 --- a/lib/slack/web/api/endpoints/dialog.rb +++ b/lib/slack/web/api/endpoints/dialog.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Dialog # - # Open a dialog with a user by exchanging a trigger_id received from another interaction. See the dialogs documentation to learn how to obtain triggers define form elements. + # Open a dialog with a user # # @option options [Object] :dialog # The dialog definition. This must be a JSON-encoded string. diff --git a/lib/slack/web/api/endpoints/dnd.rb b/lib/slack/web/api/endpoints/dnd.rb index 2993e144..d7942cb6 100644 --- a/lib/slack/web/api/endpoints/dnd.rb +++ b/lib/slack/web/api/endpoints/dnd.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Dnd # - # Ends the user's currently scheduled Do Not Disturb session immediately. + # Ends the current user's Do Not Disturb session immediately. # # @see https://api.slack.com/methods/dnd.endDnd # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dnd/dnd.endDnd.json @@ -25,7 +25,7 @@ def dnd_endSnooze(options = {}) end # - # Provides information about a user's current Do Not Disturb settings. + # Retrieves a user's current Do Not Disturb status. # # @option options [user] :user # User to fetch status for (defaults to current user). @@ -37,7 +37,7 @@ def dnd_info(options = {}) end # - # Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration. + # Turns on Do Not Disturb mode for the current user, or changes its duration. # # @option options [Object] :num_minutes # Number of minutes, from now, to snooze until. @@ -49,7 +49,7 @@ def dnd_setSnooze(options = {}) end # - # Provides information about the current Do Not Disturb settings for a list of users in a Slack team. + # Retrieves the Do Not Disturb status for up to 50 users on a team. # # @option options [Object] :users # Comma-separated list of users to fetch Do Not Disturb status for. diff --git a/lib/slack/web/api/endpoints/emoji.rb b/lib/slack/web/api/endpoints/emoji.rb index c3d19435..72ce55ce 100644 --- a/lib/slack/web/api/endpoints/emoji.rb +++ b/lib/slack/web/api/endpoints/emoji.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Emoji # - # This method lists the custom emoji for a team. + # Lists custom emoji for a team. # # @see https://api.slack.com/methods/emoji.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/emoji/emoji.list.json diff --git a/lib/slack/web/api/endpoints/files.rb b/lib/slack/web/api/endpoints/files.rb index d6bd2c38..8d2c855a 100644 --- a/lib/slack/web/api/endpoints/files.rb +++ b/lib/slack/web/api/endpoints/files.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Files # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Deletes a file. # # @option options [file] :file # ID of file to delete. @@ -36,7 +36,7 @@ def files_edit(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Gets information about a team file. # # @option options [file] :file # Specify a file by providing its ID. @@ -58,7 +58,7 @@ def files_info(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Lists & filters team files. # # @option options [channel] :channel # Filter files appearing in a specific channel, indicated by its ID. @@ -79,7 +79,7 @@ def files_list(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Revokes public/external sharing access for a file # # @option options [file] :file # File to revoke. @@ -107,7 +107,7 @@ def files_share(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Enables a file for public/external sharing. # # @option options [file] :file # File to share. @@ -119,7 +119,7 @@ def files_sharedPublicURL(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Uploads or creates a file. # # @option options [Object] :channels # Comma-separated list of channel names or IDs where the file will be shared. diff --git a/lib/slack/web/api/endpoints/files_comments.rb b/lib/slack/web/api/endpoints/files_comments.rb index 800a9da4..3dbc8997 100644 --- a/lib/slack/web/api/endpoints/files_comments.rb +++ b/lib/slack/web/api/endpoints/files_comments.rb @@ -7,7 +7,7 @@ module Api module Endpoints module FilesComments # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Deletes an existing comment on a file. # # @option options [file] :file # File to delete a comment from. diff --git a/lib/slack/web/api/endpoints/files_remote.rb b/lib/slack/web/api/endpoints/files_remote.rb index 57a86371..3f651b27 100644 --- a/lib/slack/web/api/endpoints/files_remote.rb +++ b/lib/slack/web/api/endpoints/files_remote.rb @@ -7,7 +7,7 @@ module Api module Endpoints module FilesRemote # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Adds a file from a remote service # # @option options [Object] :external_id # Creator defined GUID for the file. @@ -31,7 +31,7 @@ def files_remote_add(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Retrieve information about a remote file added to Slack # # @option options [Object] :external_id # Creator defined GUID for the file. @@ -44,7 +44,7 @@ def files_remote_info(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Retrieve information about a remote file added to Slack # # @option options [channel] :channel # Filter files appearing in a specific channel, indicated by its ID. @@ -70,7 +70,7 @@ def files_remote_list(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Remove a remote file. # # @option options [Object] :external_id # Creator defined GUID for the file. @@ -83,7 +83,7 @@ def files_remote_remove(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Share a remote file into a channel. # # @option options [Object] :channels # Comma-separated list of channel IDs where the file will be shared. @@ -99,7 +99,7 @@ def files_remote_share(options = {}) end # - # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments. + # Updates an existing remote file. # # @option options [Object] :external_id # Creator defined GUID for the file. diff --git a/lib/slack/web/api/endpoints/groups.rb b/lib/slack/web/api/endpoints/groups.rb index c67cd86b..0ae7429a 100644 --- a/lib/slack/web/api/endpoints/groups.rb +++ b/lib/slack/web/api/endpoints/groups.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Groups # - # This method archives a private channel. + # Archives a private channel. # # @option options [group] :channel # Private channel to archive. @@ -20,7 +20,7 @@ def groups_archive(options = {}) end # - # This method creates a private channel. + # Creates a private channel. # # @option options [Object] :name # Name of private channel to create. @@ -34,11 +34,7 @@ def groups_create(options = {}) end # - # This method takes an existing private channel and performs the following steps: - # - Renames the existing private channel (from "example" to "example-archived"). - # - Archives the existing private channel. - # - Creates a new private channel with the name of the existing private channel. - # - Adds all members of the existing private channel to the new private channel. + # Clones and archives a private channel. # # @option options [group] :channel # Private channel to clone and archive. @@ -51,9 +47,7 @@ def groups_createChild(options = {}) end # - # This method returns a portion of messages/events from the specified private channel. - # To read the entire history for a private channel, call the method with no latest or - # oldest arguments, and then continue paging using the instructions below. + # Fetches history of messages and events from a private channel. # # @option options [group] :channel # Private channel to fetch history for. @@ -74,7 +68,7 @@ def groups_history(options = {}) end # - # Don't use this method. Use conversations.info instead. + # Gets information about a private channel. # # @option options [group] :channel # Private channel to get info on. @@ -89,7 +83,7 @@ def groups_info(options = {}) end # - # This method is used to invite a user to a private channel. The calling user must be a member of the private channel. + # Invites a user to a private channel. # # @option options [group] :channel # Private channel to invite user to. @@ -106,7 +100,7 @@ def groups_invite(options = {}) end # - # This method allows a user to remove another member from a private channel. + # Removes a user from a private channel. # # @option options [group] :channel # Private channel to remove user from. @@ -123,7 +117,7 @@ def groups_kick(options = {}) end # - # This method is used to leave a private channel. + # Leaves a private channel. # # @option options [group] :channel # Private channel to leave. @@ -136,7 +130,7 @@ def groups_leave(options = {}) end # - # Don't use this method. Use conversations.list instead. + # Lists private channels that the calling user has access to. # # @option options [Object] :cursor # 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. @@ -159,7 +153,7 @@ def groups_list(options = {}) end # - # This method moves the read cursor in a private channel. + # Sets the read cursor in a private channel. # # @option options [group] :channel # Private channel to set reading cursor in. @@ -175,7 +169,7 @@ def groups_mark(options = {}) end # - # This method opens a private channel. + # Opens a private channel. # # @option options [group] :channel # Private channel to open. @@ -188,7 +182,7 @@ def groups_open(options = {}) end # - # This method renames a private channel. + # Renames a private channel. # # @option options [group] :channel # Private channel to rename. @@ -206,7 +200,7 @@ def groups_rename(options = {}) end # - # This method returns an entire thread (a message plus all the messages in reply to it). + # Retrieve a thread of messages posted to a private channel # # @option options [group] :channel # Private channel to fetch thread from. @@ -222,7 +216,7 @@ def groups_replies(options = {}) end # - # This method is used to change the purpose of a private channel. The calling user must be a member of the private channel. + # Sets the purpose for a private channel. # # @option options [group] :channel # Private channel to set the purpose of. @@ -238,7 +232,7 @@ def groups_setPurpose(options = {}) end # - # This method is used to change the topic of a private channel. The calling user must be a member of the private channel. + # Sets the topic for a private channel. # # @option options [group] :channel # Private channel to set the topic of. @@ -254,7 +248,7 @@ def groups_setTopic(options = {}) end # - # This method unarchives a private channel. + # Unarchives a private channel. # # @option options [group] :channel # Private channel to unarchive. diff --git a/lib/slack/web/api/endpoints/im.rb b/lib/slack/web/api/endpoints/im.rb index bde0560e..cba8be95 100644 --- a/lib/slack/web/api/endpoints/im.rb +++ b/lib/slack/web/api/endpoints/im.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Im # - # This method closes a direct message channel. + # Close a direct message channel. # # @option options [im] :channel # Direct message channel to close. @@ -20,9 +20,7 @@ def im_close(options = {}) end # - # This method returns a portion of messages/events from the specified direct message channel. - # To read the entire history for a direct message channel, call the method with no latest or - # oldest arguments, and then continue paging using the instructions below. + # Fetches history of messages and events from direct message channel. # # @option options [im] :channel # Direct message channel to fetch history for. @@ -43,7 +41,7 @@ def im_history(options = {}) end # - # Don't use this method. Use conversations.list instead. + # Lists direct message channels for the calling user. # # @option options [Object] :cursor # 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. @@ -62,7 +60,7 @@ def im_list(options = {}) end # - # This method moves the read cursor in a direct message channel. + # Sets the read cursor in a direct message channel. # # @option options [im] :channel # Direct message channel to set reading cursor in. @@ -78,7 +76,7 @@ def im_mark(options = {}) end # - # This method opens a direct message channel with another member of your Slack team. + # Opens a direct message channel. # # @option options [user] :user # User to open a direct message channel with. @@ -95,7 +93,7 @@ def im_open(options = {}) end # - # This method returns an entire thread (a message plus all the messages in reply to it). + # Retrieve a thread of messages posted to a direct message conversation # # @option options [im] :channel # Direct message channel to fetch thread from. diff --git a/lib/slack/web/api/endpoints/migration.rb b/lib/slack/web/api/endpoints/migration.rb index 58a91f78..718f2d12 100644 --- a/lib/slack/web/api/endpoints/migration.rb +++ b/lib/slack/web/api/endpoints/migration.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Migration # - # Easily convert your vintage user IDs to Enterprise Grid-friendly global user IDs. + # For Enterprise Grid workspaces, map local user IDs to global user IDs # # @option options [Object] :users # A comma-separated list of user ids, up to 400 per request. diff --git a/lib/slack/web/api/endpoints/mpim.rb b/lib/slack/web/api/endpoints/mpim.rb index 951bbacb..ae34f854 100644 --- a/lib/slack/web/api/endpoints/mpim.rb +++ b/lib/slack/web/api/endpoints/mpim.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Mpim # - # This method closes a multiparty direct message channel. + # Closes a multiparty direct message channel. # # @option options [channel] :channel # MPIM to close. @@ -20,9 +20,7 @@ def mpim_close(options = {}) end # - # This method returns a portion of messages/events from the specified multiparty direct message channel. - # To read the entire history for a multiparty direct message, call the method with no latest or - # oldest arguments, and then continue paging using the instructions below. + # Fetches history of messages and events from a multiparty direct message. # # @option options [channel] :channel # Multiparty direct message to fetch history for. @@ -43,7 +41,7 @@ def mpim_history(options = {}) end # - # Don't use this method. Use conversations.list instead. + # Lists multiparty direct message channels for the calling user. # # @option options [Object] :cursor # 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. @@ -62,7 +60,7 @@ def mpim_list(options = {}) end # - # This method moves the read cursor in a multiparty direct message channel. + # Sets the read cursor in a multiparty direct message channel. # # @option options [channel] :channel # multiparty direct message channel to set reading cursor in. @@ -90,7 +88,7 @@ def mpim_open(options = {}) end # - # This method returns an entire thread (a message plus all the messages in reply to it). + # Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message. # # @option options [channel] :channel # Multiparty direct message channel to fetch thread from. diff --git a/lib/slack/web/api/endpoints/oauth.rb b/lib/slack/web/api/endpoints/oauth.rb index 12f6a788..7e6294a2 100644 --- a/lib/slack/web/api/endpoints/oauth.rb +++ b/lib/slack/web/api/endpoints/oauth.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Oauth # - # This method allows you to exchange a temporary OAuth code for an API access token. + # Exchanges a temporary OAuth verifier code for an access token. # # @option options [Object] :client_id # Issued when you created your application. @@ -29,7 +29,7 @@ def oauth_access(options = {}) end # - # This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. + # Exchanges a temporary OAuth verifier code for a workspace token. # # @option options [Object] :client_id # Issued when you created your application. diff --git a/lib/slack/web/api/endpoints/pins.rb b/lib/slack/web/api/endpoints/pins.rb index 3a6fe161..2a61d63a 100644 --- a/lib/slack/web/api/endpoints/pins.rb +++ b/lib/slack/web/api/endpoints/pins.rb @@ -7,15 +7,10 @@ module Api module Endpoints module Pins # - # This method pins a channel message or group message to a particular channel. - # The channel argument is required and timestamp must also be specified. + # Pins an item to a channel. # # @option options [channel] :channel # Channel to pin the item in. - # @option options [file] :file - # File to pin. - # @option options [Object] :file_comment - # File comment to pin. # @option options [Object] :timestamp # Timestamp of the message to pin. # @see https://api.slack.com/methods/pins.add @@ -27,7 +22,7 @@ def pins_add(options = {}) end # - # This method lists the items pinned to a channel. + # Lists items pinned to a channel. # # @option options [channel] :channel # Channel to get pinned items for. @@ -40,8 +35,7 @@ def pins_list(options = {}) end # - # This method un-pins an item (file, file comment, channel message, or group message) from a channel. - # The channel argument is required and one of file, file_comment, or timestamp must also be specified. + # Un-pins an item from a channel. # # @option options [channel] :channel # Channel where the item is pinned to. diff --git a/lib/slack/web/api/endpoints/reactions.rb b/lib/slack/web/api/endpoints/reactions.rb index 22a1c9e4..8f809d0b 100644 --- a/lib/slack/web/api/endpoints/reactions.rb +++ b/lib/slack/web/api/endpoints/reactions.rb @@ -7,8 +7,7 @@ module Api module Endpoints module Reactions # - # This method adds a reaction (emoji) to a message. - # Now that file threads work the way you'd expect, the file and file_comment arguments are deprecated. Specify channel and timestamp instead. + # Adds a reaction to an item. # # @option options [Object] :name # Reaction (emoji) name. @@ -29,7 +28,7 @@ def reactions_add(options = {}) end # - # This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message). + # Gets reactions for an item. # # @option options [channel] :channel # Channel where the message to get reactions for was posted. @@ -49,7 +48,7 @@ def reactions_get(options = {}) end # - # This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user. + # Lists reactions made by a user. # # @option options [Object] :cursor # 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. @@ -73,8 +72,7 @@ def reactions_list(options = {}) end # - # This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message). - # One of file, file_comment, or the combination of channel and timestamp must be specified. + # Removes a reaction from an item. # # @option options [Object] :name # Reaction (emoji) name. diff --git a/lib/slack/web/api/endpoints/reminders.rb b/lib/slack/web/api/endpoints/reminders.rb index cb1ee8c6..c1c48ded 100644 --- a/lib/slack/web/api/endpoints/reminders.rb +++ b/lib/slack/web/api/endpoints/reminders.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Reminders # - # This method creates a reminder. + # Creates a reminder. # # @option options [Object] :text # The content of the reminder. @@ -25,7 +25,7 @@ def reminders_add(options = {}) end # - # This method completes a reminder. + # Marks a reminder as complete. # # @option options [Object] :reminder # The ID of the reminder to be marked as complete. @@ -37,7 +37,7 @@ def reminders_complete(options = {}) end # - # This method deletes a reminder. + # Deletes a reminder. # # @option options [Object] :reminder # The ID of the reminder. @@ -49,7 +49,7 @@ def reminders_delete(options = {}) end # - # This method returns information about a reminder. + # Gets information about a reminder. # # @option options [Object] :reminder # The ID of the reminder. @@ -61,7 +61,7 @@ def reminders_info(options = {}) end # - # This method lists all reminders created by or for a given user. + # Lists all reminders created by or for a given user. # # @see https://api.slack.com/methods/reminders.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.list.json diff --git a/lib/slack/web/api/endpoints/rtm.rb b/lib/slack/web/api/endpoints/rtm.rb index f80cdbb8..c9fb3032 100644 --- a/lib/slack/web/api/endpoints/rtm.rb +++ b/lib/slack/web/api/endpoints/rtm.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Rtm # - # This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket. + # Starts a Real Time Messaging session. # # @option options [Object] :batch_presence_aware # Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence. @@ -20,7 +20,7 @@ def rtm_connect(options = {}) end # - # This method begins a Real Time Messaging API session and reserves your application a specific URL with which to connect via websocket. + # Starts a Real Time Messaging session. # # @option options [Object] :batch_presence_aware # Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence. diff --git a/lib/slack/web/api/endpoints/search.rb b/lib/slack/web/api/endpoints/search.rb index b0066ed0..3ec916f6 100644 --- a/lib/slack/web/api/endpoints/search.rb +++ b/lib/slack/web/api/endpoints/search.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Search # - # This method allows users and applications to search both messages and files in a single call. + # Searches for messages and files matching a query. # # @option options [Object] :query # Search query. May contains booleans, etc. @@ -25,7 +25,7 @@ def search_all(options = {}) end # - # This method returns files matching a search query. + # Searches for files matching a query. # # @option options [Object] :query # Search query. @@ -43,7 +43,7 @@ def search_files(options = {}) end # - # This method returns messages matching a search query. + # Searches for messages matching a query. # # @option options [Object] :query # Search query. diff --git a/lib/slack/web/api/endpoints/stars.rb b/lib/slack/web/api/endpoints/stars.rb index 07861df9..4d2b85c6 100644 --- a/lib/slack/web/api/endpoints/stars.rb +++ b/lib/slack/web/api/endpoints/stars.rb @@ -7,8 +7,7 @@ module Api module Endpoints module Stars # - # This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. - # One of file, file_comment, channel, or the combination of channel and timestamp must be specified. + # Adds a star to an item. # # @option options [channel] :channel # Channel to add star to, or channel where the message to add star to was posted (used with timestamp). @@ -26,7 +25,7 @@ def stars_add(options = {}) end # - # This method lists the items starred by the authed user. + # Lists stars for a user. # # @option options [Object] :cursor # 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. @@ -45,8 +44,7 @@ def stars_list(options = {}) end # - # This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. - # One of file, file_comment, channel, or the combination of channel and timestamp must be specified. + # Removes a star from an item. # # @option options [channel] :channel # Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp). diff --git a/lib/slack/web/api/endpoints/team.rb b/lib/slack/web/api/endpoints/team.rb index fb1a4b32..cb596868 100644 --- a/lib/slack/web/api/endpoints/team.rb +++ b/lib/slack/web/api/endpoints/team.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Team # - # This method is used to retrieve the "access logs" for users on a workspace. + # Gets the access logs for the current team. # # @option options [Object] :before # End of time range of logs to include in results (inclusive). @@ -18,8 +18,7 @@ def team_accessLogs(options = {}) end # - # This method lists billable information for each user on the team. Currently this consists solely of whether the user is - # subject to billing per Slack's Fair Billing policy. + # Gets billable users information for the current team. # # @option options [user] :user # A user to retrieve the billable information for. Defaults to all users. @@ -31,7 +30,7 @@ def team_billableInfo(options = {}) end # - # This method provides information about your team. + # Gets information about the current team. # # @option options [Object] :team # Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels. @@ -42,7 +41,7 @@ def team_info(options = {}) end # - # This method lists the integration activity logs for a team, including when integrations are added, modified and removed. This method can only be called by Admins. + # Gets the integration logs for the current team. # # @option options [Object] :app_id # Filter logs to this Slack app. Defaults to all logs. diff --git a/lib/slack/web/api/endpoints/team_profile.rb b/lib/slack/web/api/endpoints/team_profile.rb index 15b3ca28..0830f835 100644 --- a/lib/slack/web/api/endpoints/team_profile.rb +++ b/lib/slack/web/api/endpoints/team_profile.rb @@ -7,7 +7,7 @@ module Api module Endpoints module TeamProfile # - # This method is used to get the profile field definitions for this team. + # Retrieve a team's profile. # # @option options [Object] :visibility # Filter by visibility. diff --git a/lib/slack/web/api/endpoints/usergroups.rb b/lib/slack/web/api/endpoints/usergroups.rb index 046e0f31..4d8cabd2 100644 --- a/lib/slack/web/api/endpoints/usergroups.rb +++ b/lib/slack/web/api/endpoints/usergroups.rb @@ -7,7 +7,7 @@ module Api module Endpoints module Usergroups # - # This method is used to create a User Group. + # Create a User Group # # @option options [Object] :name # A name for the User Group. Must be unique among User Groups. @@ -27,7 +27,7 @@ def usergroups_create(options = {}) end # - # This method disables an existing User Group. + # Disable an existing User Group # # @option options [Object] :usergroup # The encoded ID of the User Group to disable. @@ -41,7 +41,7 @@ def usergroups_disable(options = {}) end # - # This method enables a User Group which was previously disabled. + # Enable a User Group # # @option options [Object] :usergroup # The encoded ID of the User Group to enable. @@ -55,7 +55,7 @@ def usergroups_enable(options = {}) end # - # This method returns a list of all User Groups in the team. This can optionally include disabled User Groups. + # List all User Groups for a team # # @option options [Object] :include_count # Include the number of users in each User Group. @@ -70,7 +70,7 @@ def usergroups_list(options = {}) end # - # This method updates the properties of an existing User Group. + # Update an existing User Group # # @option options [Object] :usergroup # The encoded ID of the User Group to update. diff --git a/lib/slack/web/api/endpoints/usergroups_users.rb b/lib/slack/web/api/endpoints/usergroups_users.rb index 1ee7c512..b1add089 100644 --- a/lib/slack/web/api/endpoints/usergroups_users.rb +++ b/lib/slack/web/api/endpoints/usergroups_users.rb @@ -7,7 +7,7 @@ module Api module Endpoints module UsergroupsUsers # - # This method returns a list of all users within a User Group. + # List all users in a User Group # # @option options [Object] :usergroup # The encoded ID of the User Group to update. @@ -21,7 +21,7 @@ def usergroups_users_list(options = {}) end # - # This method updates the list of users that belong to a User Group. This method replaces all users in a User Group with the list of users provided in the users parameter. + # Update the list of users for a User Group # # @option options [Object] :usergroup # The encoded ID of the User Group to update. diff --git a/lib/slack/web/api/endpoints/users.rb b/lib/slack/web/api/endpoints/users.rb index 3ab7734f..c89cd803 100644 --- a/lib/slack/web/api/endpoints/users.rb +++ b/lib/slack/web/api/endpoints/users.rb @@ -7,11 +7,7 @@ module Api module Endpoints module Users # - # This method helps answer questions like: - # - Which conversations am I a member of? - # - Which public channels is my bot user in? - # - Do I have any direct messages open with my friend Suzy? - # - Is my bot a member of any private channels? + # List conversations the calling user may access. # # @option options [Object] :cursor # 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. @@ -37,7 +33,7 @@ def users_conversations(options = {}) end # - # This method allows the user to delete their profile image. It will clear whatever image is currently set. + # Delete the user profile photo # # @see https://api.slack.com/methods/users.deletePhoto # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.deletePhoto.json @@ -46,8 +42,7 @@ def users_deletePhoto(options = {}) end # - # This method lets you find out information about a user's presence. - # Consult the presence documentation for more details. + # Gets user presence information. # # @option options [user] :user # User to get presence info on. Defaults to the authed user. @@ -60,7 +55,7 @@ def users_getPresence(options = {}) end # - # After your Slack app is awarded an identity token through Sign in with Slack, use this method to retrieve a user's identity. + # Get a user's identity. # # @see https://api.slack.com/methods/users.identity # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.identity.json @@ -69,7 +64,7 @@ def users_identity(options = {}) end # - # This method returns information about a member of a workspace. + # Gets information about a user. # # @option options [user] :user # User to get info on. @@ -84,7 +79,7 @@ def users_info(options = {}) end # - # This method returns a list of all users in the workspace. This includes deleted/deactivated users. + # Lists all users in a Slack team. # # @option options [Object] :cursor # 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. @@ -105,7 +100,7 @@ def users_list(options = {}) end # - # Retrieve a single user by looking them up by their registered email address. Requires users:read.email. + # Find a user with an email address. # # @option options [Object] :email # An email address belonging to a user in the workspace. @@ -117,7 +112,7 @@ def users_lookupByEmail(options = {}) end # - # This method is no longer functional and the behavior it controlled is no longer offered. The method will no longer exist beginning May 8, 2018. + # Marked a user as active. Deprecated and non-functional. # # @see https://api.slack.com/methods/users.setActive # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setActive.json @@ -126,7 +121,7 @@ def users_setActive(options = {}) end # - # This method allows the user to set their profile image. The caller can pass image data via image. + # Set the user profile photo # # @option options [Object] :image # File contents via multipart/form-data. @@ -144,8 +139,7 @@ def users_setPhoto(options = {}) end # - # This method lets you set the calling user's manual presence. - # Consult the presence documentation for more details. + # Manually sets user presence. # # @option options [Object] :presence # Either auto or away. diff --git a/lib/slack/web/api/endpoints/users_profile.rb b/lib/slack/web/api/endpoints/users_profile.rb index fe02a73a..637617e6 100644 --- a/lib/slack/web/api/endpoints/users_profile.rb +++ b/lib/slack/web/api/endpoints/users_profile.rb @@ -7,7 +7,7 @@ module Api module Endpoints module UsersProfile # - # Use this method to retrieve a user's profile information. + # Retrieves a user's profile information. # # @option options [Object] :include_labels # Include labels for each ID in custom profile fields. @@ -21,7 +21,7 @@ def users_profile_get(options = {}) end # - # Use this method to set a user's profile information, including name, email, current status, and other attributes. + # Set the profile information for a user. # # @option options [Object] :name # Name of a single key to set. Usable only if profile is not passed. diff --git a/lib/slack/web/api/endpoints/views.rb b/lib/slack/web/api/endpoints/views.rb new file mode 100644 index 00000000..10de15cd --- /dev/null +++ b/lib/slack/web/api/endpoints/views.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module Views + # + # Open a view for a user. + # + # @option options [Object] :trigger_id + # Exchange a trigger to post to the user. + # @option options [Object] :view + # The view payload. This must be a JSON-encoded string. + # @see https://api.slack.com/methods/views.open + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.open.json + def views_open(options = {}) + throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil? + throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? + if options.key?(:view) + view = options[:view] + view = JSON.dump(view) unless view.is_a?(String) + options = options.merge(view: view) + end + post('views.open', options) + end + + # + # Push a view onto the stack of a root view. + # + # @option options [Object] :trigger_id + # Exchange a trigger to post to the user. + # @option options [Object] :view + # The view payload. This must be a JSON-encoded string. + # @see https://api.slack.com/methods/views.push + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.push.json + def views_push(options = {}) + throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil? + throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? + if options.key?(:view) + view = options[:view] + view = JSON.dump(view) unless view.is_a?(String) + options = options.merge(view: view) + end + post('views.push', options) + end + + # + # Update an existing view. + # + # @option options [Object] :view + # The view payload. This must be a JSON-encoded string. + # @option options [Object] :external_id + # A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required. + # @option options [Object] :hash + # A string that represents view state to protect against possible race conditions. + # @option options [Object] :view_id + # A unique identifier of the view to be updated. Either view_id or external_id is required. + # @see https://api.slack.com/methods/views.update + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.update.json + def views_update(options = {}) + throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? + if options.key?(:view) + view = options[:view] + view = JSON.dump(view) unless view.is_a?(String) + options = options.merge(view: view) + end + post('views.update', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/patches/views.1.view-json.patch b/lib/slack/web/api/patches/views.1.view-json.patch new file mode 100644 index 00000000..f5fd347d --- /dev/null +++ b/lib/slack/web/api/patches/views.1.view-json.patch @@ -0,0 +1,40 @@ +diff --git a/lib/slack/web/api/endpoints/views.rb b/lib/slack/web/api/endpoints/views.rb +index 3d7ac8e..10de15c 100644 +--- a/lib/slack/web/api/endpoints/views.rb ++++ b/lib/slack/web/api/endpoints/views.rb +@@ -18,6 +18,11 @@ module Slack + def views_open(options = {}) + throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil? + throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? ++ if options.key?(:view) ++ view = options[:view] ++ view = JSON.dump(view) unless view.is_a?(String) ++ options = options.merge(view: view) ++ end + post('views.open', options) + end + +@@ -33,6 +38,11 @@ module Slack + def views_push(options = {}) + throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil? + throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? ++ if options.key?(:view) ++ view = options[:view] ++ view = JSON.dump(view) unless view.is_a?(String) ++ options = options.merge(view: view) ++ end + post('views.push', options) + end + +@@ -51,6 +61,11 @@ module Slack + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.update.json + def views_update(options = {}) + throw ArgumentError.new('Required arguments :view missing') if options[:view].nil? ++ if options.key?(:view) ++ view = options[:view] ++ view = JSON.dump(view) unless view.is_a?(String) ++ options = options.merge(view: view) ++ end + post('views.update', options) + end + end diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 000f8c7b..37b4eec7 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 000f8c7ba4ca0cc798dbbde316ad83a0aa58013b +Subproject commit 37b4eec7cfaca973f383e1bfeb0449b997ddba4e diff --git a/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb b/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb new file mode 100644 index 00000000..59cd8146 --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminAppsRequests do + let(:client) { Slack::Web::Client.new } +end diff --git a/spec/slack/web/api/endpoints/admin_apps_spec.rb b/spec/slack/web/api/endpoints/admin_apps_spec.rb new file mode 100644 index 00000000..52d1772c --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_apps_spec.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminApps do + let(:client) { Slack::Web::Client.new } +end diff --git a/spec/slack/web/api/endpoints/custom_specs/views_spec.rb b/spec/slack/web/api/endpoints/custom_specs/views_spec.rb new file mode 100644 index 00000000..b9f2205b --- /dev/null +++ b/spec/slack/web/api/endpoints/custom_specs/views_spec.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::Views do + let(:client) { Slack::Web::Client.new } + let(:trigger_id) { '12345.98765.abcd2358fdea' } + + describe 'views_open' do + context 'with a hash for view' do + let(:view_str) { '{"celery":"man"}' } + + it 'automatically converts view into JSON' do + expect(client).to receive(:post).with('views.open', trigger_id: trigger_id, view: view_str) + client.views_open(trigger_id: trigger_id, view: { celery: 'man' }) + end + end + + context 'with a string for view' do + let(:view_str) { 'celery man' } + + it 'leaves view as is' do + expect(client).to receive(:post).with('views.open', trigger_id: trigger_id, view: view_str) + client.views_open(trigger_id: trigger_id, view: 'celery man') + end + end + end + + describe 'views_push' do + context 'with a hash for view' do + let(:view_str) { '{"celery":"man"}' } + + it 'automatically converts view into JSON' do + expect(client).to receive(:post).with('views.push', trigger_id: trigger_id, view: view_str) + client.views_push(trigger_id: trigger_id, view: { celery: 'man' }) + end + end + + context 'with a string for view' do + let(:view_str) { 'celery man' } + + it 'leaves view as is' do + expect(client).to receive(:post).with('views.push', trigger_id: trigger_id, view: view_str) + client.views_push(trigger_id: trigger_id, view: 'celery man') + end + end + end + + describe 'views_update' do + context 'with a hash for view' do + let(:view_str) { '{"celery":"man"}' } + + it 'automatically converts view into JSON' do + expect(client).to receive(:post).with('views.update', view: view_str) + client.views_update(view: { celery: 'man' }) + end + end + + context 'with a string for view' do + let(:view_str) { 'celery man' } + + it 'leaves view as is' do + expect(client).to receive(:post).with('views.update', view: view_str) + client.views_update(view: 'celery man') + end + end + end +end diff --git a/spec/slack/web/api/endpoints/views_spec.rb b/spec/slack/web/api/endpoints/views_spec.rb new file mode 100644 index 00000000..b12b2621 --- /dev/null +++ b/spec/slack/web/api/endpoints/views_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::Views do + let(:client) { Slack::Web::Client.new } + context 'views_open' do + it 'requires trigger_id' do + expect { client.views_open(view: ' ') }.to raise_error ArgumentError, /Required arguments :trigger_id missing/ + end + it 'requires view' do + expect { client.views_open(trigger_id: '12345.98765.abcd2358fdea') }.to raise_error ArgumentError, /Required arguments :view missing/ + end + end + context 'views_push' do + it 'requires trigger_id' do + expect { client.views_push(view: ' ') }.to raise_error ArgumentError, /Required arguments :trigger_id missing/ + end + it 'requires view' do + expect { client.views_push(trigger_id: '12345.98765.abcd2358fdea') }.to raise_error ArgumentError, /Required arguments :view missing/ + end + end + context 'views_update' do + it 'requires view' do + expect { client.views_update }.to raise_error ArgumentError, /Required arguments :view missing/ + end + end +end