From 43ea064dee22689e4ab9470ceb4f366d88c19b65 Mon Sep 17 00:00:00 2001 From: slack-ruby-ci-bot Date: Mon, 5 Oct 2026 23:24:21 +0000 Subject: [PATCH] Update API from slack-api-ref@85988b6 (2026-10-05) - Add admin.usergroups.addUsers, admin.usergroups.removeUsers, admin.usergroups.create, admin.usergroups.fetch, admin.usergroups.update, and admin.usergroups.uploadUsers methods - Add canvases.getContent method to fetch canvas content as markdown or HTML - Add new Slack API error codes to Errors --- CHANGELOG.md | 3 + bin/commands/admin_conversations.rb | 4 +- bin/commands/admin_usergroups.rb | 64 +++++++++++++ bin/commands/canvases.rb | 10 ++ .../web/api/endpoints/admin_conversations.rb | 2 +- .../web/api/endpoints/admin_usergroups.rb | 96 +++++++++++++++++++ lib/slack/web/api/endpoints/canvases.rb | 14 +++ lib/slack/web/api/errors.rb | 18 ++++ lib/slack/web/api/slack-api-ref | 2 +- .../api/endpoints/admin_usergroups_spec.rb | 44 +++++++++ spec/slack/web/api/endpoints/canvases_spec.rb | 5 + .../api/endpoints/slackLists_items_spec.rb | 2 +- 12 files changed, 259 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f5298f..fe637f2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ * [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add include_list argument to slackLists.items.list - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Update chat.startStream and chat.stopStream chunks argument documentation to mention markdown text, task update, plan update, and blocks chunk objects - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * [#600](https://github.com/slack-ruby/slack-ruby-client/pull/600): Add new error codes including AgentPromptDisplayNotAllowed, ChannelRestrictionRequiresAppAccess, ChannelRestrictionsNotAvailable, RotationNotFound, TokenTooLong, TooManyChannels, UserIsExternalGuest, and UserNotAuthenticated - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#608](https://github.com/slack-ruby/slack-ruby-client/pull/608): Add admin.usergroups.addUsers, admin.usergroups.removeUsers, admin.usergroups.create, admin.usergroups.fetch, admin.usergroups.update, and admin.usergroups.uploadUsers methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#608](https://github.com/slack-ruby/slack-ruby-client/pull/608): Add canvases.getContent method to fetch canvas content as markdown or HTML - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). +* [#608](https://github.com/slack-ruby/slack-ruby-client/pull/608): Add new Slack API error codes to Errors - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot). * Your contribution here. ### 3.2.0 (2026/07/05) diff --git a/bin/commands/admin_conversations.rb b/bin/commands/admin_conversations.rb index 7317a816..ea2dfcef 100644 --- a/bin/commands/admin_conversations.rb +++ b/bin/commands/admin_conversations.rb @@ -43,8 +43,8 @@ class App end end - g.desc 'Exclude channels from Slack AI in bulk' - g.long_desc %( Exclude channels from Slack AI in bulk ) + g.desc 'Exclude channels from Slack AI in bulk.' + g.long_desc %( Exclude channels from Slack AI in bulk. ) g.command 'bulkSetExcludeFromSlackAi' do |c| c.flag 'channel_ids', desc: 'An array of channel IDs to exclude from Slack AI.' c.flag 'exclude', desc: 'Whether the channels should be excluded from Slack AI.' diff --git a/bin/commands/admin_usergroups.rb b/bin/commands/admin_usergroups.rb index 1d30536d..ab34890e 100644 --- a/bin/commands/admin_usergroups.rb +++ b/bin/commands/admin_usergroups.rb @@ -28,6 +28,37 @@ class App end end + g.desc 'Add members to an existing organizational usergroup. This method is only available to Enterprise Grid organizations.' + g.long_desc %( Add members to an existing organizational usergroup. This method is only available to Enterprise Grid organizations. ) + g.command 'addUsers' do |c| + c.flag 'id', desc: 'ID of the usergroup to add users to.' + c.flag 'users', desc: 'The encoded user IDs to add to the usergroup, provided as a JSON array or a comma-separated string.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_usergroups_addUsers(options)) + end + end + + g.desc 'Create a new organizational usergroup. This method is only available to Enterprise Grid organizations.' + g.long_desc %( Create a new organizational usergroup. This method is only available to Enterprise Grid organizations. ) + g.command 'create' do |c| + c.flag 'name', desc: 'Unique name for the usergroup.' + c.flag 'handle', desc: 'Optional handle used to mention the usergroup in channel, must be unique.' + c.flag 'purpose', desc: 'Optional purpose that describes what the usergroup is about.' + c.flag 'is_visible', desc: 'Configure whether or not this usergroup should be visible in the client.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_usergroups_create(options)) + end + end + + g.desc 'Fetch an organizational usergroup.' + g.long_desc %( Fetch an organizational usergroup. ) + g.command 'fetch' do |c| + c.flag 'id', desc: 'ID of the usergroup to fetch.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_usergroups_fetch(options)) + end + end + g.desc 'List the channels linked to an org-level IDP group (user group).' g.long_desc %( List the channels linked to an org-level IDP group (user group). ) g.command 'listChannels' do |c| @@ -58,6 +89,39 @@ class App puts JSON.dump(@client.admin_usergroups_removeTeams(options)) end end + + g.desc 'Remove members from an existing organizational usergroup. This method is only available to Enterprise Grid organizations.' + g.long_desc %( Remove members from an existing organizational usergroup. This method is only available to Enterprise Grid organizations. ) + g.command 'removeUsers' do |c| + c.flag 'id', desc: 'ID of the usergroup to remove users from.' + c.flag 'users', desc: 'The encoded user IDs to remove from the usergroup, provided as a JSON array or a comma-separated string.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_usergroups_removeUsers(options)) + end + end + + g.desc 'Update one or more properties of an existing organizational usergroup.' + g.long_desc %( Update one or more properties of an existing organizational usergroup. ) + g.command 'update' do |c| + c.flag 'id', desc: 'ID of the usergroup to update.' + c.flag 'name', desc: 'The name of the group.' + c.flag 'handle', desc: 'The handle used for mentioning the group in a channel, must be unique.' + c.flag 'description', desc: "The usergroup's purpose or description." + c.flag 'is_visible', desc: 'Configure whether or not this usergroup should be visible in the client.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_usergroups_update(options)) + end + end + + g.desc 'Add members to an existing organizational usergroup in bulk via CSV upload. This method is only available to Enterprise Grid organizations.' + g.long_desc %( Add members to an existing organizational usergroup in bulk via CSV upload. This method is only available to Enterprise Grid organizations. ) + g.command 'uploadUsers' do |c| + c.flag 'id', desc: 'ID of the usergroup to upload users to.' + c.flag 'file', desc: 'Csv of users to upload in format member id, email.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.admin_usergroups_uploadUsers(options)) + end + end end end end diff --git a/bin/commands/canvases.rb b/bin/commands/canvases.rb index b863fc16..5de0c767 100644 --- a/bin/commands/canvases.rb +++ b/bin/commands/canvases.rb @@ -35,6 +35,16 @@ class App puts JSON.dump(@client.canvases_edit(options)) end end + + g.desc 'Get the content of a canvas as markdown (default) or HTML.' + g.long_desc %( Get the content of a canvas as markdown (default) or HTML. ) + g.command 'getContent' do |c| + c.flag 'canvas_id', desc: 'Encoded ID of the canvas.' + c.flag 'content_type', desc: 'Format in which to return the canvas content. Defaults to markdown.' + c.action do |_global_options, options, _args| + puts JSON.dump(@client.canvases_getContent(options)) + 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 1f15963d..1424ef7a 100644 --- a/lib/slack/web/api/endpoints/admin_conversations.rb +++ b/lib/slack/web/api/endpoints/admin_conversations.rb @@ -58,7 +58,7 @@ def admin_conversations_bulkMove(options = {}) end # - # Exclude channels from Slack AI in bulk + # Exclude channels from Slack AI in bulk. # # @option options [array] :channel_ids # An array of channel IDs to exclude from Slack AI. diff --git a/lib/slack/web/api/endpoints/admin_usergroups.rb b/lib/slack/web/api/endpoints/admin_usergroups.rb index ce66fd90..e6a3def9 100644 --- a/lib/slack/web/api/endpoints/admin_usergroups.rb +++ b/lib/slack/web/api/endpoints/admin_usergroups.rb @@ -40,6 +40,52 @@ def admin_usergroups_addTeams(options = {}) post('admin.usergroups.addTeams', options) end + # + # Add members to an existing organizational usergroup. This method is only available to Enterprise Grid organizations. + # + # @option options [string] :id + # ID of the usergroup to add users to. + # @option options [array] :users + # The encoded user IDs to add to the usergroup, provided as a JSON array or a comma-separated string. + # @see https://api.slack.com/methods/admin.usergroups.addUsers + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.addUsers.json + def admin_usergroups_addUsers(options = {}) + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? + raise ArgumentError, 'Required arguments :users missing' if options[:users].nil? + options = encode_options_as_json(options, %i[users]) + post('admin.usergroups.addUsers', options) + end + + # + # Create a new organizational usergroup. This method is only available to Enterprise Grid organizations. + # + # @option options [string] :name + # Unique name for the usergroup. + # @option options [string] :handle + # Optional handle used to mention the usergroup in channel, must be unique. + # @option options [string] :purpose + # Optional purpose that describes what the usergroup is about. + # @option options [boolean] :is_visible + # Configure whether or not this usergroup should be visible in the client. + # @see https://api.slack.com/methods/admin.usergroups.create + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.create.json + def admin_usergroups_create(options = {}) + raise ArgumentError, 'Required arguments :name missing' if options[:name].nil? + post('admin.usergroups.create', options) + end + + # + # Fetch an organizational usergroup. + # + # @option options [string] :id + # ID of the usergroup to fetch. + # @see https://api.slack.com/methods/admin.usergroups.fetch + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.fetch.json + def admin_usergroups_fetch(options = {}) + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? + post('admin.usergroups.fetch', options) + end + # # List the channels linked to an org-level IDP group (user group). # @@ -85,6 +131,56 @@ def admin_usergroups_removeTeams(options = {}) raise ArgumentError, 'Required arguments :team_ids missing' if options[:team_ids].nil? post('admin.usergroups.removeTeams', options) end + + # + # Remove members from an existing organizational usergroup. This method is only available to Enterprise Grid organizations. + # + # @option options [string] :id + # ID of the usergroup to remove users from. + # @option options [array] :users + # The encoded user IDs to remove from the usergroup, provided as a JSON array or a comma-separated string. + # @see https://api.slack.com/methods/admin.usergroups.removeUsers + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.removeUsers.json + def admin_usergroups_removeUsers(options = {}) + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? + raise ArgumentError, 'Required arguments :users missing' if options[:users].nil? + options = encode_options_as_json(options, %i[users]) + post('admin.usergroups.removeUsers', options) + end + + # + # Update one or more properties of an existing organizational usergroup. + # + # @option options [string] :id + # ID of the usergroup to update. + # @option options [string] :name + # The name of the group. + # @option options [string] :handle + # The handle used for mentioning the group in a channel, must be unique. + # @option options [string] :description + # The usergroup's purpose or description. + # @option options [boolean] :is_visible + # Configure whether or not this usergroup should be visible in the client. + # @see https://api.slack.com/methods/admin.usergroups.update + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.update.json + def admin_usergroups_update(options = {}) + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? + post('admin.usergroups.update', options) + end + + # + # Add members to an existing organizational usergroup in bulk via CSV upload. This method is only available to Enterprise Grid organizations. + # + # @option options [string] :id + # ID of the usergroup to upload users to. + # @option options [file] :file + # Csv of users to upload in format member id, email. + # @see https://api.slack.com/methods/admin.usergroups.uploadUsers + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.usergroups/admin.usergroups.uploadUsers.json + def admin_usergroups_uploadUsers(options = {}) + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? + post('admin.usergroups.uploadUsers', options) + end end end end diff --git a/lib/slack/web/api/endpoints/canvases.rb b/lib/slack/web/api/endpoints/canvases.rb index cdbb65e2..b67bed2a 100644 --- a/lib/slack/web/api/endpoints/canvases.rb +++ b/lib/slack/web/api/endpoints/canvases.rb @@ -47,6 +47,20 @@ def canvases_edit(options = {}) raise ArgumentError, 'Required arguments :changes missing' if options[:changes].nil? post('canvases.edit', options) end + + # + # Get the content of a canvas as markdown (default) or HTML. + # + # @option options [Object] :canvas_id + # Encoded ID of the canvas. + # @option options [enum] :content_type + # Format in which to return the canvas content. Defaults to markdown. + # @see https://api.slack.com/methods/canvases.getContent + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.getContent.json + def canvases_getContent(options = {}) + raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil? + post('canvases.getContent', options) + end end end end diff --git a/lib/slack/web/api/errors.rb b/lib/slack/web/api/errors.rb index d20147b9..12209dae 100644 --- a/lib/slack/web/api/errors.rb +++ b/lib/slack/web/api/errors.rb @@ -5,6 +5,7 @@ module Slack module Web module Api module Errors + class AccepterEmailNotVerified < SlackError; end class AccessDenied < SlackError; end class AccessTokenExchangeFailed < SlackError; end class Accesslimited < SlackError; end @@ -95,6 +96,7 @@ class CannotInstallAnOrgInstalledApp < SlackError; end class CannotInvalidatePrimaryOwner < SlackError; end class CannotKickHomeTeam < SlackError; end class CannotKickTeam < SlackError; end + class CannotModifyPrefAfterCreation < SlackError; end class CannotModifyPrimaryOwner < SlackError; end class CannotModifyRoleAdmin < SlackError; end class CannotMoveLocalChannel < SlackError; end @@ -424,6 +426,7 @@ class InvalidRecipientTeam < SlackError; end class InvalidRefreshToken < SlackError; end class InvalidRequest < SlackError; end class InvalidRequestId < SlackError; end + class InvalidResource < SlackError; end class InvalidRestrictedSubjects < SlackError; end class InvalidRoleForUser < SlackError; end class InvalidRoleId < SlackError; end @@ -463,6 +466,7 @@ class InvalidUrl < SlackError; end class InvalidUser < SlackError; end class InvalidUserCombination < SlackError; end class InvalidUserId < SlackError; end + class InvalidUsergroup < SlackError; end class InvalidUsers < SlackError; end class InvalidValue < SlackError; end class InvalidView < SlackError; end @@ -508,6 +512,7 @@ class MarkdownTextOrChunksRequired < SlackError; end class MarkdownTextRequired < SlackError; end class MaxFileSharingExceeded < SlackError; end class MemberAnalyticsDisabled < SlackError; end + class MemberCountWouldExceedVisibleLimit < SlackError; end class MemberLimitExceeded < SlackError; end class MessageLimitExceeded < SlackError; end class MessageNotFound < SlackError; end @@ -727,6 +732,7 @@ class SnoozeEndFailed < SlackError; end class SnoozeFailed < SlackError; end class SocketModeNotEnabled < SlackError; end class SpecifyEnterpriseOrTeams < SlackError; end + class StaticPromptsConfigured < SlackError; end class StoppedByUser < SlackError; end class StorageLimitReached < SlackError; end class StreamingModeMismatch < SlackError; end @@ -783,6 +789,7 @@ class TooManyTabs < SlackError; end class TooManyTargetTeams < SlackError; end class TooManyTeams < SlackError; end class TooManyTeamsProvided < SlackError; end + class TooManyUsergroupMembersToMakeVisible < SlackError; end class TooManyUsers < SlackError; end class TriggerExchanged < SlackError; end class TriggerExpired < SlackError; end @@ -793,6 +800,7 @@ class UnableToDelete < SlackError; end class UnableToFetchCustomEmojis < SlackError; end class UnableToLinkIdpGroupAndChannel < SlackError; end class UnableToOpenFile < SlackError; end + class UnableToParseCsv < SlackError; end class UnableToProcessPostRequest < SlackError; end class UnableToShareFiles < SlackError; end class UnableToUnlinkIdpGroupAndChannel < SlackError; end @@ -852,10 +860,12 @@ class UsersNotFound < SlackError; end class ValidationErrors < SlackError; end class ViewTooLarge < SlackError; end class VisibilityIsNotNamedEntities < SlackError; end + class VisibleGroupNeedsHandle < SlackError; end class WorkflowsExportCsvNotEnabled < SlackError; end class WorkspaceNotEligible < SlackError; end ERROR_CLASSES = { + 'accepter_email_not_verified' => AccepterEmailNotVerified, 'access_denied' => AccessDenied, 'access_token_exchange_failed' => AccessTokenExchangeFailed, 'accesslimited' => Accesslimited, @@ -946,6 +956,7 @@ class WorkspaceNotEligible < SlackError; end 'cannot_invalidate_primary_owner' => CannotInvalidatePrimaryOwner, 'cannot_kick_home_team' => CannotKickHomeTeam, 'cannot_kick_team' => CannotKickTeam, + 'cannot_modify_pref_after_creation' => CannotModifyPrefAfterCreation, 'cannot_modify_primary_owner' => CannotModifyPrimaryOwner, 'cannot_modify_role_admin' => CannotModifyRoleAdmin, 'cannot_move_local_channel' => CannotMoveLocalChannel, @@ -1275,6 +1286,7 @@ class WorkspaceNotEligible < SlackError; end 'invalid_refresh_token' => InvalidRefreshToken, 'invalid_request' => InvalidRequest, 'invalid_request_id' => InvalidRequestId, + 'invalid_resource' => InvalidResource, 'invalid_restricted_subjects' => InvalidRestrictedSubjects, 'invalid_role_for_user' => InvalidRoleForUser, 'invalid_role_id' => InvalidRoleId, @@ -1314,6 +1326,7 @@ class WorkspaceNotEligible < SlackError; end 'invalid_user' => InvalidUser, 'invalid_user_combination' => InvalidUserCombination, 'invalid_user_id' => InvalidUserId, + 'invalid_usergroup' => InvalidUsergroup, 'invalid_users' => InvalidUsers, 'invalid_value' => InvalidValue, 'invalid_view' => InvalidView, @@ -1359,6 +1372,7 @@ class WorkspaceNotEligible < SlackError; end 'markdown_text_required' => MarkdownTextRequired, 'max_file_sharing_exceeded' => MaxFileSharingExceeded, 'member_analytics_disabled' => MemberAnalyticsDisabled, + 'member_count_would_exceed_visible_limit' => MemberCountWouldExceedVisibleLimit, 'member_limit_exceeded' => MemberLimitExceeded, 'message_limit_exceeded' => MessageLimitExceeded, 'message_not_found' => MessageNotFound, @@ -1578,6 +1592,7 @@ class WorkspaceNotEligible < SlackError; end 'snooze_failed' => SnoozeFailed, 'socket_mode_not_enabled' => SocketModeNotEnabled, 'specify_enterprise_or_teams' => SpecifyEnterpriseOrTeams, + 'static_prompts_configured' => StaticPromptsConfigured, 'stopped_by_user' => StoppedByUser, 'storage_limit_reached' => StorageLimitReached, 'streaming_mode_mismatch' => StreamingModeMismatch, @@ -1634,6 +1649,7 @@ class WorkspaceNotEligible < SlackError; end 'too_many_target_teams' => TooManyTargetTeams, 'too_many_teams' => TooManyTeams, 'too_many_teams_provided' => TooManyTeamsProvided, + 'too_many_usergroup_members_to_make_visible' => TooManyUsergroupMembersToMakeVisible, 'too_many_users' => TooManyUsers, 'trigger_exchanged' => TriggerExchanged, 'trigger_expired' => TriggerExpired, @@ -1644,6 +1660,7 @@ class WorkspaceNotEligible < SlackError; end 'unable_to_fetch_custom_emojis' => UnableToFetchCustomEmojis, 'unable_to_link_idp_group_and_channel' => UnableToLinkIdpGroupAndChannel, 'unable_to_open_file' => UnableToOpenFile, + 'unable_to_parse_csv' => UnableToParseCsv, 'unable_to_process_post_request' => UnableToProcessPostRequest, 'unable_to_share_files' => UnableToShareFiles, 'unable_to_unlink_idp_group_and_channel' => UnableToUnlinkIdpGroupAndChannel, @@ -1703,6 +1720,7 @@ class WorkspaceNotEligible < SlackError; end 'validation_errors' => ValidationErrors, 'view_too_large' => ViewTooLarge, 'visibility_is_not_named_entities' => VisibilityIsNotNamedEntities, + 'visible_group_needs_handle' => VisibleGroupNeedsHandle, 'workflows_export_csv_not_enabled' => WorkflowsExportCsvNotEnabled, 'workspace_not_eligible' => WorkspaceNotEligible, }.freeze diff --git a/lib/slack/web/api/slack-api-ref b/lib/slack/web/api/slack-api-ref index 85988b63..0ae4e986 160000 --- a/lib/slack/web/api/slack-api-ref +++ b/lib/slack/web/api/slack-api-ref @@ -1 +1 @@ -Subproject commit 85988b63f250a1d04169a66b9ddf479a4ddbd65a +Subproject commit 0ae4e986fbdb824fd4af8ca175ca45142377c8c3 diff --git a/spec/slack/web/api/endpoints/admin_usergroups_spec.rb b/spec/slack/web/api/endpoints/admin_usergroups_spec.rb index 39e7d2f8..bee8d4db 100644 --- a/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +++ b/spec/slack/web/api/endpoints/admin_usergroups_spec.rb @@ -21,6 +21,28 @@ expect { client.admin_usergroups_addTeams(usergroup_id: %q[S12345678]) }.to raise_error ArgumentError, /Required arguments :team_ids missing/ end end + context 'admin.usergroups_addUsers' do + it 'requires id' do + expect { client.admin_usergroups_addUsers(users: %q[U060R4BJ4,U060RNRCZ]) }.to raise_error ArgumentError, /Required arguments :id missing/ + end + it 'requires users' do + expect { client.admin_usergroups_addUsers(id: %q[S0604QSJC]) }.to raise_error ArgumentError, /Required arguments :users missing/ + end + it 'encodes users as json' do + expect(client).to receive(:post).with('admin.usergroups.addUsers', {id: %q[S0604QSJC], users: %q[{"data":["data"]}]}) + client.admin_usergroups_addUsers(id: %q[S0604QSJC], users: {data: ["data"]}) + end + end + context 'admin.usergroups_create' do + it 'requires name' do + expect { client.admin_usergroups_create }.to raise_error ArgumentError, /Required arguments :name missing/ + end + end + context 'admin.usergroups_fetch' do + it 'requires id' do + expect { client.admin_usergroups_fetch }.to raise_error ArgumentError, /Required arguments :id missing/ + end + end context 'admin.usergroups_listChannels' do it 'requires usergroup_id' do expect { client.admin_usergroups_listChannels }.to raise_error ArgumentError, /Required arguments :usergroup_id missing/ @@ -42,4 +64,26 @@ expect { client.admin_usergroups_removeTeams(usergroup_id: %q[S12345678]) }.to raise_error ArgumentError, /Required arguments :team_ids missing/ end end + context 'admin.usergroups_removeUsers' do + it 'requires id' do + expect { client.admin_usergroups_removeUsers(users: %q[U060R4BJ4,U060RNRCZ]) }.to raise_error ArgumentError, /Required arguments :id missing/ + end + it 'requires users' do + expect { client.admin_usergroups_removeUsers(id: %q[S0604QSJC]) }.to raise_error ArgumentError, /Required arguments :users missing/ + end + it 'encodes users as json' do + expect(client).to receive(:post).with('admin.usergroups.removeUsers', {id: %q[S0604QSJC], users: %q[{"data":["data"]}]}) + client.admin_usergroups_removeUsers(id: %q[S0604QSJC], users: {data: ["data"]}) + end + end + context 'admin.usergroups_update' do + it 'requires id' do + expect { client.admin_usergroups_update }.to raise_error ArgumentError, /Required arguments :id missing/ + end + end + context 'admin.usergroups_uploadUsers' do + it 'requires id' do + expect { client.admin_usergroups_uploadUsers }.to raise_error ArgumentError, /Required arguments :id missing/ + end + end end diff --git a/spec/slack/web/api/endpoints/canvases_spec.rb b/spec/slack/web/api/endpoints/canvases_spec.rb index 636239dd..c7c57cbb 100644 --- a/spec/slack/web/api/endpoints/canvases_spec.rb +++ b/spec/slack/web/api/endpoints/canvases_spec.rb @@ -18,4 +18,9 @@ expect { client.canvases_edit(canvas_id: %q[F1234ABCD]) }.to raise_error ArgumentError, /Required arguments :changes missing/ end end + context 'canvases_getContent' do + it 'requires canvas_id' do + expect { client.canvases_getContent }.to raise_error ArgumentError, /Required arguments :canvas_id missing/ + end + end end diff --git a/spec/slack/web/api/endpoints/slackLists_items_spec.rb b/spec/slack/web/api/endpoints/slackLists_items_spec.rb index ac81052a..71fc2a86 100644 --- a/spec/slack/web/api/endpoints/slackLists_items_spec.rb +++ b/spec/slack/web/api/endpoints/slackLists_items_spec.rb @@ -44,7 +44,7 @@ expect { client.slackLists_items_update(cells: %q[[{"row_id":"Rec014K005UQJ","column_id":"Col014K005UQJ","user":["U01284PCR98", "U0137181B5H"]}]]) }.to raise_error ArgumentError, /Required arguments :list_id missing/ end it 'requires cells' do - expect { client.slackLists_items_update(list_id: %q[F01ABCDE2FG]) }.to raise_error ArgumentError, /Required arguments :cells missing/ + expect { client.slackLists_items_update(list_id: %q[F0123ABC456]) }.to raise_error ArgumentError, /Required arguments :cells missing/ end end end