Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added admin_teams_settings_info, admin_users_list, `admin_users_s… #313

Merged
merged 1 commit into from
Mar 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
### 0.14.6 (Next)

* [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin.inviteRequests.approve`, `admin.inviteRequests.deny`, `admin.inviteRequests.list`, `admin.inviteRequests.approved.list`, `admin.inviteRequests.denied.list`, `admin.teams.create`, `admin.teams.list`, `admin.teams.admins.list`, `admin.teams.owners.list`, `admin.teams.settings`, `admin.teams.settings.setIcon`, `admin.teams.settings.setName`, `admin.teams.settings.setDescription`, `admin.users.assign`, `admin.users.invite`, `admin.users.remove`, `admin.users.setAdmin`, `admin.users.setOwner` and `admin.users.setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
* [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin_inviteRequests_approve`, `admin_inviteRequests_deny`, `admin_inviteRequests_list`, `admin_inviteRequests_approved_list`, `admin_inviteRequests_denied_list`, `admin_teams_create`, `admin_teams_list`, `admin_teams_admins_list`, `admin_teams_owners_list`, `admin_teams_settings`, `admin_teams_settings_setIcon`, `admin_teams_settings_setName`, `admin_teams_settings_setDescription`, `admin_users_assign`, `admin_users_invite`, `admin_users_remove`, `admin_users_setAdmin`, `admin_users_setOwner` and `admin_users_setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
* [#311](https://github.com/slack-ruby/slack-ruby-client/pull/311): Made Web API `response_metadata` more accessible in errors - [@jmanian](https://github.com/jmanian).
* [#312](https://github.com/slack-ruby/slack-ruby-client/pull/312): Added specific error classes for Web API - [@jmanian](https://github.com/jmanian).
* [#313](https://github.com/slack-ruby/slack-ruby-client/pull/313): Added `admin_teams_settings_info`, `admin_users_list`, `admin_users_setExpiration`, `admin_apps_approved_list`, `admin_apps_restricted_list`, `admin_conversations_setTeams`, `admin_emoji_add`, `admin_emoji_addAlias`, `admin_emoji_list`, `admin_emoji_remove` and `admin_emoji_rename` endpoints - [@dblock](https://github.com/dblock).
* Your contribution here.

### 0.14.5 (2019/12/23)

* [#293](https://github.com/slack-ruby/slack-ruby-client/pull/293): Rubocop auto-correct and comprehensive todo - [@jcraigk](https://github.com/jcraigk).
* [#297](https://github.com/slack-ruby/slack-ruby-client/pull/297): Various Rubocop fixes - [@jcraigk](https://github.com/jcraigk).
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Added `admin.apps`, `admin.app.requests` and `views` endpoints - [@jmanian](https://github.com/jmanian).
* [#303](https://github.com/slack-ruby/slack-ruby-client/pull/303): Added `oauth.v2.access` and `views.publish` endpoints - [@jwright](https://github.com/jwright).
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Added `admin_apps`, `admin_app_requests` and `views` endpoints - [@jmanian](https://github.com/jmanian).
* [#303](https://github.com/slack-ruby/slack-ruby-client/pull/303): Added `oauth_v2_access` and `views_publish` endpoints - [@jwright](https://github.com/jwright).
* [#309](https://github.com/slack-ruby/slack-ruby-client/pull/309): Stop ping on `inactive_account` and `invalid_auth` - [@dblock](https://github.com/dblock).

### 0.14.4 (2019/7/28)
Expand Down
4 changes: 4 additions & 0 deletions bin/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# This file was auto-generated by lib/tasks/web.rake

require 'commands/admin_apps'
require 'commands/admin_apps_approved'
require 'commands/admin_apps_requests'
require 'commands/admin_apps_restricted'
require 'commands/admin_conversations'
require 'commands/admin_emoji'
require 'commands/admin_inviteRequests'
require 'commands/admin_inviteRequests_approved'
require 'commands/admin_inviteRequests_denied'
Expand Down
17 changes: 17 additions & 0 deletions bin/commands/admin_apps_approved.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

desc 'AdminAppsApproved methods.'
command 'admin_apps_approved' do |g|
g.desc 'List approved apps for an org or workspace.'
g.long_desc %( List approved apps for an org or workspace. )
g.command 'list' do |c|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'enterprise_id', desc: '.'
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
c.flag 'team_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_apps_approved_list(options))
end
end
end
17 changes: 17 additions & 0 deletions bin/commands/admin_apps_restricted.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

desc 'AdminAppsRestricted methods.'
command 'admin_apps_restricted' do |g|
g.desc 'List restricted apps for an org or workspace.'
g.long_desc %( List restricted apps for an org or workspace. )
g.command 'list' do |c|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'enterprise_id', desc: '.'
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
c.flag 'team_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_apps_restricted_list(options))
end
end
end
17 changes: 17 additions & 0 deletions bin/commands/admin_conversations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

desc 'AdminConversations methods.'
command 'admin_conversations' do |g|
g.desc 'Set the workspaces in an Enterprise grid org that connect to a channel.'
g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a channel. )
g.command 'setTeams' do |c|
c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
c.flag 'target_team_ids', desc: "The list of workspaces to which the channel should be shared. Not required if the channel is being shared orgwide. Example: ['T1234', 'T5678']."
c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_conversations_setTeams(options))
end
end
end
54 changes: 54 additions & 0 deletions bin/commands/admin_emoji.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

desc 'AdminEmoji methods.'
command 'admin_emoji' do |g|
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 '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))
end
end

g.desc 'Add an emoji alias.'
g.long_desc %( Add an emoji alias. )
g.command 'addAlias' do |c|
c.flag 'alias_for', desc: 'The alias of the emoji.'
c.flag 'name', desc: 'The name of the emoji to be aliased. Colons (:myemoji:) around the value are not required, although they may be included.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_emoji_addAlias(options))
end
end

g.desc 'List emoji for an Enterprise Grid organization.'
g.long_desc %( List emoji for an Enterprise Grid 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_emoji_list(options))
end
end

g.desc 'Remove an emoji across an Enterprise Grid organization'
g.long_desc %( Remove an emoji across an Enterprise Grid organization )
g.command 'remove' 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.action do |_global_options, options, _args|
puts JSON.dump($client.admin_emoji_remove(options))
end
end

g.desc 'Rename an emoji.'
g.long_desc %( Rename an emoji. )
g.command 'rename' do |c|
c.flag 'name', desc: 'The name of the emoji to be renamed. Colons (:myemoji:) around the value are not required, although they may be included.'
c.flag 'new_name', desc: 'The new name of the emoji.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_emoji_rename(options))
end
end
end
35 changes: 32 additions & 3 deletions bin/commands/admin_teams_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,49 @@

desc 'AdminTeamsSettings methods.'
command 'admin_teams_settings' do |g|
g.desc 'Fetch information about settings in a workspace'
g.long_desc %( Fetch information about settings in a workspace )
g.command 'info' do |c|
c.flag 'team_id', desc: '.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_teams_settings_info(options))
end
end

g.desc 'Set the default channels of a workspace.'
g.long_desc %( Set the default channels of a workspace. )
g.command 'setDefaultChannels' do |c|
c.flag 'channel_ids', desc: 'An array of channel IDs.'
c.flag 'team_id', desc: 'ID for the workspace to set the default channel for.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_teams_settings_setDefaultChannels(options))
end
end

g.desc 'Set the description of a given workspace.'
g.long_desc %( Set the description of a given workspace. )
g.command 'setDescription' do |c|
c.flag 'description', desc: '.'
c.flag 'description', desc: 'The new description for the workspace.'
c.flag 'team_id', desc: 'ID for the workspace to set the description for.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_teams_settings_setDescription(options))
end
end

g.desc 'An API method that allows admins to set the discoverability of a given workspace'
g.long_desc %( An API method that allows admins to set the discoverability of a given workspace )
g.command 'setDiscoverability' do |c|
c.flag 'discoverability', desc: "This workspace's discovery setting. It must be set to one of open, invite_only, closed, or unlisted."
c.flag 'team_id', desc: 'The ID of the workspace to set discoverability on.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_teams_settings_setDiscoverability(options))
end
end

g.desc 'Sets the icon of a workspace.'
g.long_desc %( Sets the icon of a workspace. )
g.command 'setIcon' do |c|
c.flag 'image_url', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'image_url', desc: 'Image URL for the icon.'
c.flag 'team_id', desc: 'ID for the workspace to set the icon for.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_teams_settings_setIcon(options))
Expand All @@ -26,7 +55,7 @@
g.desc 'Set the name of a given workspace.'
g.long_desc %( Set the name of a given workspace. )
g.command 'setName' do |c|
c.flag 'name', desc: '.'
c.flag 'name', desc: 'The new name of the workspace.'
c.flag 'team_id', desc: 'ID for the workspace to set the name for.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.admin_teams_settings_setName(options))
Expand Down
23 changes: 23 additions & 0 deletions bin/commands/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
g.command 'assign' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'The ID of the user to add to the workspace.'
c.flag 'channel_ids', desc: 'Comma separated values of channel IDs to add user in the new workspace.'
c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.'
c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.'
c.action do |_global_options, options, _args|
Expand All @@ -32,6 +33,17 @@
end
end

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.action do |_global_options, options, _args|
puts JSON.dump($client.admin_users_list(options))
end
end

g.desc 'Remove a user from a workspace.'
g.long_desc %( Remove a user from a workspace. )
g.command 'remove' do |c|
Expand All @@ -52,6 +64,17 @@
end
end

g.desc 'Set an expiration for a guest user'
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.action do |_global_options, options, _args|
puts JSON.dump($client.admin_users_setExpiration(options))
end
end

g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.'
g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
g.command 'setOwner' do |c|
Expand Down
16 changes: 8 additions & 8 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
g.command 'postEphemeral' do |c|
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead."
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
c.flag 'as_user', desc: 'Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
Expand All @@ -80,12 +80,12 @@
g.long_desc %( Sends a message to a channel. )
g.command 'postMessage' do |c|
c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation."
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.'
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
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.'
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.'
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 '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.'
Expand All @@ -104,12 +104,12 @@
g.command 'scheduleMessage' do |c|
c.flag 'channel', desc: 'Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
c.flag 'post_at', desc: 'Unix EPOCH timestamp of time in future to send the message.'
c.flag 'text', desc: "Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation."
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.'
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See chat.postMessage.'
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 'link_names', desc: 'Find and link channel names and usernames.'
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See chat.postMessage.'
c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
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.'
Expand Down
1 change: 1 addition & 0 deletions bin/commands/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
g.long_desc %( Lists & filters team files. )
g.command 'list' do |c|
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
c.flag '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 '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.'
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/files_remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
c.flag 'external_url', desc: 'URL of the remote file.'
c.flag 'title', desc: 'Title of the file being shared.'
c.flag 'filetype', desc: 'type of file.'
c.flag 'indexable_file_contents', desc: 'File containing contents that can be used to improve searchability for the remote file.'
c.flag 'indexable_file_contents', desc: 'A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.'
c.flag 'preview_image', desc: 'Preview of the document via multipart/form-data.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.files_remote_add(options))
Expand Down
Loading