diff --git a/CHANGELOG.md b/CHANGELOG.md index f4ce8e3b..75aaf84a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ### 0.16.0 (Next) -* [#348](https://github.com/slack-ruby/slack-ruby-client/pull/348): Added `admin_conversations_archive`, `admin_conversations_convertToPrivate`, `admin_conversations_create`, `admin_conversations_delete`, `admin_conversations_disconnectShared`, `admin_conversations_getConversationPrefs`, `admin_conversations_getTeams`, `admin_conversations_invite`, `admin_conversations_rename`, `admin_conversations_search`, `admin_conversations_setConversationPrefs`, `admin_conversations_unarchive`, `admin_conversations_ekm_listOriginalConnectedChannelInfo`, `admin_users_session_invalidate`, `apps_event_authorizations_list`, `conversations_mark`, `workflows_stepCompleted`, `workflows_stepFailed`, `workflows_updateStep` endpoints - [@wasabigeek](https://github.com/wasabigeek). * [#350](https://github.com/slack-ruby/slack-ruby-client/pull/350): Handle server errors such as timouts & non-json responses (see [Upgrading to 0.16.0](UPGRADING.md#upgrading-to--0160)) - [@ojab](https://github.com/ojab). * [#354](https://github.com/slack-ruby/slack-ruby-client/pull/354): Rewind body after checking request signature - [@sunny](https://github.com/sunny). -* [#355](https://github.com/slack-ruby/slack-ruby-client/pull/355): Remove celluloid code - [@wasabigeek](https://github.com/wasabigeek). +* [#355](https://github.com/slack-ruby/slack-ruby-client/pull/355): Removed celluloid concurrency support - [@wasabigeek](https://github.com/wasabigeek). +* [#356](https://github.com/slack-ruby/slack-ruby-client/pull/356): Added `admin_apps_clearResolution`, `admin_conversations_getCustomRetention`, `admin_conversations_removeCustomRetention`, `admin_conversations_setCustomRetention` and `admin_users_session_list` endpoints - [@dblock](https://github.com/dblock). +* [#348](https://github.com/slack-ruby/slack-ruby-client/pull/348): Added `admin_conversations_archive`, `admin_conversations_convertToPrivate`, `admin_conversations_create`, `admin_conversations_delete`, `admin_conversations_disconnectShared`, `admin_conversations_getConversationPrefs`, `admin_conversations_getTeams`, `admin_conversations_invite`, `admin_conversations_rename`, `admin_conversations_search`, `admin_conversations_setConversationPrefs`, `admin_conversations_unarchive`, `admin_conversations_ekm_listOriginalConnectedChannelInfo`, `admin_users_session_invalidate`, `apps_event_authorizations_list`, `conversations_mark`, `workflows_stepCompleted`, `workflows_stepFailed` and `workflows_updateStep` endpoints - [@wasabigeek](https://github.com/wasabigeek). * Your contribution here. ### 0.15.1 (2020/9/3) diff --git a/bin/commands.rb b/bin/commands.rb index 1a6c0b62..005e4f8d 100644 --- a/bin/commands.rb +++ b/bin/commands.rb @@ -1,10 +1,12 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake +require 'commands/admin_analytics' require 'commands/admin_apps' require 'commands/admin_apps_approved' require 'commands/admin_apps_requests' require 'commands/admin_apps_restricted' +require 'commands/admin_barriers' require 'commands/admin_conversations' require 'commands/admin_conversations_ekm' require 'commands/admin_conversations_restrictAccess' @@ -22,12 +24,14 @@ require 'commands/admin_users_session' require 'commands/api' require 'commands/apps' +require 'commands/apps_connections' require 'commands/apps_event_authorizations' require 'commands/apps_permissions' require 'commands/apps_permissions_resources' require 'commands/apps_permissions_scopes' require 'commands/apps_permissions_users' require 'commands/auth' +require 'commands/auth_teams' require 'commands/bots' require 'commands/calls' require 'commands/calls_participants' diff --git a/bin/commands/admin_analytics.rb b/bin/commands/admin_analytics.rb new file mode 100644 index 00000000..9b6c438d --- /dev/null +++ b/bin/commands/admin_analytics.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'AdminAnalytics methods.' +command 'admin_analytics' do |g| + g.desc 'Retrieve analytics data for a given date, presented as a compressed JSON file' + g.long_desc %( Retrieve analytics data for a given date, presented as a compressed JSON file ) + g.command 'getFile' do |c| + c.flag 'type', desc: 'The type of analytics to retrieve. The options are currently limited to member.' + c.flag 'date', desc: 'Date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_analytics_getFile(options)) + end + end +end diff --git a/bin/commands/admin_apps.rb b/bin/commands/admin_apps.rb index 7bf16ab2..bf46cb0c 100644 --- a/bin/commands/admin_apps.rb +++ b/bin/commands/admin_apps.rb @@ -7,19 +7,32 @@ 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 'enterprise_id', desc: 'The ID of the enterprise to approve the app on.' c.flag 'request_id', desc: 'The id of the request to approve.' - c.flag 'team_id', desc: '.' + c.flag 'team_id', desc: 'The ID of the workspace to approve the app on.' c.action do |_global_options, options, _args| puts JSON.dump($client.admin_apps_approve(options)) end end + g.desc 'Clear an app resolution' + g.long_desc %( Clear an app resolution ) + g.command 'clearResolution' do |c| + c.flag 'app_id', desc: 'The id of the app whose resolution you want to clear/undo.' + c.flag 'enterprise_id', desc: 'The enterprise to clear the app resolution from.' + c.flag 'team_id', desc: 'The workspace to clear the app resolution from.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_apps_clearResolution(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 'enterprise_id', desc: 'The ID of the enterprise to approve the app on.' c.flag 'request_id', desc: 'The id of the request to restrict.' - c.flag 'team_id', desc: '.' + c.flag 'team_id', desc: 'The ID of the workspace to approve the app on.' c.action do |_global_options, options, _args| puts JSON.dump($client.admin_apps_restrict(options)) end diff --git a/bin/commands/admin_barriers.rb b/bin/commands/admin_barriers.rb new file mode 100644 index 00000000..c1d183cd --- /dev/null +++ b/bin/commands/admin_barriers.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'AdminBarriers methods.' +command 'admin_barriers' do |g| + g.desc 'Create an Information Barrier' + g.long_desc %( Create an Information Barrier ) + g.command 'create' do |c| + c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.' + c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.' + c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_barriers_create(options)) + end + end + + g.desc 'Delete an existing Information Barrier' + g.long_desc %( Delete an existing Information Barrier ) + g.command 'delete' do |c| + c.flag 'barrier_id', desc: "The ID of the barrier you're trying to delete." + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_barriers_delete(options)) + end + end + + g.desc 'Get all Information Barriers for your organization' + g.long_desc %( Get all Information Barriers for your organization ) + 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.action do |_global_options, options, _args| + puts JSON.dump($client.admin_barriers_list(options)) + end + end + + g.desc 'Update an existing Information Barrier' + g.long_desc %( Update an existing Information Barrier ) + g.command 'update' do |c| + c.flag 'barrier_id', desc: "The ID of the barrier you're trying to modify." + c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.' + c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.' + c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_barriers_update(options)) + end + end +end diff --git a/bin/commands/admin_conversations.rb b/bin/commands/admin_conversations.rb index b59b5ed1..3b643520 100644 --- a/bin/commands/admin_conversations.rb +++ b/bin/commands/admin_conversations.rb @@ -62,6 +62,15 @@ end end + g.desc "This API endpoint can be used by any admin to get a channel's retention policy." + g.long_desc %( This API endpoint can be used by any admin to get a channel's retention policy. ) + g.command 'getCustomRetention' do |c| + c.flag 'channel_id', desc: 'The channel to get the retention policy for.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_conversations_getCustomRetention(options)) + end + end + g.desc 'Get all the workspaces a given public or private channel is connected to within this Enterprise org.' g.long_desc %( Get all the workspaces a given public or private channel is connected to within this Enterprise org. ) g.command 'getTeams' do |c| @@ -83,6 +92,15 @@ end end + g.desc "This API endpoint can be used by any admin to remove a channel's retention policy." + g.long_desc %( This API endpoint can be used by any admin to remove a channel's retention policy. ) + g.command 'removeCustomRetention' do |c| + c.flag 'channel_id', desc: 'The channel to set the retention policy for.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_conversations_removeCustomRetention(options)) + end + end + g.desc 'Rename a public or private channel.' g.long_desc %( Rename a public or private channel. ) g.command 'rename' do |c| @@ -118,6 +136,16 @@ end end + g.desc "This API endpoint can be used by any admin to set a channel's retention policy." + g.long_desc %( This API endpoint can be used by any admin to set a channel's retention policy. ) + g.command 'setCustomRetention' do |c| + c.flag 'channel_id', desc: 'The channel to set the retention policy for.' + c.flag 'duration_days', desc: 'The message retention duration in days to set for this channel.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_conversations_setCustomRetention(options)) + end + end + g.desc 'Set the workspaces in an Enterprise grid org that connect to a public or private channel.' g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a public or private channel. ) g.command 'setTeams' do |c| diff --git a/bin/commands/admin_conversations_restrictAccess.rb b/bin/commands/admin_conversations_restrictAccess.rb index 1c142f7b..48c00207 100644 --- a/bin/commands/admin_conversations_restrictAccess.rb +++ b/bin/commands/admin_conversations_restrictAccess.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'AdminConversationsRestrictaccess methods.' +desc 'Add and remove user groups from conversations.' command 'admin_conversations_restrictAccess' do |g| g.desc 'Add an allowlist of IDP groups for accessing a channel' g.long_desc %( Add an allowlist of IDP groups for accessing a channel ) diff --git a/bin/commands/admin_conversations_whitelist.rb b/bin/commands/admin_conversations_whitelist.rb index 441433d6..8314f0c4 100644 --- a/bin/commands/admin_conversations_whitelist.rb +++ b/bin/commands/admin_conversations_whitelist.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'AdminConversationsWhitelist methods.' +desc 'Add and remove user groups from conversations. Use admin.conversations.* equivalents instead.' command 'admin_conversations_whitelist' do |g| g.desc 'Add an allowlist of IDP groups for accessing a channel' g.long_desc %( Add an allowlist of IDP groups for accessing a channel ) diff --git a/bin/commands/admin_emoji.rb b/bin/commands/admin_emoji.rb index 7cf9574d..589a8dac 100644 --- a/bin/commands/admin_emoji.rb +++ b/bin/commands/admin_emoji.rb @@ -6,7 +6,7 @@ g.desc 'Add an emoji.' g.long_desc %( Add an emoji. ) g.command 'add' do |c| - c.flag 'name', desc: 'The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.' + c.flag 'name', desc: 'The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included.' c.flag 'url', desc: 'The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.' c.action do |_global_options, options, _args| puts JSON.dump($client.admin_emoji_add(options)) diff --git a/bin/commands/admin_usergroups.rb b/bin/commands/admin_usergroups.rb index 13b84a0f..4116fd68 100644 --- a/bin/commands/admin_usergroups.rb +++ b/bin/commands/admin_usergroups.rb @@ -3,8 +3,8 @@ desc 'AdminUsergroups methods.' command 'admin_usergroups' do |g| - g.desc 'Add one or more default channels to an IDP group.' - g.long_desc %( Add one or more default channels to an IDP group. ) + g.desc 'Add up to one hundred default channels to an IDP group.' + g.long_desc %( Add up to one hundred default channels to an IDP group. ) g.command 'addChannels' do |c| c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.' c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.' diff --git a/bin/commands/admin_users.rb b/bin/commands/admin_users.rb index eec3c563..f74ee22b 100644 --- a/bin/commands/admin_users.rb +++ b/bin/commands/admin_users.rb @@ -36,9 +36,9 @@ g.desc 'List users on a workspace' g.long_desc %( List users on a workspace ) g.command 'list' do |c| - c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' 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: 'Limit for how many users to be retrieved per page.' + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' c.action do |_global_options, options, _args| puts JSON.dump($client.admin_users_list(options)) end @@ -68,8 +68,8 @@ g.long_desc %( Set an expiration for a guest user ) g.command 'setExpiration' do |c| c.flag 'expiration_ts', desc: 'Timestamp when guest account should be disabled.' - c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' c.flag 'user_id', desc: 'The ID of the user to set an expiration for.' + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' c.action do |_global_options, options, _args| puts JSON.dump($client.admin_users_setExpiration(options)) end diff --git a/bin/commands/admin_users_session.rb b/bin/commands/admin_users_session.rb index dde35eb8..442d5d01 100644 --- a/bin/commands/admin_users_session.rb +++ b/bin/commands/admin_users_session.rb @@ -3,16 +3,28 @@ desc 'AdminUsersSession methods.' command 'admin_users_session' do |g| - g.desc 'Invalidate a single session for a user by session_id' - g.long_desc %( Invalidate a single session for a user by session_id ) + g.desc 'Revoke a single session for a user. The user will be forced to login to Slack.' + g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. ) g.command 'invalidate' do |c| - c.flag 'session_id', desc: '.' - c.flag 'team_id', desc: 'ID of the team that the session belongs to.' + c.flag 'session_id', desc: 'ID of the session to invalidate.' + c.flag 'team_id', desc: 'ID of the workspace that the session belongs to.' c.action do |_global_options, options, _args| puts JSON.dump($client.admin_users_session_invalidate(options)) end end + g.desc 'List active user sessions for an organization' + g.long_desc %( List active user sessions for an organization ) + 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: "The ID of the workspace you'd like active sessions for. If you pass a team_id, you'll need to pass a user_id as well." + c.flag 'user_id', desc: "The ID of user you'd like active sessions for. If you pass a user_id, you'll need to pass a team_id as well." + c.action do |_global_options, options, _args| + puts JSON.dump($client.admin_users_session_list(options)) + end + end + 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| diff --git a/bin/commands/api.rb b/bin/commands/api.rb index 9b66ffeb..824f6c14 100644 --- a/bin/commands/api.rb +++ b/bin/commands/api.rb @@ -7,7 +7,6 @@ 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.' c.action do |_global_options, options, _args| puts JSON.dump($client.api_test(options)) end diff --git a/bin/commands/apps_connections.rb b/bin/commands/apps_connections.rb new file mode 100644 index 00000000..1a3bd3b3 --- /dev/null +++ b/bin/commands/apps_connections.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'AppsConnections methods.' +command 'apps_connections' do |g| + g.desc 'Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over,' + g.long_desc %( Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over, ) + g.command 'open' do |c| + c.action do |_global_options, options, _args| + puts JSON.dump($client.apps_connections_open(options)) + end + end +end diff --git a/bin/commands/auth_teams.rb b/bin/commands/auth_teams.rb new file mode 100644 index 00000000..c12894d0 --- /dev/null +++ b/bin/commands/auth_teams.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +desc 'AuthTeams methods.' +command 'auth_teams' do |g| + g.desc 'List the workspaces a token can access.' + g.long_desc %( List the workspaces a token can access. ) + 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 'include_icon', desc: 'Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace.' + c.flag 'limit', desc: 'The maximum number of workspaces to return. Must be a positive integer no larger than 1000.' + c.action do |_global_options, options, _args| + puts JSON.dump($client.auth_teams_list(options)) + end + end +end diff --git a/bin/commands/bots.rb b/bin/commands/bots.rb index 165579df..b1ce5e83 100644 --- a/bin/commands/bots.rb +++ b/bin/commands/bots.rb @@ -7,6 +7,7 @@ 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.flag 'team_id', desc: 'encoded team id or enterprise id where the bot exists, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.bots_info(options)) end diff --git a/bin/commands/channels.rb b/bin/commands/channels.rb index 3c202434..6c6960fa 100644 --- a/bin/commands/channels.rb +++ b/bin/commands/channels.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Channels methods.' +desc "Get info on your team's Slack channels, create or archive channels, invite users, set the topic and purpose, and mark a channel as read." command 'channels' do |g| g.desc 'Archives a channel.' g.long_desc %( Archives a channel. ) @@ -16,6 +16,7 @@ g.long_desc %( Creates a channel. ) g.command 'create' do |c| c.flag 'name', desc: 'Name of channel to create.' + c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.' c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.' c.action do |_global_options, options, _args| puts JSON.dump($client.channels_create(options)) @@ -77,6 +78,7 @@ 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 'team_id', desc: 'encoded team id to list channels in, required if org token is used.' c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.' c.action do |_global_options, options, _args| puts JSON.dump($client.channels_join(options)) @@ -109,6 +111,7 @@ c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.' c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.' 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." + c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.channels_list(options)) end @@ -117,8 +120,8 @@ 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.' + c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.' + c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.' c.action do |_global_options, options, _args| puts JSON.dump($client.channels_mark(options)) end diff --git a/bin/commands/chat.rb b/bin/commands/chat.rb index 9f4a6c61..5be0dda3 100644 --- a/bin/commands/chat.rb +++ b/bin/commands/chat.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Chat methods.' +desc 'Post chat messages to Slack.' command 'chat' do |g| g.desc 'Execute a slash command in a public channel (undocumented)' g.long_desc %( Execute a slash command in a public channel ) @@ -84,8 +84,8 @@ c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.' c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.' c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.' - c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.' - c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.' + c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. See authorship below. Use with bot tokens requires chat:write.customize.' + c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. See authorship below. Use with bot tokens requires chat:write.customize.' c.flag 'link_names', desc: 'Find and link channel names and usernames.' c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.' c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.' @@ -93,7 +93,7 @@ c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead." c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.' c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.' - c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below." + c.flag 'username', desc: "Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize." c.action do |_global_options, options, _args| puts JSON.dump($client.chat_postMessage(options)) end diff --git a/bin/commands/chat_scheduledMessages.rb b/bin/commands/chat_scheduledMessages.rb index 30a25d81..f3c5e160 100644 --- a/bin/commands/chat_scheduledMessages.rb +++ b/bin/commands/chat_scheduledMessages.rb @@ -11,6 +11,7 @@ c.flag 'latest', desc: 'A UNIX timestamp of the latest value in the time range.' c.flag 'limit', desc: 'Maximum number of original entries to return.' c.flag 'oldest', desc: 'A UNIX timestamp of the oldest value in the time range.' + c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.chat_scheduledMessages_list(options)) end diff --git a/bin/commands/conversations.rb b/bin/commands/conversations.rb index 1283b3a8..7c41119a 100644 --- a/bin/commands/conversations.rb +++ b/bin/commands/conversations.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Conversations methods.' +desc "Interface with all kinds of conversations the same way, whether they're public or private channels, direct messages, or otherwise." command 'conversations' do |g| g.desc 'Archives a conversation.' g.long_desc %( Archives a conversation. ) @@ -26,6 +26,7 @@ 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.' + c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.conversations_create(options)) end @@ -100,6 +101,7 @@ 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.' c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000." + c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.' c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.' c.action do |_global_options, options, _args| puts JSON.dump($client.conversations_list(options)) diff --git a/bin/commands/dnd.rb b/bin/commands/dnd.rb index 6dae132b..0a32bf58 100644 --- a/bin/commands/dnd.rb +++ b/bin/commands/dnd.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Dnd methods.' +desc 'Adjust and view Do Not Disturb settings for team members.' command 'dnd' do |g| 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. ) diff --git a/bin/commands/files.rb b/bin/commands/files.rb index afef9229..f2dc5d1e 100644 --- a/bin/commands/files.rb +++ b/bin/commands/files.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Files methods.' +desc 'Get info on files uploaded to Slack, upload new files to Slack.' command 'files' do |g| g.desc 'Deletes a file.' g.long_desc %( Deletes a file. ) @@ -39,6 +39,7 @@ g.command 'list' do |c| c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.' c.flag 'show_files_hidden_by_limit', desc: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.' + c.flag 'team_id', desc: 'encoded team id to list files in, required if org token is used.' c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).' c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).' c.flag 'types', desc: 'Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.' diff --git a/bin/commands/groups.rb b/bin/commands/groups.rb index c09d2b2d..35be8cd3 100644 --- a/bin/commands/groups.rb +++ b/bin/commands/groups.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Groups methods.' +desc "Get info on your team's private channels." command 'groups' do |g| g.desc 'Archives a private channel.' g.long_desc %( Archives a private channel. ) @@ -16,6 +16,7 @@ g.long_desc %( Creates a private channel. ) g.command 'create' do |c| c.flag 'name', desc: 'Name of private channel to create.' + c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.' c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.' c.action do |_global_options, options, _args| puts JSON.dump($client.groups_create(options)) @@ -99,6 +100,7 @@ c.flag 'exclude_archived', desc: "Don't return archived private channels." c.flag 'exclude_members', desc: 'Exclude the members from each group.' 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." + c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.groups_list(options)) end @@ -107,8 +109,8 @@ 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.' + c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.' + c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.' c.action do |_global_options, options, _args| puts JSON.dump($client.groups_mark(options)) end diff --git a/bin/commands/im.rb b/bin/commands/im.rb index d7568ce6..fcc9387c 100644 --- a/bin/commands/im.rb +++ b/bin/commands/im.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Im methods.' +desc 'Get info on your direct messages.' command 'im' do |g| g.desc 'Close a direct message channel.' g.long_desc %( Close a direct message channel. ) diff --git a/bin/commands/mpim.rb b/bin/commands/mpim.rb index 7ec22831..b1f2991c 100644 --- a/bin/commands/mpim.rb +++ b/bin/commands/mpim.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Mpim methods.' +desc 'Get info on your multiparty direct messages.' command 'mpim' do |g| g.desc 'Closes a multiparty direct message channel.' g.long_desc %( Closes a multiparty direct message channel. ) @@ -38,8 +38,8 @@ 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.' + c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.' + c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.' c.action do |_global_options, options, _args| puts JSON.dump($client.mpim_mark(options)) end diff --git a/bin/commands/pins.rb b/bin/commands/pins.rb index 7abd5aa5..c75bc59f 100644 --- a/bin/commands/pins.rb +++ b/bin/commands/pins.rb @@ -26,8 +26,6 @@ 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.' - c.flag 'file_comment', desc: 'File comment to un-pin.' c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.' c.action do |_global_options, options, _args| puts JSON.dump($client.pins_remove(options)) diff --git a/bin/commands/reactions.rb b/bin/commands/reactions.rb index 680a43e3..a2d2ac4a 100644 --- a/bin/commands/reactions.rb +++ b/bin/commands/reactions.rb @@ -33,6 +33,7 @@ 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.' 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." + c.flag 'team_id', desc: 'encoded team id to list reactions in, required if org token is used.' c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.' c.action do |_global_options, options, _args| puts JSON.dump($client.reactions_list(options)) diff --git a/bin/commands/search.rb b/bin/commands/search.rb index 3f423336..0ddcd07c 100644 --- a/bin/commands/search.rb +++ b/bin/commands/search.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Search methods.' +desc "Search your team's files and messages." command 'search' do |g| g.desc 'Searches for messages and files matching a query.' g.long_desc %( Searches for messages and files matching a query. ) @@ -10,6 +10,7 @@ c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).' c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.' c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).' + c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.search_all(options)) end @@ -22,6 +23,7 @@ c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).' c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.' c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).' + c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.search_files(options)) end @@ -34,6 +36,7 @@ c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).' c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.' c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).' + c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.search_messages(options)) end diff --git a/bin/commands/team.rb b/bin/commands/team.rb index ed956f08..51e30f18 100644 --- a/bin/commands/team.rb +++ b/bin/commands/team.rb @@ -7,6 +7,7 @@ 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.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.team_accessLogs(options)) end @@ -15,6 +16,7 @@ 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 'team_id', desc: 'encoded team id to get the billable information from, required if org token is used.' c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.' c.action do |_global_options, options, _args| puts JSON.dump($client.team_billableInfo(options)) @@ -36,6 +38,7 @@ 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.' c.flag 'service_id', desc: 'Filter logs to this service. Defaults to all logs.' + c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.' c.flag 'user', desc: "Filter logs generated by this user's actions. Defaults to all logs." c.action do |_global_options, options, _args| puts JSON.dump($client.team_integrationLogs(options)) diff --git a/bin/commands/usergroups.rb b/bin/commands/usergroups.rb index 0766442d..95740028 100644 --- a/bin/commands/usergroups.rb +++ b/bin/commands/usergroups.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Usergroups methods.' +desc "Get info on your team's User Groups." command 'usergroups' do |g| g.desc 'Create a User Group' g.long_desc %( Create a User Group ) @@ -11,6 +11,7 @@ c.flag 'description', desc: 'A short description of the User Group.' c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.' c.flag 'include_count', desc: 'Include the number of users in each User Group.' + c.flag 'team_id', desc: 'Encoded team id where the user group has to be created, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_create(options)) end @@ -21,6 +22,7 @@ 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.' + c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_disable(options)) end @@ -31,6 +33,7 @@ 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.' + c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_enable(options)) end @@ -42,6 +45,7 @@ c.flag 'include_count', desc: 'Include the number of users in each User Group.' c.flag 'include_disabled', desc: 'Include disabled User Groups.' c.flag 'include_users', desc: 'Include the list of users for each User Group.' + c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_list(options)) end @@ -56,6 +60,7 @@ c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.' c.flag 'include_count', desc: 'Include the number of users in the User Group.' c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.' + c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_update(options)) end diff --git a/bin/commands/usergroups_users.rb b/bin/commands/usergroups_users.rb index a1a57b96..5a09ad37 100644 --- a/bin/commands/usergroups_users.rb +++ b/bin/commands/usergroups_users.rb @@ -8,6 +8,7 @@ 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.' + c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_users_list(options)) end @@ -19,6 +20,7 @@ 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.' c.flag 'include_count', desc: 'Include the number of users in the User Group.' + c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.usergroups_users_update(options)) end diff --git a/bin/commands/users.rb b/bin/commands/users.rb index a0cbe486..c9fea3c4 100644 --- a/bin/commands/users.rb +++ b/bin/commands/users.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake -desc 'Users methods.' +desc 'Get info on members of your Slack team.' command 'users' do |g| g.desc 'List conversations the calling user may access.' g.long_desc %( List conversations the calling user may access. ) @@ -9,6 +9,7 @@ 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.' c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000." + c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.' c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.' c.flag 'user', desc: "Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership." c.action do |_global_options, options, _args| @@ -66,6 +67,7 @@ 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.' 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. Providing no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors." + c.flag 'team_id', desc: 'encoded team id to list users in, required if org token is used.' c.action do |_global_options, options, _args| puts JSON.dump($client.users_list(options)) end diff --git a/bin/commands/users_profile.rb b/bin/commands/users_profile.rb index 8e69047e..08a26708 100644 --- a/bin/commands/users_profile.rb +++ b/bin/commands/users_profile.rb @@ -3,18 +3,18 @@ desc 'UsersProfile methods.' command 'users_profile' do |g| - g.desc "Retrieves a user's profile information." - g.long_desc %( Retrieves a user's profile information. ) + g.desc "Retrieve a user's profile information, including their custom status." + g.long_desc %( Retrieve a user's profile information, including their custom status. ) g.command 'get' do |c| - c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields.' + c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.' c.flag 'user', desc: 'User to retrieve profile info for.' c.action do |_global_options, options, _args| puts JSON.dump($client.users_profile_get(options)) end end - g.desc 'Set the profile information for a user.' - g.long_desc %( Set the profile information for a user. ) + g.desc "Set a user's profile information, including custom status." + g.long_desc %( Set a user's profile information, including custom status. ) 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/workflows.rb b/bin/commands/workflows.rb index db918b6a..30dd8c24 100644 --- a/bin/commands/workflows.rb +++ b/bin/commands/workflows.rb @@ -23,8 +23,8 @@ end end - g.desc 'Update the configuration for a workflow extension step.' - g.long_desc %( Update the configuration for a workflow extension step. ) + g.desc 'Update the configuration for a workflow step.' + g.long_desc %( Update the configuration for a workflow step. ) g.command 'updateStep' do |c| c.flag 'workflow_step_edit_id', desc: 'A context identifier provided with view_submission payloads used to call back to workflows.updateStep.' c.flag 'inputs', desc: 'A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. Please note: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. Read more about variables in workflow steps here.' diff --git a/lib/slack-ruby-client.rb b/lib/slack-ruby-client.rb index e5c3cc67..20d9ffc5 100644 --- a/lib/slack-ruby-client.rb +++ b/lib/slack-ruby-client.rb @@ -28,6 +28,7 @@ require_relative 'slack/web/api/errors/too_many_requests_error' require_relative 'slack/web/api/error' require_relative 'slack/web/api/errors' +require_relative 'slack/web/api/errors/internal_error' require_relative 'slack/web/faraday/response/raise_error' require_relative 'slack/web/faraday/response/wrap_error' require_relative 'slack/web/faraday/connection' diff --git a/lib/slack/web/api/endpoints.rb b/lib/slack/web/api/endpoints.rb index eb00296b..78a06f36 100644 --- a/lib/slack/web/api/endpoints.rb +++ b/lib/slack/web/api/endpoints.rb @@ -1,10 +1,12 @@ # frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake +require_relative 'endpoints/admin_analytics' require_relative 'endpoints/admin_apps' require_relative 'endpoints/admin_apps_approved' require_relative 'endpoints/admin_apps_requests' require_relative 'endpoints/admin_apps_restricted' +require_relative 'endpoints/admin_barriers' require_relative 'endpoints/admin_conversations' require_relative 'endpoints/admin_conversations_ekm' require_relative 'endpoints/admin_conversations_restrictAccess' @@ -22,12 +24,14 @@ require_relative 'endpoints/admin_users_session' require_relative 'endpoints/api' require_relative 'endpoints/apps' +require_relative 'endpoints/apps_connections' require_relative 'endpoints/apps_event_authorizations' require_relative 'endpoints/apps_permissions' require_relative 'endpoints/apps_permissions_resources' require_relative 'endpoints/apps_permissions_scopes' require_relative 'endpoints/apps_permissions_users' require_relative 'endpoints/auth' +require_relative 'endpoints/auth_teams' require_relative 'endpoints/bots' require_relative 'endpoints/calls' require_relative 'endpoints/calls_participants' @@ -73,10 +77,12 @@ module Endpoints include Slack::Web::Api::Mixins::Users include Slack::Web::Api::Mixins::Groups + include AdminAnalytics include AdminApps include AdminAppsApproved include AdminAppsRequests include AdminAppsRestricted + include AdminBarriers include AdminConversations include AdminConversationsEkm include AdminConversationsRestrictaccess @@ -94,12 +100,14 @@ module Endpoints include AdminUsersSession include Api include Apps + include AppsConnections include AppsEventAuthorizations include AppsPermissions include AppsPermissionsResources include AppsPermissionsScopes include AppsPermissionsUsers include Auth + include AuthTeams include Bots include Calls include CallsParticipants diff --git a/lib/slack/web/api/endpoints/admin_analytics.rb b/lib/slack/web/api/endpoints/admin_analytics.rb new file mode 100644 index 00000000..850f632d --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_analytics.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminAnalytics + # + # Retrieve analytics data for a given date, presented as a compressed JSON file + # + # @option options [Object] :type + # The type of analytics to retrieve. The options are currently limited to member. + # @option options [Object] :date + # Date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC. + # @see https://api.slack.com/methods/admin.analytics.getFile + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.analytics/admin.analytics.getFile.json + def admin_analytics_getFile(options = {}) + throw ArgumentError.new('Required arguments :type missing') if options[:type].nil? + post('admin.analytics.getFile', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_apps.rb b/lib/slack/web/api/endpoints/admin_apps.rb index 299a1b23..828fe7c2 100644 --- a/lib/slack/web/api/endpoints/admin_apps.rb +++ b/lib/slack/web/api/endpoints/admin_apps.rb @@ -11,25 +11,45 @@ module AdminApps # # @option options [Object] :app_id # The id of the app to approve. + # @option options [Object] :enterprise_id + # The ID of the enterprise to approve the app on. # @option options [Object] :request_id # The id of the request to approve. # @option options [Object] :team_id - # . + # The ID of the workspace to approve the app on. # @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 + # + # Clear an app resolution + # + # @option options [Object] :app_id + # The id of the app whose resolution you want to clear/undo. + # @option options [Object] :enterprise_id + # The enterprise to clear the app resolution from. + # @option options [Object] :team_id + # The workspace to clear the app resolution from. + # @see https://api.slack.com/methods/admin.apps.clearResolution + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.clearResolution.json + def admin_apps_clearResolution(options = {}) + throw ArgumentError.new('Required arguments :app_id missing') if options[:app_id].nil? + post('admin.apps.clearResolution', 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] :enterprise_id + # The ID of the enterprise to approve the app on. # @option options [Object] :request_id # The id of the request to restrict. # @option options [Object] :team_id - # . + # The ID of the workspace to approve the app on. # @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 = {}) diff --git a/lib/slack/web/api/endpoints/admin_barriers.rb b/lib/slack/web/api/endpoints/admin_barriers.rb new file mode 100644 index 00000000..99e6287c --- /dev/null +++ b/lib/slack/web/api/endpoints/admin_barriers.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AdminBarriers + # + # Create an Information Barrier + # + # @option options [Object] :barriered_from_usergroup_ids + # A list of IDP Groups ids that the primary usergroup is to be barriered from. + # @option options [Object] :primary_usergroup_id + # The id of the primary IDP Group. + # @option options [Object] :restricted_subjects + # What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call. + # @see https://api.slack.com/methods/admin.barriers.create + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.create.json + def admin_barriers_create(options = {}) + throw ArgumentError.new('Required arguments :barriered_from_usergroup_ids missing') if options[:barriered_from_usergroup_ids].nil? + throw ArgumentError.new('Required arguments :primary_usergroup_id missing') if options[:primary_usergroup_id].nil? + throw ArgumentError.new('Required arguments :restricted_subjects missing') if options[:restricted_subjects].nil? + post('admin.barriers.create', options) + end + + # + # Delete an existing Information Barrier + # + # @option options [Object] :barrier_id + # The ID of the barrier you're trying to delete. + # @see https://api.slack.com/methods/admin.barriers.delete + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.delete.json + def admin_barriers_delete(options = {}) + throw ArgumentError.new('Required arguments :barrier_id missing') if options[:barrier_id].nil? + post('admin.barriers.delete', options) + end + + # + # Get all Information Barriers for your organization + # + # @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. + # @see https://api.slack.com/methods/admin.barriers.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.list.json + def admin_barriers_list(options = {}) + if block_given? + Pagination::Cursor.new(self, :admin_barriers_list, options).each do |page| + yield page + end + else + post('admin.barriers.list', options) + end + end + + # + # Update an existing Information Barrier + # + # @option options [Object] :barrier_id + # The ID of the barrier you're trying to modify. + # @option options [Object] :barriered_from_usergroup_ids + # A list of IDP Groups ids that the primary usergroup is to be barriered from. + # @option options [Object] :primary_usergroup_id + # The id of the primary IDP Group. + # @option options [Object] :restricted_subjects + # What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call. + # @see https://api.slack.com/methods/admin.barriers.update + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.barriers/admin.barriers.update.json + def admin_barriers_update(options = {}) + throw ArgumentError.new('Required arguments :barrier_id missing') if options[:barrier_id].nil? + throw ArgumentError.new('Required arguments :barriered_from_usergroup_ids missing') if options[:barriered_from_usergroup_ids].nil? + throw ArgumentError.new('Required arguments :primary_usergroup_id missing') if options[:primary_usergroup_id].nil? + throw ArgumentError.new('Required arguments :restricted_subjects missing') if options[:restricted_subjects].nil? + post('admin.barriers.update', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/admin_conversations.rb b/lib/slack/web/api/endpoints/admin_conversations.rb index 178208ee..bdec2cd3 100644 --- a/lib/slack/web/api/endpoints/admin_conversations.rb +++ b/lib/slack/web/api/endpoints/admin_conversations.rb @@ -89,6 +89,18 @@ def admin_conversations_getConversationPrefs(options = {}) post('admin.conversations.getConversationPrefs', options) end + # + # This API endpoint can be used by any admin to get a channel's retention policy. + # + # @option options [Object] :channel_id + # The channel to get the retention policy for. + # @see https://api.slack.com/methods/admin.conversations.getCustomRetention + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.getCustomRetention.json + def admin_conversations_getCustomRetention(options = {}) + throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? + post('admin.conversations.getCustomRetention', options) + end + # # Get all the workspaces a given public or private channel is connected to within this Enterprise org. # @@ -126,6 +138,18 @@ def admin_conversations_invite(options = {}) post('admin.conversations.invite', options) end + # + # This API endpoint can be used by any admin to remove a channel's retention policy. + # + # @option options [Object] :channel_id + # The channel to set the retention policy for. + # @see https://api.slack.com/methods/admin.conversations.removeCustomRetention + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.removeCustomRetention.json + def admin_conversations_removeCustomRetention(options = {}) + throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? + post('admin.conversations.removeCustomRetention', options) + end + # # Rename a public or private channel. # @@ -185,6 +209,21 @@ def admin_conversations_setConversationPrefs(options = {}) post('admin.conversations.setConversationPrefs', options) end + # + # This API endpoint can be used by any admin to set a channel's retention policy. + # + # @option options [Object] :channel_id + # The channel to set the retention policy for. + # @option options [Object] :duration_days + # The message retention duration in days to set for this channel. + # @see https://api.slack.com/methods/admin.conversations.setCustomRetention + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.setCustomRetention.json + def admin_conversations_setCustomRetention(options = {}) + throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil? + throw ArgumentError.new('Required arguments :duration_days missing') if options[:duration_days].nil? + post('admin.conversations.setCustomRetention', options) + end + # # Set the workspaces in an Enterprise grid org that connect to a public or private channel. # diff --git a/lib/slack/web/api/endpoints/admin_emoji.rb b/lib/slack/web/api/endpoints/admin_emoji.rb index f5007804..54b62175 100644 --- a/lib/slack/web/api/endpoints/admin_emoji.rb +++ b/lib/slack/web/api/endpoints/admin_emoji.rb @@ -10,7 +10,7 @@ module AdminEmoji # Add an emoji. # # @option options [Object] :name - # The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included. + # The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included. # @option options [Object] :url # The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best. # @see https://api.slack.com/methods/admin.emoji.add diff --git a/lib/slack/web/api/endpoints/admin_usergroups.rb b/lib/slack/web/api/endpoints/admin_usergroups.rb index 8b74c633..58232ce0 100644 --- a/lib/slack/web/api/endpoints/admin_usergroups.rb +++ b/lib/slack/web/api/endpoints/admin_usergroups.rb @@ -7,7 +7,7 @@ module Api module Endpoints module AdminUsergroups # - # Add one or more default channels to an IDP group. + # Add up to one hundred default channels to an IDP group. # # @option options [Object] :channel_ids # Comma separated string of channel IDs. diff --git a/lib/slack/web/api/endpoints/admin_users.rb b/lib/slack/web/api/endpoints/admin_users.rb index f4e9a8a0..be795681 100644 --- a/lib/slack/web/api/endpoints/admin_users.rb +++ b/lib/slack/web/api/endpoints/admin_users.rb @@ -60,16 +60,15 @@ def admin_users_invite(options = {}) # # List users on a workspace # - # @option options [Object] :team_id - # The ID (T1234) of the 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 # Limit for how many users to be retrieved per page. + # @option options [Object] :team_id + # The ID (T1234) of the workspace. # @see https://api.slack.com/methods/admin.users.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.list.json def admin_users_list(options = {}) - throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? if block_given? Pagination::Cursor.new(self, :admin_users_list, options).each do |page| yield page @@ -114,15 +113,14 @@ def admin_users_setAdmin(options = {}) # # @option options [Object] :expiration_ts # Timestamp when guest account should be disabled. - # @option options [Object] :team_id - # The ID (T1234) of the workspace. # @option options [Object] :user_id # The ID of the user to set an expiration for. + # @option options [Object] :team_id + # The ID (T1234) of the workspace. # @see https://api.slack.com/methods/admin.users.setExpiration # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users/admin.users.setExpiration.json def admin_users_setExpiration(options = {}) throw ArgumentError.new('Required arguments :expiration_ts missing') if options[:expiration_ts].nil? - throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil? throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil? post('admin.users.setExpiration', options) end diff --git a/lib/slack/web/api/endpoints/admin_users_session.rb b/lib/slack/web/api/endpoints/admin_users_session.rb index 6d1a2d27..abc5035d 100644 --- a/lib/slack/web/api/endpoints/admin_users_session.rb +++ b/lib/slack/web/api/endpoints/admin_users_session.rb @@ -7,12 +7,12 @@ module Api module Endpoints module AdminUsersSession # - # Invalidate a single session for a user by session_id + # Revoke a single session for a user. The user will be forced to login to Slack. # # @option options [Object] :session_id - # . + # ID of the session to invalidate. # @option options [Object] :team_id - # ID of the team that the session belongs to. + # ID of the workspace that the session belongs to. # @see https://api.slack.com/methods/admin.users.session.invalidate # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.invalidate.json def admin_users_session_invalidate(options = {}) @@ -21,6 +21,29 @@ def admin_users_session_invalidate(options = {}) post('admin.users.session.invalidate', options) end + # + # List active user sessions for an organization + # + # @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 + # The ID of the workspace you'd like active sessions for. If you pass a team_id, you'll need to pass a user_id as well. + # @option options [Object] :user_id + # The ID of user you'd like active sessions for. If you pass a user_id, you'll need to pass a team_id as well. + # @see https://api.slack.com/methods/admin.users.session.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.list.json + def admin_users_session_list(options = {}) + if block_given? + Pagination::Cursor.new(self, :admin_users_session_list, options).each do |page| + yield page + end + else + post('admin.users.session.list', options) + end + end + # # Wipes all valid sessions on all devices for a given user # diff --git a/lib/slack/web/api/endpoints/api.rb b/lib/slack/web/api/endpoints/api.rb index abaf1f0d..153a3de8 100644 --- a/lib/slack/web/api/endpoints/api.rb +++ b/lib/slack/web/api/endpoints/api.rb @@ -11,8 +11,6 @@ module Api # # @option options [Object] :error # Error response to return. - # @option options [Object] :foo - # example property to return. # @see https://api.slack.com/methods/api.test # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/api/api.test.json def api_test(options = {}) diff --git a/lib/slack/web/api/endpoints/apps_connections.rb b/lib/slack/web/api/endpoints/apps_connections.rb new file mode 100644 index 00000000..5cafe186 --- /dev/null +++ b/lib/slack/web/api/endpoints/apps_connections.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +module Slack + module Web + module Api + module Endpoints + module AppsConnections + # + # Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over, + # + # @see https://api.slack.com/methods/apps.connections.open + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.connections/apps.connections.open.json + def apps_connections_open(options = {}) + post('apps.connections.open', options) + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/auth_teams.rb b/lib/slack/web/api/endpoints/auth_teams.rb new file mode 100644 index 00000000..482af611 --- /dev/null +++ b/lib/slack/web/api/endpoints/auth_teams.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 AuthTeams + # + # List the workspaces a token can access. + # + # @option options [Object] :cursor + # Set cursor to next_cursor returned by the previous call to list items in the next page. + # @option options [Object] :include_icon + # Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace. + # @option options [Object] :limit + # The maximum number of workspaces to return. Must be a positive integer no larger than 1000. + # @see https://api.slack.com/methods/auth.teams.list + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth.teams/auth.teams.list.json + def auth_teams_list(options = {}) + if block_given? + Pagination::Cursor.new(self, :auth_teams_list, options).each do |page| + yield page + end + else + post('auth.teams.list', options) + end + end + end + end + end + end +end diff --git a/lib/slack/web/api/endpoints/bots.rb b/lib/slack/web/api/endpoints/bots.rb index 2a84f4a2..a14fadf0 100644 --- a/lib/slack/web/api/endpoints/bots.rb +++ b/lib/slack/web/api/endpoints/bots.rb @@ -11,6 +11,8 @@ module Bots # # @option options [Object] :bot # Bot user to get info on. + # @option options [Object] :team_id + # encoded team id or enterprise id where the bot exists, required if org token is used. # @see https://api.slack.com/methods/bots.info # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/bots/bots.info.json def bots_info(options = {}) diff --git a/lib/slack/web/api/endpoints/channels.rb b/lib/slack/web/api/endpoints/channels.rb index 1c788e1b..804fe903 100644 --- a/lib/slack/web/api/endpoints/channels.rb +++ b/lib/slack/web/api/endpoints/channels.rb @@ -25,6 +25,8 @@ def channels_archive(options = {}) # # @option options [Object] :name # Name of channel to create. + # @option options [Object] :team_id + # encoded team id to create the channel in, required if org token is used. # @option options [Object] :validate # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria. # @see https://api.slack.com/methods/channels.create @@ -109,6 +111,8 @@ def channels_invite(options = {}) # # @option options [Object] :name # Name of channel to join. + # @option options [Object] :team_id + # encoded team id to list channels in, required if org token is used. # @option options [Object] :validate # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria. # @see https://api.slack.com/methods/channels.join @@ -162,6 +166,8 @@ def channels_leave(options = {}) # Exclude the members collection from each channel. # @option options [Object] :limit # 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. + # @option options [Object] :team_id + # encoded team id to list channels in, required if org token is used. # @see https://api.slack.com/methods/channels.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json def channels_list(options = {}) @@ -179,9 +185,9 @@ def channels_list(options = {}) # Sets the read cursor in a channel. # # @option options [channel] :channel - # Channel to set reading cursor in. + # Channel or conversation to set the read cursor for. # @option options [timestamp] :ts - # Timestamp of the most recently seen message. + # Unique identifier of message you want marked as most recently seen in this conversation. # @see https://api.slack.com/methods/channels.mark # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.mark.json def channels_mark(options = {}) diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 8ed5625c..c42aee28 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -154,9 +154,9 @@ def chat_postEphemeral(options = {}) # @option options [Object] :blocks # A JSON-based array of structured blocks, presented as a URL-encoded string. # @option options [Object] :icon_emoji - # Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens. + # Emoji to use as the icon for this message. Overrides icon_url. See authorship below. Use with bot tokens requires chat:write.customize. # @option options [Object] :icon_url - # URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens. + # URL to an image to use as the icon for this message. See authorship below. Use with bot tokens requires chat:write.customize. # @option options [Object] :link_names # Find and link channel names and usernames. # @option options [Object] :mrkdwn @@ -172,7 +172,7 @@ def chat_postEphemeral(options = {}) # @option options [Object] :unfurl_media # Pass false to disable unfurling of media content. # @option options [Object] :username - # Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. + # Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize. # @see https://api.slack.com/methods/chat.postMessage # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json def chat_postMessage(options = {}) diff --git a/lib/slack/web/api/endpoints/chat_scheduledMessages.rb b/lib/slack/web/api/endpoints/chat_scheduledMessages.rb index 18f04644..45202455 100644 --- a/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +++ b/lib/slack/web/api/endpoints/chat_scheduledMessages.rb @@ -19,6 +19,8 @@ module ChatScheduledmessages # Maximum number of original entries to return. # @option options [timestamp] :oldest # A UNIX timestamp of the oldest value in the time range. + # @option options [Object] :team_id + # encoded team id to list channels in, required if org token is used. # @see https://api.slack.com/methods/chat.scheduledMessages.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json def chat_scheduledMessages_list(options = {}) diff --git a/lib/slack/web/api/endpoints/conversations.rb b/lib/slack/web/api/endpoints/conversations.rb index 0a8cdbd7..a03163a4 100644 --- a/lib/slack/web/api/endpoints/conversations.rb +++ b/lib/slack/web/api/endpoints/conversations.rb @@ -39,6 +39,8 @@ def conversations_close(options = {}) # Name of the public or private channel to create. # @option options [Object] :is_private # Create a private channel instead of a public one. + # @option options [Object] :team_id + # encoded team id to create the channel in, required if org token is used. # @see https://api.slack.com/methods/conversations.create # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json def conversations_create(options = {}) @@ -160,6 +162,8 @@ def conversations_leave(options = {}) # Set to true to exclude archived channels from the list. # @option options [Object] :limit # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000. + # @option options [Object] :team_id + # encoded team id to list channels in, required if org token is used. # @option options [Object] :types # Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im. # @see https://api.slack.com/methods/conversations.list diff --git a/lib/slack/web/api/endpoints/files.rb b/lib/slack/web/api/endpoints/files.rb index 4fc73396..1f9b3680 100644 --- a/lib/slack/web/api/endpoints/files.rb +++ b/lib/slack/web/api/endpoints/files.rb @@ -64,6 +64,8 @@ def files_info(options = {}) # Filter files appearing in a specific channel, indicated by its ID. # @option options [Object] :show_files_hidden_by_limit # Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit. + # @option options [Object] :team_id + # encoded team id to list files in, required if org token is used. # @option options [Object] :ts_from # Filter files created after this timestamp (inclusive). # @option options [Object] :ts_to diff --git a/lib/slack/web/api/endpoints/groups.rb b/lib/slack/web/api/endpoints/groups.rb index baafbd21..f759c54e 100644 --- a/lib/slack/web/api/endpoints/groups.rb +++ b/lib/slack/web/api/endpoints/groups.rb @@ -25,6 +25,8 @@ def groups_archive(options = {}) # # @option options [Object] :name # Name of private channel to create. + # @option options [Object] :team_id + # encoded team id to create the channel in, required if org token is used. # @option options [Object] :validate # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria. # @see https://api.slack.com/methods/groups.create @@ -148,6 +150,8 @@ def groups_leave(options = {}) # Exclude the members from each group. # @option options [Object] :limit # 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. + # @option options [Object] :team_id + # encoded team id to list channels in, required if org token is used. # @see https://api.slack.com/methods/groups.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.list.json def groups_list(options = {}) @@ -165,9 +169,9 @@ def groups_list(options = {}) # Sets the read cursor in a private channel. # # @option options [group] :channel - # Private channel to set reading cursor in. + # Channel or conversation to set the read cursor for. # @option options [timestamp] :ts - # Timestamp of the most recently seen message. + # Unique identifier of message you want marked as most recently seen in this conversation. # @see https://api.slack.com/methods/groups.mark # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.mark.json def groups_mark(options = {}) diff --git a/lib/slack/web/api/endpoints/mpim.rb b/lib/slack/web/api/endpoints/mpim.rb index 19f2b897..142c75f8 100644 --- a/lib/slack/web/api/endpoints/mpim.rb +++ b/lib/slack/web/api/endpoints/mpim.rb @@ -66,9 +66,9 @@ def mpim_list(options = {}) # Sets the read cursor in a multiparty direct message channel. # # @option options [channel] :channel - # multiparty direct message channel to set reading cursor in. + # Channel or conversation to set the read cursor for. # @option options [timestamp] :ts - # Timestamp of the most recently seen message. + # Unique identifier of message you want marked as most recently seen in this conversation. # @see https://api.slack.com/methods/mpim.mark # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.mark.json def mpim_mark(options = {}) diff --git a/lib/slack/web/api/endpoints/pins.rb b/lib/slack/web/api/endpoints/pins.rb index 641851ea..d5adf685 100644 --- a/lib/slack/web/api/endpoints/pins.rb +++ b/lib/slack/web/api/endpoints/pins.rb @@ -39,10 +39,6 @@ def pins_list(options = {}) # # @option options [channel] :channel # Channel where the item is pinned to. - # @option options [file] :file - # File to un-pin. - # @option options [Object] :file_comment - # File comment to un-pin. # @option options [Object] :timestamp # Timestamp of the message to un-pin. # @see https://api.slack.com/methods/pins.remove diff --git a/lib/slack/web/api/endpoints/reactions.rb b/lib/slack/web/api/endpoints/reactions.rb index 9dc0e6b0..4a59f914 100644 --- a/lib/slack/web/api/endpoints/reactions.rb +++ b/lib/slack/web/api/endpoints/reactions.rb @@ -54,6 +54,8 @@ def reactions_get(options = {}) # If true always return the complete reaction list. # @option options [Object] :limit # 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. + # @option options [Object] :team_id + # encoded team id to list reactions in, required if org token is used. # @option options [user] :user # Show reactions made by this user. Defaults to the authed user. # @see https://api.slack.com/methods/reactions.list diff --git a/lib/slack/web/api/endpoints/search.rb b/lib/slack/web/api/endpoints/search.rb index 3ec916f6..a3b52efa 100644 --- a/lib/slack/web/api/endpoints/search.rb +++ b/lib/slack/web/api/endpoints/search.rb @@ -17,6 +17,8 @@ module Search # Return matches sorted by either score or timestamp. # @option options [Object] :sort_dir # Change sort direction to ascending (asc) or descending (desc). + # @option options [Object] :team_id + # encoded team id to search in, required if org token is used. # @see https://api.slack.com/methods/search.all # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json def search_all(options = {}) @@ -35,6 +37,8 @@ def search_all(options = {}) # Return matches sorted by either score or timestamp. # @option options [Object] :sort_dir # Change sort direction to ascending (asc) or descending (desc). + # @option options [Object] :team_id + # encoded team id to search in, required if org token is used. # @see https://api.slack.com/methods/search.files # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json def search_files(options = {}) @@ -53,6 +57,8 @@ def search_files(options = {}) # Return matches sorted by either score or timestamp. # @option options [Object] :sort_dir # Change sort direction to ascending (asc) or descending (desc). + # @option options [Object] :team_id + # encoded team id to search in, required if org token is used. # @see https://api.slack.com/methods/search.messages # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json def search_messages(options = {}) diff --git a/lib/slack/web/api/endpoints/team.rb b/lib/slack/web/api/endpoints/team.rb index cb596868..a49fb075 100644 --- a/lib/slack/web/api/endpoints/team.rb +++ b/lib/slack/web/api/endpoints/team.rb @@ -11,6 +11,8 @@ module Team # # @option options [Object] :before # End of time range of logs to include in results (inclusive). + # @option options [Object] :team_id + # encoded team id to get logs from, required if org token is used. # @see https://api.slack.com/methods/team.accessLogs # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json def team_accessLogs(options = {}) @@ -20,6 +22,8 @@ def team_accessLogs(options = {}) # # Gets billable users information for the current team. # + # @option options [Object] :team_id + # encoded team id to get the billable information from, required if org token is used. # @option options [user] :user # A user to retrieve the billable information for. Defaults to all users. # @see https://api.slack.com/methods/team.billableInfo @@ -49,6 +53,8 @@ def team_info(options = {}) # Filter logs with this change type. Defaults to all logs. # @option options [Object] :service_id # Filter logs to this service. Defaults to all logs. + # @option options [Object] :team_id + # encoded team id to get logs from, required if org token is used. # @option options [user] :user # Filter logs generated by this user's actions. Defaults to all logs. # @see https://api.slack.com/methods/team.integrationLogs diff --git a/lib/slack/web/api/endpoints/usergroups.rb b/lib/slack/web/api/endpoints/usergroups.rb index 4d8cabd2..f5e43e35 100644 --- a/lib/slack/web/api/endpoints/usergroups.rb +++ b/lib/slack/web/api/endpoints/usergroups.rb @@ -19,6 +19,8 @@ module Usergroups # A mention handle. Must be unique among channels, users and User Groups. # @option options [Object] :include_count # Include the number of users in each User Group. + # @option options [Object] :team_id + # Encoded team id where the user group has to be created, required if org token is used. # @see https://api.slack.com/methods/usergroups.create # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json def usergroups_create(options = {}) @@ -33,6 +35,8 @@ def usergroups_create(options = {}) # The encoded ID of the User Group to disable. # @option options [Object] :include_count # Include the number of users in the User Group. + # @option options [Object] :team_id + # Encoded team id where the user group is, required if org token is used. # @see https://api.slack.com/methods/usergroups.disable # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json def usergroups_disable(options = {}) @@ -47,6 +51,8 @@ def usergroups_disable(options = {}) # The encoded ID of the User Group to enable. # @option options [Object] :include_count # Include the number of users in the User Group. + # @option options [Object] :team_id + # Encoded team id where the user group is, required if org token is used. # @see https://api.slack.com/methods/usergroups.enable # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json def usergroups_enable(options = {}) @@ -63,6 +69,8 @@ def usergroups_enable(options = {}) # Include disabled User Groups. # @option options [Object] :include_users # Include the list of users for each User Group. + # @option options [Object] :team_id + # encoded team id to list user groups in, required if org token is used. # @see https://api.slack.com/methods/usergroups.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json def usergroups_list(options = {}) @@ -84,6 +92,8 @@ def usergroups_list(options = {}) # Include the number of users in the User Group. # @option options [Object] :name # A name for the User Group. Must be unique among User Groups. + # @option options [Object] :team_id + # encoded team id where the user group exists, required if org token is used. # @see https://api.slack.com/methods/usergroups.update # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json def usergroups_update(options = {}) diff --git a/lib/slack/web/api/endpoints/usergroups_users.rb b/lib/slack/web/api/endpoints/usergroups_users.rb index b1add089..8fdd20ea 100644 --- a/lib/slack/web/api/endpoints/usergroups_users.rb +++ b/lib/slack/web/api/endpoints/usergroups_users.rb @@ -13,6 +13,8 @@ module UsergroupsUsers # The encoded ID of the User Group to update. # @option options [Object] :include_disabled # Allow results that involve disabled User Groups. + # @option options [Object] :team_id + # encoded team id where the user group exists, required if org token is used. # @see https://api.slack.com/methods/usergroups.users.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json def usergroups_users_list(options = {}) @@ -29,6 +31,8 @@ def usergroups_users_list(options = {}) # A comma separated string of encoded user IDs that represent the entire list of users for the User Group. # @option options [Object] :include_count # Include the number of users in the User Group. + # @option options [Object] :team_id + # encoded team id where the user group exists, required if org token is used. # @see https://api.slack.com/methods/usergroups.users.update # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json def usergroups_users_update(options = {}) diff --git a/lib/slack/web/api/endpoints/users.rb b/lib/slack/web/api/endpoints/users.rb index 7b7d7776..882fd06a 100644 --- a/lib/slack/web/api/endpoints/users.rb +++ b/lib/slack/web/api/endpoints/users.rb @@ -15,6 +15,8 @@ module Users # Set to true to exclude archived channels from the list. # @option options [Object] :limit # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000. + # @option options [Object] :team_id + # encoded team id to list conversations in, required if org token is used. # @option options [Object] :types # Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im. # @option options [user] :user @@ -86,6 +88,8 @@ def users_info(options = {}) # Set this to true to receive the locale for users. Defaults to false. # @option options [Object] :limit # 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. Providing no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors. + # @option options [Object] :team_id + # encoded team id to list users in, required if org token is used. # @see https://api.slack.com/methods/users.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.list.json def users_list(options = {}) diff --git a/lib/slack/web/api/endpoints/users_profile.rb b/lib/slack/web/api/endpoints/users_profile.rb index 637617e6..70462ebb 100644 --- a/lib/slack/web/api/endpoints/users_profile.rb +++ b/lib/slack/web/api/endpoints/users_profile.rb @@ -7,10 +7,10 @@ module Api module Endpoints module UsersProfile # - # Retrieves a user's profile information. + # Retrieve a user's profile information, including their custom status. # # @option options [Object] :include_labels - # Include labels for each ID in custom profile fields. + # Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended. # @option options [user] :user # User to retrieve profile info for. # @see https://api.slack.com/methods/users.profile.get @@ -21,7 +21,7 @@ def users_profile_get(options = {}) end # - # Set the profile information for a user. + # Set a user's profile information, including custom status. # # @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/workflows.rb b/lib/slack/web/api/endpoints/workflows.rb index 1efce2f5..1341751e 100644 --- a/lib/slack/web/api/endpoints/workflows.rb +++ b/lib/slack/web/api/endpoints/workflows.rb @@ -36,7 +36,7 @@ def workflows_stepFailed(options = {}) end # - # Update the configuration for a workflow extension step. + # Update the configuration for a workflow step. # # @option options [Object] :workflow_step_edit_id # A context identifier provided with view_submission payloads used to call back to workflows.updateStep. diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index 5defde52..1e3b8947 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -21,6 +21,7 @@ class AppManagementAppNotInstalledOnOrg < SlackError; end class AppMissingActionUrl < SlackError; end class AppRestrictedOrgWide < SlackError; end class AsUserNotSupported < SlackError; end + class AuthedUserNotFound < SlackError; end class AutoProvisionFailure < SlackError; end class BadClientSecret < SlackError; end class BadHandle < SlackError; end @@ -31,7 +32,11 @@ class BadTitle < SlackError; end class BadToken < SlackError; end class BadUrl < SlackError; end class BadUsers < SlackError; end + class BarrierAlreadyExists < SlackError; end + class BarrierNotFound < SlackError; end + class BarrieredFromUsergroupsNotFound < SlackError; end class BotNotFound < SlackError; end + class BotsNotAllowed < SlackError; end class BotsNotFound < SlackError; end class CannotAddBot < SlackError; end class CannotAddMoreChannelsToGroup < SlackError; end @@ -39,6 +44,7 @@ class CannotAddMoreGroupsToChannel < SlackError; end class CannotAddOthers < SlackError; end class CannotAddOthersRecurring < SlackError; end class CannotAddSlackbot < SlackError; end + class CannotAuthUser < SlackError; end class CannotCompleteOthers < SlackError; end class CannotCompleteRecurring < SlackError; end class CannotCreateDialog < SlackError; end @@ -83,11 +89,15 @@ class CouldNotCreateChannel < SlackError; end class CouldNotCreateWorkspace < SlackError; end class CouldNotDeleteChannel < SlackError; end class CouldNotGetConversationPrefs < SlackError; end + class CouldNotGetRetention < SlackError; end class CouldNotGetTeams < SlackError; end + class CouldNotRemoveRetention < SlackError; end class CouldNotRenameChannel < SlackError; end class CouldNotSetChannelPref < SlackError; end + class CouldNotSetRetention < SlackError; end class CouldNotSetTeamsForChannel < SlackError; end class CouldNotUnarchiveChannel < SlackError; end + class DataNotAvailable < SlackError; end class DefaultChannelRestricted < SlackError; end class DefaultOrgWideChannel < SlackError; end class DeprecatedEndpoint < SlackError; end @@ -103,6 +113,7 @@ class EmailTaken < SlackError; end class EmojiLimitReached < SlackError; end class EmojiNotFound < SlackError; end class EnterpriseIsRestricted < SlackError; end + class EnterpriseNotFound < SlackError; end class ErrorBadFormat < SlackError; end class ErrorBadNameI18n < SlackError; end class ErrorBadUpload < SlackError; end @@ -116,6 +127,7 @@ class ErrorNoImage < SlackError; end class ErrorTooBig < SlackError; end class ExternalChannelMigrating < SlackError; end class ExternallySharedOrDisconnectedChannel < SlackError; end + class FailToGetTeamsForRestrictedUser < SlackError; end class FailedForSomeUsers < SlackError; end class FailedLookingUpUser < SlackError; end class FailedSendingDialog < SlackError; end @@ -151,6 +163,7 @@ class FileDeleted < SlackError; end class FileDeletingDisabled < SlackError; end class FileNotFound < SlackError; end class FileNotShared < SlackError; end + class FileNotYetAvailable < SlackError; end class FileUnderReview < SlackError; end class ForbiddenHandle < SlackError; end class GroupAlreadyLinkedToChannel < SlackError; end @@ -160,12 +173,8 @@ class GroupNotFound < SlackError; end class HandleAlreadyExists < SlackError; end class HashConflict < SlackError; end class InactiveCall < SlackError; end + class InsecureRequest < SlackError; end class InternalError < SlackError; end - class ServerError < InternalError; end - class ParsingError < ServerError; end - class HttpRequestError < ServerError; end - class TimeoutError < HttpRequestError; end - class UnavailableError < HttpRequestError; end class InvalidActor < SlackError; end class InvalidAppId < SlackError; end class InvalidArgName < SlackError; end @@ -184,6 +193,8 @@ class InvalidClientId < SlackError; end class InvalidCode < SlackError; end class InvalidCreatedBy < SlackError; end class InvalidCursor < SlackError; end + class InvalidDate < SlackError; end + class InvalidDuration < SlackError; end class InvalidEmail < SlackError; end class InvalidEventContext < SlackError; end class InvalidExternalId < SlackError; end @@ -205,6 +216,7 @@ class InvalidPresence < SlackError; end class InvalidProfile < SlackError; end class InvalidRequest < SlackError; end class InvalidRequestId < SlackError; end + class InvalidRestrictedSubjects < SlackError; end class InvalidRoleForUser < SlackError; end class InvalidScheduledMessageId < SlackError; end class InvalidScope < SlackError; end @@ -223,6 +235,7 @@ class InvalidToken < SlackError; end class InvalidTrigger < SlackError; end class InvalidTsLatest < SlackError; end class InvalidTsOldest < SlackError; end + class InvalidType < SlackError; end class InvalidTypes < SlackError; end class InvalidUnfurlsFormat < SlackError; end class InvalidUrl < SlackError; end @@ -241,10 +254,12 @@ class LeavingTeamNotInChannel < SlackError; end class LeavingTeamRequired < SlackError; end class LimitRequired < SlackError; end class LinkNotFound < SlackError; end + class MemberAnalyticsDisabled < SlackError; end class MessageNotFound < SlackError; end class MethodDeprecated < SlackError; end class MethodNotSupportedForChannelType < SlackError; end class MigrationInProgress < SlackError; end + class MissingArgs < SlackError; end class MissingArgument < SlackError; end class MissingChannel < SlackError; end class MissingDialog < SlackError; end @@ -253,9 +268,11 @@ class MissingPostType < SlackError; end class MissingResource < SlackError; end class MissingScope < SlackError; end class MissingSubteamName < SlackError; end + class MissingTeam < SlackError; end class MissingTrigger < SlackError; end class MissingTs < SlackError; end class MissingUnfurls < SlackError; end + class MissingUser < SlackError; end class MixedScope < SlackError; end class MsgTooLong < SlackError; end class MustProvideTeamDomain < SlackError; end @@ -263,6 +280,7 @@ class MustProvideTeamName < SlackError; end class NameAlreadyExists < SlackError; end class NameTaken < SlackError; end class NameTakenInOrg < SlackError; end + class NoActiveSessions < SlackError; end class NoAliasSelected < SlackError; end class NoBotUserForApp < SlackError; end class NoChannel < SlackError; end @@ -270,7 +288,9 @@ class NoImageUploaded < SlackError; end class NoItemSpecified < SlackError; end class NoLocalUserOnTeam < SlackError; end class NoPermission < SlackError; end + class NoPin < SlackError; end class NoReaction < SlackError; end + class NoResolutionFound < SlackError; end class NoScopes < SlackError; end class NoSuchSubteam < SlackError; end class NoTeamIdsGiven < SlackError; end @@ -303,7 +323,9 @@ class NotReactable < SlackError; end class NotStarred < SlackError; end class NotSupported < SlackError; end class OauthAuthorizationUrlMismatch < SlackError; end + class OrgLevelEmailDisplayDisabled < SlackError; end class OrgLoginRequired < SlackError; end + class OrgNotFound < SlackError; end class OrgUserNotInTeam < SlackError; end class OverPaginationLimit < SlackError; end class PaginationNotAvailable < SlackError; end @@ -313,6 +335,7 @@ class PermissionDenied < SlackError; end class PlanUpgradeRequired < SlackError; end class PostingToGeneralChannelDenied < SlackError; end class PreviewFeatureNotAvailable < SlackError; end + class PrimaryUsergroupNotFound < SlackError; end class ProfileSetFailed < SlackError; end class PublicVideoNotAllowed < SlackError; end class PushLimitReached < SlackError; end @@ -328,16 +351,20 @@ class RestrictedAction < SlackError; end class RestrictedActionNonThreadableChannel < SlackError; end class RestrictedActionReadOnlyChannel < SlackError; end class RestrictedActionThreadOnlyChannel < SlackError; end + class RetentionOverrideNotAllowed < SlackError; end class RtmConnectRequired < SlackError; end class SentRecently < SlackError; end class ServiceUnavailable < SlackError; end class SessionExpired < SlackError; end class SessionInvalidationFailed < SlackError; end class SessionNotFound < SlackError; end + class SlackConnectFileLinkSharingBlocked < SlackError; end + class SlackConnectFileUploadSharingBlocked < SlackError; end class SnoozeEndFailed < SlackError; end class SnoozeFailed < SlackError; end class SnoozeNotActive < SlackError; end class SubteamMaxUsersExceeded < SlackError; end + class TeamAccessNotGranted < SlackError; end class TeamAddedToOrg < SlackError; end class TeamIdOrOrgRequired < SlackError; end class TeamNotFound < SlackError; end @@ -414,6 +441,7 @@ class ViewTooLarge < SlackError; end 'app_missing_action_url' => AppMissingActionUrl, 'app_restricted_org_wide' => AppRestrictedOrgWide, 'as_user_not_supported' => AsUserNotSupported, + 'authed_user_not_found' => AuthedUserNotFound, 'auto_provision_failure' => AutoProvisionFailure, 'bad_client_secret' => BadClientSecret, 'bad_handle' => BadHandle, @@ -424,7 +452,11 @@ class ViewTooLarge < SlackError; end 'bad_token' => BadToken, 'bad_url' => BadUrl, 'bad_users' => BadUsers, + 'barrier_already_exists' => BarrierAlreadyExists, + 'barrier_not_found' => BarrierNotFound, + 'barriered_from_usergroups_not_found' => BarrieredFromUsergroupsNotFound, 'bot_not_found' => BotNotFound, + 'bots_not_allowed' => BotsNotAllowed, 'bots_not_found' => BotsNotFound, 'cannot_add_bot' => CannotAddBot, 'cannot_add_more_channels_to_group' => CannotAddMoreChannelsToGroup, @@ -432,6 +464,7 @@ class ViewTooLarge < SlackError; end 'cannot_add_others' => CannotAddOthers, 'cannot_add_others_recurring' => CannotAddOthersRecurring, 'cannot_add_slackbot' => CannotAddSlackbot, + 'cannot_auth_user' => CannotAuthUser, 'cannot_complete_others' => CannotCompleteOthers, 'cannot_complete_recurring' => CannotCompleteRecurring, 'cannot_create_dialog' => CannotCreateDialog, @@ -476,11 +509,15 @@ class ViewTooLarge < SlackError; end 'could_not_create_workspace' => CouldNotCreateWorkspace, 'could_not_delete_channel' => CouldNotDeleteChannel, 'could_not_get_conversation_prefs' => CouldNotGetConversationPrefs, + 'could_not_get_retention' => CouldNotGetRetention, 'could_not_get_teams' => CouldNotGetTeams, + 'could_not_remove_retention' => CouldNotRemoveRetention, 'could_not_rename_channel' => CouldNotRenameChannel, 'could_not_set_channel_pref' => CouldNotSetChannelPref, + 'could_not_set_retention' => CouldNotSetRetention, 'could_not_set_teams_for_channel' => CouldNotSetTeamsForChannel, 'could_not_unarchive_channel' => CouldNotUnarchiveChannel, + 'data_not_available' => DataNotAvailable, 'default_channel_restricted' => DefaultChannelRestricted, 'default_org_wide_channel' => DefaultOrgWideChannel, 'deprecated_endpoint' => DeprecatedEndpoint, @@ -496,6 +533,7 @@ class ViewTooLarge < SlackError; end 'emoji_limit_reached' => EmojiLimitReached, 'emoji_not_found' => EmojiNotFound, 'enterprise_is_restricted' => EnterpriseIsRestricted, + 'enterprise_not_found' => EnterpriseNotFound, 'error_bad_format' => ErrorBadFormat, 'error_bad_name_i18n' => ErrorBadNameI18n, 'error_bad_upload' => ErrorBadUpload, @@ -509,6 +547,7 @@ class ViewTooLarge < SlackError; end 'error_too_big' => ErrorTooBig, 'external_channel_migrating' => ExternalChannelMigrating, 'externally_shared_or_disconnected_channel' => ExternallySharedOrDisconnectedChannel, + 'fail_to_get_teams_for_restricted_user' => FailToGetTeamsForRestrictedUser, 'failed_for_some_users' => FailedForSomeUsers, 'failed_looking_up_user' => FailedLookingUpUser, 'failed_sending_dialog' => FailedSendingDialog, @@ -544,6 +583,7 @@ class ViewTooLarge < SlackError; end 'file_deleting_disabled' => FileDeletingDisabled, 'file_not_found' => FileNotFound, 'file_not_shared' => FileNotShared, + 'file_not_yet_available' => FileNotYetAvailable, 'file_under_review' => FileUnderReview, 'forbidden_handle' => ForbiddenHandle, 'group_already_linked_to_channel' => GroupAlreadyLinkedToChannel, @@ -553,6 +593,7 @@ class ViewTooLarge < SlackError; end 'handle_already_exists' => HandleAlreadyExists, 'hash_conflict' => HashConflict, 'inactive_call' => InactiveCall, + 'insecure_request' => InsecureRequest, 'internal_error' => InternalError, 'invalid_actor' => InvalidActor, 'invalid_app_id' => InvalidAppId, @@ -572,6 +613,8 @@ class ViewTooLarge < SlackError; end 'invalid_code' => InvalidCode, 'invalid_created_by' => InvalidCreatedBy, 'invalid_cursor' => InvalidCursor, + 'invalid_date' => InvalidDate, + 'invalid_duration' => InvalidDuration, 'invalid_email' => InvalidEmail, 'invalid_event_context' => InvalidEventContext, 'invalid_external_id' => InvalidExternalId, @@ -593,6 +636,7 @@ class ViewTooLarge < SlackError; end 'invalid_profile' => InvalidProfile, 'invalid_request' => InvalidRequest, 'invalid_request_id' => InvalidRequestId, + 'invalid_restricted_subjects' => InvalidRestrictedSubjects, 'invalid_role_for_user' => InvalidRoleForUser, 'invalid_scheduled_message_id' => InvalidScheduledMessageId, 'invalid_scope' => InvalidScope, @@ -611,6 +655,7 @@ class ViewTooLarge < SlackError; end 'invalid_trigger' => InvalidTrigger, 'invalid_ts_latest' => InvalidTsLatest, 'invalid_ts_oldest' => InvalidTsOldest, + 'invalid_type' => InvalidType, 'invalid_types' => InvalidTypes, 'invalid_unfurls_format' => InvalidUnfurlsFormat, 'invalid_url' => InvalidUrl, @@ -629,10 +674,12 @@ class ViewTooLarge < SlackError; end 'leaving_team_required' => LeavingTeamRequired, 'limit_required' => LimitRequired, 'link_not_found' => LinkNotFound, + 'member_analytics_disabled' => MemberAnalyticsDisabled, 'message_not_found' => MessageNotFound, 'method_deprecated' => MethodDeprecated, 'method_not_supported_for_channel_type' => MethodNotSupportedForChannelType, 'migration_in_progress' => MigrationInProgress, + 'missing_args' => MissingArgs, 'missing_argument' => MissingArgument, 'missing_channel' => MissingChannel, 'missing_dialog' => MissingDialog, @@ -641,9 +688,11 @@ class ViewTooLarge < SlackError; end 'missing_resource' => MissingResource, 'missing_scope' => MissingScope, 'missing_subteam_name' => MissingSubteamName, + 'missing_team' => MissingTeam, 'missing_trigger' => MissingTrigger, 'missing_ts' => MissingTs, 'missing_unfurls' => MissingUnfurls, + 'missing_user' => MissingUser, 'mixed_scope' => MixedScope, 'msg_too_long' => MsgTooLong, 'must_provide_team_domain' => MustProvideTeamDomain, @@ -651,6 +700,7 @@ class ViewTooLarge < SlackError; end 'name_already_exists' => NameAlreadyExists, 'name_taken' => NameTaken, 'name_taken_in_org' => NameTakenInOrg, + 'no_active_sessions' => NoActiveSessions, 'no_alias_selected' => NoAliasSelected, 'no_bot_user_for_app' => NoBotUserForApp, 'no_channel' => NoChannel, @@ -658,7 +708,9 @@ class ViewTooLarge < SlackError; end 'no_item_specified' => NoItemSpecified, 'no_local_user_on_team' => NoLocalUserOnTeam, 'no_permission' => NoPermission, + 'no_pin' => NoPin, 'no_reaction' => NoReaction, + 'no_resolution_found' => NoResolutionFound, 'no_scopes' => NoScopes, 'no_such_subteam' => NoSuchSubteam, 'no_team_ids_given' => NoTeamIdsGiven, @@ -691,7 +743,9 @@ class ViewTooLarge < SlackError; end 'not_starred' => NotStarred, 'not_supported' => NotSupported, 'oauth_authorization_url_mismatch' => OauthAuthorizationUrlMismatch, + 'org_level_email_display_disabled' => OrgLevelEmailDisplayDisabled, 'org_login_required' => OrgLoginRequired, + 'org_not_found' => OrgNotFound, 'org_user_not_in_team' => OrgUserNotInTeam, 'over_pagination_limit' => OverPaginationLimit, 'pagination_not_available' => PaginationNotAvailable, @@ -701,6 +755,7 @@ class ViewTooLarge < SlackError; end 'plan_upgrade_required' => PlanUpgradeRequired, 'posting_to_general_channel_denied' => PostingToGeneralChannelDenied, 'preview_feature_not_available' => PreviewFeatureNotAvailable, + 'primary_usergroup_not_found' => PrimaryUsergroupNotFound, 'profile_set_failed' => ProfileSetFailed, 'public_video_not_allowed' => PublicVideoNotAllowed, 'push_limit_reached' => PushLimitReached, @@ -716,16 +771,20 @@ class ViewTooLarge < SlackError; end 'restricted_action_non_threadable_channel' => RestrictedActionNonThreadableChannel, 'restricted_action_read_only_channel' => RestrictedActionReadOnlyChannel, 'restricted_action_thread_only_channel' => RestrictedActionThreadOnlyChannel, + 'retention_override_not_allowed' => RetentionOverrideNotAllowed, 'rtm_connect_required' => RtmConnectRequired, 'sent_recently' => SentRecently, 'service_unavailable' => ServiceUnavailable, 'session_expired' => SessionExpired, 'session_invalidation_failed' => SessionInvalidationFailed, 'session_not_found' => SessionNotFound, + 'slack_connect_file_link_sharing_blocked' => SlackConnectFileLinkSharingBlocked, + 'slack_connect_file_upload_sharing_blocked' => SlackConnectFileUploadSharingBlocked, 'snooze_end_failed' => SnoozeEndFailed, 'snooze_failed' => SnoozeFailed, 'snooze_not_active' => SnoozeNotActive, 'subteam_max_users_exceeded' => SubteamMaxUsersExceeded, + 'team_access_not_granted' => TeamAccessNotGranted, 'team_added_to_org' => TeamAddedToOrg, 'team_id_or_org_required' => TeamIdOrOrgRequired, 'team_not_found' => TeamNotFound, diff --git a/lib/slack/web/api/errors/internal_error.rb b/lib/slack/web/api/errors/internal_error.rb new file mode 100644 index 00000000..0973993c --- /dev/null +++ b/lib/slack/web/api/errors/internal_error.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true +module Slack + module Web + module Api + module Errors + class ServerError < InternalError; end + class ParsingError < ServerError; end + class HttpRequestError < ServerError; end + class TimeoutError < HttpRequestError; end + class UnavailableError < HttpRequestError; end + end + end + end +end diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 6ecf522b..944bb458 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 6ecf522b1c5258bda74e3426646501f6956d2ce8 +Subproject commit 944bb458c254251fc47a9fef9185d629b8332e86 diff --git a/spec/slack/web/api/endpoints/admin_analytics_spec.rb b/spec/slack/web/api/endpoints/admin_analytics_spec.rb new file mode 100644 index 00000000..608f6e33 --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_analytics_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminAnalytics do + let(:client) { Slack::Web::Client.new } + context 'admin.analytics_getFile' do + it 'requires type' do + expect { client.admin_analytics_getFile }.to raise_error ArgumentError, /Required arguments :type missing/ + end + end +end diff --git a/spec/slack/web/api/endpoints/admin_apps_spec.rb b/spec/slack/web/api/endpoints/admin_apps_spec.rb index 52d1772c..8661ae6f 100644 --- a/spec/slack/web/api/endpoints/admin_apps_spec.rb +++ b/spec/slack/web/api/endpoints/admin_apps_spec.rb @@ -5,4 +5,9 @@ RSpec.describe Slack::Web::Api::Endpoints::AdminApps do let(:client) { Slack::Web::Client.new } + context 'admin.apps_clearResolution' do + it 'requires app_id' do + expect { client.admin_apps_clearResolution }.to raise_error ArgumentError, /Required arguments :app_id missing/ + end + end end diff --git a/spec/slack/web/api/endpoints/admin_barriers_spec.rb b/spec/slack/web/api/endpoints/admin_barriers_spec.rb new file mode 100644 index 00000000..64bbcd65 --- /dev/null +++ b/spec/slack/web/api/endpoints/admin_barriers_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true +# This file was auto-generated by lib/tasks/web.rake + +require 'spec_helper' + +RSpec.describe Slack::Web::Api::Endpoints::AdminBarriers do + let(:client) { Slack::Web::Client.new } + context 'admin.barriers_create' do + it 'requires barriered_from_usergroup_ids' do + expect { client.admin_barriers_create(primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barriered_from_usergroup_ids missing/ + end + it 'requires primary_usergroup_id' do + expect { client.admin_barriers_create(barriered_from_usergroup_ids: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :primary_usergroup_id missing/ + end + it 'requires restricted_subjects' do + expect { client.admin_barriers_create(barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :restricted_subjects missing/ + end + end + context 'admin.barriers_delete' do + it 'requires barrier_id' do + expect { client.admin_barriers_delete }.to raise_error ArgumentError, /Required arguments :barrier_id missing/ + end + end + context 'admin.barriers_update' do + it 'requires barrier_id' do + expect { client.admin_barriers_update(barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barrier_id missing/ + end + it 'requires barriered_from_usergroup_ids' do + expect { client.admin_barriers_update(barrier_id: %q[], primary_usergroup_id: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :barriered_from_usergroup_ids missing/ + end + it 'requires primary_usergroup_id' do + expect { client.admin_barriers_update(barrier_id: %q[], barriered_from_usergroup_ids: %q[], restricted_subjects: %q[]) }.to raise_error ArgumentError, /Required arguments :primary_usergroup_id missing/ + end + it 'requires restricted_subjects' do + expect { client.admin_barriers_update(barrier_id: %q[], barriered_from_usergroup_ids: %q[], primary_usergroup_id: %q[]) }.to raise_error ArgumentError, /Required arguments :restricted_subjects missing/ + end + end +end diff --git a/spec/slack/web/api/endpoints/admin_conversations_spec.rb b/spec/slack/web/api/endpoints/admin_conversations_spec.rb index 094bbc61..ba49258b 100644 --- a/spec/slack/web/api/endpoints/admin_conversations_spec.rb +++ b/spec/slack/web/api/endpoints/admin_conversations_spec.rb @@ -38,6 +38,11 @@ expect { client.admin_conversations_getConversationPrefs }.to raise_error ArgumentError, /Required arguments :channel_id missing/ end end + context 'admin.conversations_getCustomRetention' do + it 'requires channel_id' do + expect { client.admin_conversations_getCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end context 'admin.conversations_getTeams' do it 'requires channel_id' do expect { client.admin_conversations_getTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/ @@ -51,6 +56,11 @@ expect { client.admin_conversations_invite(channel_id: %q[C12345]) }.to raise_error ArgumentError, /Required arguments :user_ids missing/ end end + context 'admin.conversations_removeCustomRetention' do + it 'requires channel_id' do + expect { client.admin_conversations_removeCustomRetention }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + end context 'admin.conversations_rename' do it 'requires channel_id' do expect { client.admin_conversations_rename(name: %q[]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/ @@ -67,6 +77,14 @@ expect { client.admin_conversations_setConversationPrefs(channel_id: %q[C1234]) }.to raise_error ArgumentError, /Required arguments :prefs missing/ end end + context 'admin.conversations_setCustomRetention' do + it 'requires channel_id' do + expect { client.admin_conversations_setCustomRetention(duration_days: %q[500]) }.to raise_error ArgumentError, /Required arguments :channel_id missing/ + end + it 'requires duration_days' do + expect { client.admin_conversations_setCustomRetention(channel_id: %q[C12345678]) }.to raise_error ArgumentError, /Required arguments :duration_days missing/ + end + end context 'admin.conversations_setTeams' do it 'requires channel_id' do expect { client.admin_conversations_setTeams }.to raise_error ArgumentError, /Required arguments :channel_id missing/ diff --git a/spec/slack/web/api/endpoints/admin_users_session_spec.rb b/spec/slack/web/api/endpoints/admin_users_session_spec.rb index 48dcb9f3..26e42b1f 100644 --- a/spec/slack/web/api/endpoints/admin_users_session_spec.rb +++ b/spec/slack/web/api/endpoints/admin_users_session_spec.rb @@ -7,10 +7,10 @@ let(:client) { Slack::Web::Client.new } context 'admin.users.session_invalidate' do it 'requires session_id' do - expect { client.admin_users_session_invalidate(team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :session_id missing/ + expect { client.admin_users_session_invalidate(team_id: %q[T1234]) }.to raise_error ArgumentError, /Required arguments :session_id missing/ end it 'requires team_id' do - expect { client.admin_users_session_invalidate(session_id: %q[]) }.to raise_error ArgumentError, /Required arguments :team_id missing/ + expect { client.admin_users_session_invalidate(session_id: %q[12345]) }.to raise_error ArgumentError, /Required arguments :team_id missing/ end end context 'admin.users.session_reset' do diff --git a/spec/slack/web/api/endpoints/admin_users_spec.rb b/spec/slack/web/api/endpoints/admin_users_spec.rb index 40ca8177..53a302c0 100644 --- a/spec/slack/web/api/endpoints/admin_users_spec.rb +++ b/spec/slack/web/api/endpoints/admin_users_spec.rb @@ -24,11 +24,6 @@ expect { client.admin_users_invite(channel_ids: %q[C1A2B3C4D,C26Z25Y24], email: %q[joe@email.com]) }.to raise_error ArgumentError, /Required arguments :team_id missing/ end end - context 'admin.users_list' do - it 'requires team_id' do - expect { client.admin_users_list }.to raise_error ArgumentError, /Required arguments :team_id missing/ - end - end context 'admin.users_remove' do it 'requires team_id' do expect { client.admin_users_remove(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/ @@ -47,13 +42,10 @@ end context 'admin.users_setExpiration' do it 'requires expiration_ts' do - expect { client.admin_users_setExpiration(team_id: %q[], user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :expiration_ts missing/ - end - it 'requires team_id' do - expect { client.admin_users_setExpiration(expiration_ts: %q[1234567890], user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :team_id missing/ + expect { client.admin_users_setExpiration(user_id: %q[W12345678]) }.to raise_error ArgumentError, /Required arguments :expiration_ts missing/ end it 'requires user_id' do - expect { client.admin_users_setExpiration(expiration_ts: %q[1234567890], team_id: %q[]) }.to raise_error ArgumentError, /Required arguments :user_id missing/ + expect { client.admin_users_setExpiration(expiration_ts: %q[1234567890]) }.to raise_error ArgumentError, /Required arguments :user_id missing/ end end context 'admin.users_setOwner' do diff --git a/spec/slack/web/api/endpoints/apps_connections_spec.rb b/spec/slack/web/api/endpoints/apps_connections_spec.rb new file mode 100644 index 00000000..afbd608b --- /dev/null +++ b/spec/slack/web/api/endpoints/apps_connections_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::AppsConnections do + let(:client) { Slack::Web::Client.new } +end diff --git a/spec/slack/web/api/endpoints/auth_teams_spec.rb b/spec/slack/web/api/endpoints/auth_teams_spec.rb new file mode 100644 index 00000000..936b456b --- /dev/null +++ b/spec/slack/web/api/endpoints/auth_teams_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::AuthTeams do + let(:client) { Slack::Web::Client.new } +end diff --git a/spec/slack/web/api/endpoints/mpim_spec.rb b/spec/slack/web/api/endpoints/mpim_spec.rb index 9128b066..c81cb3e0 100644 --- a/spec/slack/web/api/endpoints/mpim_spec.rb +++ b/spec/slack/web/api/endpoints/mpim_spec.rb @@ -17,10 +17,10 @@ end context 'mpim_mark' do it 'requires channel' do - expect { client.mpim_mark(ts: %q[1234567890.123456]) }.to raise_error ArgumentError, /Required arguments :channel missing/ + expect { client.mpim_mark(ts: %q[1593473566.000200]) }.to raise_error ArgumentError, /Required arguments :channel missing/ end it 'requires ts' do - expect { client.mpim_mark(channel: %q[G1234567890]) }.to raise_error ArgumentError, /Required arguments :ts missing/ + expect { client.mpim_mark(channel: %q[C012345678]) }.to raise_error ArgumentError, /Required arguments :ts missing/ end end context 'mpim_open' do