slack-ruby-client 0.11.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.coveralls.yml +2 -0
- data/.github/FUNDING.yml +2 -0
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/integration_test.yml +45 -0
- data/.github/workflows/lint.yml +14 -0
- data/.github/workflows/pr_lint.yml +21 -0
- data/.github/workflows/test.yml +56 -0
- data/.github/workflows/update_api.yml +81 -0
- data/.gitignore +7 -3
- data/.rubocop.yml +40 -2
- data/.rubocop_todo.yml +209 -55
- data/.ruby-version +1 -0
- data/CHANGELOG.md +257 -30
- data/CONTRIBUTING.md +44 -29
- data/Dangerfile +2 -0
- data/Gemfile +28 -6
- data/Gemfile.danger +6 -0
- data/LICENSE.md +1 -1
- data/README.md +473 -134
- data/RELEASING.md +2 -2
- data/Rakefile +2 -1
- data/SECURITY.md +9 -0
- data/UPGRADING.md +117 -3
- data/bin/commands/admin_analytics.rb +22 -0
- data/bin/commands/admin_apps.rb +57 -0
- data/bin/commands/admin_apps_activities.rb +32 -0
- data/bin/commands/admin_apps_approved.rb +24 -0
- data/bin/commands/admin_apps_config.rb +31 -0
- data/bin/commands/admin_apps_requests.rb +35 -0
- data/bin/commands/admin_apps_restricted.rb +24 -0
- data/bin/commands/admin_audit_anomaly_allow.rb +29 -0
- data/bin/commands/admin_auth_policy.rb +45 -0
- data/bin/commands/admin_barriers.rb +53 -0
- data/bin/commands/admin_conversations.rb +260 -0
- data/bin/commands/admin_conversations_ekm.rb +23 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +43 -0
- data/bin/commands/admin_emoji.rb +60 -0
- data/bin/commands/admin_functions.rb +23 -0
- data/bin/commands/admin_functions_permissions.rb +31 -0
- data/bin/commands/admin_inviteRequests.rb +42 -0
- data/bin/commands/admin_inviteRequests_approved.rb +22 -0
- data/bin/commands/admin_inviteRequests_denied.rb +22 -0
- data/bin/commands/admin_roles.rb +46 -0
- data/bin/commands/admin_teams.rb +33 -0
- data/bin/commands/admin_teams_admins.rb +22 -0
- data/bin/commands/admin_teams_owners.rb +22 -0
- data/bin/commands/admin_teams_settings.rb +70 -0
- data/bin/commands/admin_usergroups.rb +54 -0
- data/bin/commands/admin_users.rb +106 -0
- data/bin/commands/admin_users_session.rb +84 -0
- data/bin/commands/admin_users_unsupportedVersions.rb +21 -0
- data/bin/commands/admin_workflows.rb +42 -0
- data/bin/commands/admin_workflows_collaborators.rb +31 -0
- data/bin/commands/admin_workflows_permissions.rb +21 -0
- data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
- data/bin/commands/api.rb +15 -9
- data/bin/commands/apps.rb +21 -0
- data/bin/commands/apps_activities.rb +32 -0
- data/bin/commands/apps_auth_external.rb +32 -0
- data/bin/commands/apps_connections.rb +19 -0
- data/bin/commands/apps_datastore.rb +116 -0
- data/bin/commands/apps_event_authorizations.rb +22 -0
- data/bin/commands/apps_manifest.rb +58 -0
- data/bin/commands/assistant_search.rb +27 -0
- data/bin/commands/assistant_threads.rb +45 -0
- data/bin/commands/auth.rb +22 -15
- data/bin/commands/auth_teams.rb +22 -0
- data/bin/commands/bookmarks.rb +60 -0
- data/bin/commands/bots.rb +16 -8
- data/bin/commands/calls.rb +58 -0
- data/bin/commands/calls_participants.rb +31 -0
- data/bin/commands/canvases.rb +41 -0
- data/bin/commands/canvases_access.rb +34 -0
- data/bin/commands/canvases_sections.rb +21 -0
- data/bin/commands/chat.rb +158 -99
- data/bin/commands/chat_scheduledMessages.rb +25 -0
- data/bin/commands/conversations.rb +241 -157
- data/bin/commands/conversations_canvases.rb +22 -0
- data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
- data/bin/commands/conversations_requestSharedInvite.rb +48 -0
- data/bin/commands/dialog.rb +16 -9
- data/bin/commands/dnd.rb +47 -38
- data/bin/commands/emoji.rb +15 -7
- data/bin/commands/files.rb +113 -87
- data/bin/commands/files_comments.rb +16 -30
- data/bin/commands/files_remote.rb +84 -0
- data/bin/commands/functions.rb +31 -0
- data/bin/commands/functions_distributions_permissions.rb +61 -0
- data/bin/commands/functions_workflows_steps.rb +23 -0
- data/bin/commands/functions_workflows_steps_responses.rb +23 -0
- data/bin/commands/migration.rb +17 -9
- data/bin/commands/oauth.rb +19 -24
- data/bin/commands/oauth_v2.rb +35 -0
- data/bin/commands/openid_connect.rb +33 -0
- data/bin/commands/pins.rb +33 -30
- data/bin/commands/reactions.rb +53 -45
- data/bin/commands/reminders.rb +54 -41
- data/bin/commands/rtm.rb +16 -22
- data/bin/commands/search.rb +44 -33
- data/bin/commands/stars.rb +39 -29
- data/bin/commands/team.rb +50 -34
- data/bin/commands/team_billing.rb +19 -0
- data/bin/commands/team_externalTeams.rb +35 -0
- data/bin/commands/team_preferences.rb +19 -0
- data/bin/commands/team_profile.rb +15 -8
- data/bin/commands/tooling_tokens.rb +20 -0
- data/bin/commands/usergroups.rb +69 -53
- data/bin/commands/usergroups_users.rb +30 -19
- data/bin/commands/users.rb +114 -84
- data/bin/commands/users_admin.rb +29 -22
- data/bin/commands/users_discoverableContacts.rb +20 -0
- data/bin/commands/users_prefs.rb +14 -7
- data/bin/commands/users_profile.rb +27 -20
- data/bin/commands/views.rb +56 -0
- data/bin/commands/workflows.rb +44 -0
- data/bin/commands/workflows_triggers_permissions.rb +60 -0
- data/bin/slack +50 -46
- data/examples/files_upload_v2/.env.example +1 -0
- data/examples/{hi_real_time → files_upload_v2}/Gemfile +2 -2
- data/examples/files_upload_v2/README.md +13 -0
- data/examples/files_upload_v2/files_upload_v2.rb +45 -0
- data/examples/hi_real_time_and_web/Gemfile +1 -0
- data/examples/hi_real_time_and_web/hi.rb +7 -3
- data/examples/{hi_real_time_async_eventmachine → hi_real_time_async_async}/Gemfile +2 -1
- data/examples/{hi_real_time_async_eventmachine → hi_real_time_async_async}/hi.rb +12 -7
- data/examples/hi_web/Gemfile +1 -0
- data/examples/hi_web/hi.rb +1 -0
- data/examples/new_ticket/Gemfile +1 -0
- data/examples/new_ticket/new_ticket.rb +1 -0
- data/examples/oauth_v2/.env.example +4 -0
- data/examples/oauth_v2/Gemfile +7 -0
- data/examples/oauth_v2/README.md +33 -0
- data/examples/oauth_v2/oauth_v2.rb +60 -0
- data/lib/slack/config.rb +2 -2
- data/lib/slack/events/config.rb +32 -0
- data/lib/slack/events/request.rb +76 -0
- data/lib/slack/logger.rb +6 -5
- data/lib/slack/messages/formatting.rb +66 -1
- data/lib/slack/messages/message.rb +1 -4
- data/lib/slack/real_time/api/message.rb +6 -3
- data/lib/slack/real_time/api/message_id.rb +1 -0
- data/lib/slack/real_time/api/ping.rb +5 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
- data/lib/slack/real_time/api/typing.rb +5 -2
- data/lib/slack/real_time/client.rb +117 -54
- data/lib/slack/real_time/concurrency/async.rb +142 -0
- data/lib/slack/real_time/concurrency.rb +2 -2
- data/lib/slack/real_time/config.rb +12 -13
- data/lib/slack/real_time/models/base.rb +1 -4
- data/lib/slack/real_time/models/bot.rb +1 -0
- data/lib/slack/real_time/models/channel.rb +5 -0
- data/lib/slack/real_time/models/im.rb +1 -0
- data/lib/slack/real_time/models/{group.rb → mpim.rb} +2 -1
- data/lib/slack/real_time/models/team.rb +1 -0
- data/lib/slack/real_time/models/user.rb +1 -0
- data/lib/slack/real_time/models.rb +3 -1
- data/lib/slack/real_time/socket.rb +49 -17
- data/lib/slack/real_time/stores/base.rb +28 -14
- data/lib/slack/real_time/stores/starter.rb +325 -287
- data/lib/slack/real_time/stores/store.rb +271 -186
- data/lib/slack/real_time/stores.rb +2 -7
- data/lib/slack/utils/security.rb +44 -0
- data/lib/slack/version.rb +2 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +78 -0
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +53 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +37 -0
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +40 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +53 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +37 -0
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +397 -0
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
- data/lib/slack/web/api/endpoints/admin_functions.rb +36 -0
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +167 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +121 -0
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
- data/lib/slack/web/api/endpoints/admin_workflows.rb +67 -0
- data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +42 -0
- data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +26 -0
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/api.rb +2 -3
- data/lib/slack/web/api/endpoints/apps.rb +27 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +54 -0
- data/lib/slack/web/api/endpoints/apps_auth_external.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_datastore.rb +181 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +79 -0
- data/lib/slack/web/api/endpoints/assistant_search.rb +44 -0
- data/lib/slack/web/api/endpoints/assistant_threads.rb +68 -0
- data/lib/slack/web/api/endpoints/auth.rb +2 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bookmarks.rb +90 -0
- data/lib/slack/web/api/endpoints/bots.rb +4 -1
- data/lib/slack/web/api/endpoints/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/canvases.rb +54 -0
- data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
- data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
- data/lib/slack/web/api/endpoints/chat.rb +172 -87
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +40 -0
- data/lib/slack/web/api/endpoints/conversations.rb +190 -64
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +28 -0
- data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
- data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +73 -0
- data/lib/slack/web/api/endpoints/dialog.rb +6 -10
- data/lib/slack/web/api/endpoints/dnd.rb +11 -5
- data/lib/slack/web/api/endpoints/emoji.rb +3 -0
- data/lib/slack/web/api/endpoints/files.rb +85 -36
- data/lib/slack/web/api/endpoints/files_comments.rb +4 -36
- data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
- data/lib/slack/web/api/endpoints/functions.rb +43 -0
- data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +84 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +30 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +30 -0
- data/lib/slack/web/api/endpoints/migration.rb +6 -3
- data/lib/slack/web/api/endpoints/oauth.rb +10 -32
- data/lib/slack/web/api/endpoints/oauth_v2.rb +48 -0
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +11 -18
- data/lib/slack/web/api/endpoints/reactions.rb +31 -20
- data/lib/slack/web/api/endpoints/reminders.rb +25 -12
- data/lib/slack/web/api/endpoints/rtm.rb +4 -22
- data/lib/slack/web/api/endpoints/search.rb +33 -18
- data/lib/slack/web/api/endpoints/stars.rb +23 -10
- data/lib/slack/web/api/endpoints/team.rb +38 -7
- data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
- data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +44 -25
- data/lib/slack/web/api/endpoints/usergroups_users.rb +23 -14
- data/lib/slack/web/api/endpoints/users.rb +57 -18
- data/lib/slack/web/api/endpoints/users_admin.rb +5 -2
- data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +24 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +2 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +11 -9
- data/lib/slack/web/api/endpoints/views.rb +86 -0
- data/lib/slack/web/api/endpoints/workflows.rb +63 -0
- data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
- data/lib/slack/web/api/endpoints.rb +136 -12
- data/lib/slack/web/api/error.rb +1 -0
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/slack_error.rb +14 -1
- data/lib/slack/web/api/errors/too_many_requests_error.rb +2 -4
- data/lib/slack/web/api/errors.rb +1396 -0
- data/lib/slack/web/api/helpers/files.rb +97 -0
- data/lib/slack/web/api/helpers.rb +13 -0
- data/lib/slack/web/api/mixins/conversations.id.rb +47 -0
- data/lib/slack/web/api/mixins/ids.id.rb +4 -3
- data/lib/slack/web/api/mixins/users.id.rb +18 -4
- data/lib/slack/web/api/mixins/users.search.rb +3 -1
- data/lib/slack/web/api/mixins.rb +2 -2
- data/lib/slack/web/api/options.rb +26 -0
- data/lib/slack/web/api/patches/.gitkeep +0 -0
- data/lib/slack/web/api/templates/command.erb +19 -12
- data/lib/slack/web/api/templates/endpoints.erb +2 -2
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/api/templates/method.erb +23 -3
- data/lib/slack/web/api/templates/method_spec.erb +40 -3
- data/lib/slack/web/client.rb +4 -1
- data/lib/slack/web/config.rb +9 -2
- data/lib/slack/web/faraday/connection.rb +11 -20
- data/lib/slack/web/faraday/options.rb +24 -0
- data/lib/slack/web/faraday/request.rb +6 -1
- data/lib/slack/web/faraday/response/raise_error.rb +14 -8
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +7 -7
- data/lib/slack-ruby-client.rb +18 -6
- data/lib/slack.rb +1 -0
- data/lib/slack_ruby_client.rb +1 -0
- data/lib/tasks/git.rake +1 -0
- data/lib/tasks/real_time.rake +51 -21
- data/lib/tasks/update.rake +1 -0
- data/lib/tasks/web.rake +43 -17
- data/slack-ruby-client.gemspec +10 -14
- metadata +191 -307
- data/.travis.yml +0 -30
- data/bin/commands/apps_permissions.rb +0 -22
- data/bin/commands/channels.rb +0 -175
- data/bin/commands/groups.rb +0 -172
- data/bin/commands/im.rb +0 -67
- data/bin/commands/mpim.rb +0 -63
- data/bin/commands.rb +0 -33
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -37
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -6
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -36
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -117
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -60
- data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -35
- data/lib/slack/web/api/endpoints/channels.rb +0 -265
- data/lib/slack/web/api/endpoints/groups.rb +0 -255
- data/lib/slack/web/api/endpoints/im.rb +0 -113
- data/lib/slack/web/api/endpoints/mpim.rb +0 -98
- data/lib/slack/web/api/endpoints/presence.rb +0 -23
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/channels.id.rb +0 -26
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -26
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +0 -17
- data/lib/slack/web/api/templates/commands.erb +0 -5
- data/screenshots/register-bot.png +0 -0
- data/spec/fixtures/slack/web/429_error.yml +0 -85
- data/spec/fixtures/slack/web/auth_test_error.yml +0 -48
- data/spec/fixtures/slack/web/auth_test_success.yml +0 -57
- data/spec/fixtures/slack/web/channels_info.yml +0 -46
- data/spec/fixtures/slack/web/groups_info.yml +0 -43
- data/spec/fixtures/slack/web/paginated_users_list.yml +0 -181
- data/spec/fixtures/slack/web/rtm_connect.yml +0 -70
- data/spec/fixtures/slack/web/rtm_start.yml +0 -104
- data/spec/fixtures/slack/web/users_info.yml +0 -130
- data/spec/fixtures/slack/web/users_list.yml +0 -72
- data/spec/integration/integration_spec.rb +0 -139
- data/spec/slack/config_spec.rb +0 -14
- data/spec/slack/messages/formatting_spec.rb +0 -43
- data/spec/slack/real_time/api/message_spec.rb +0 -15
- data/spec/slack/real_time/api/ping_spec.rb +0 -15
- data/spec/slack/real_time/api/typing_spec.rb +0 -15
- data/spec/slack/real_time/client_spec.rb +0 -425
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -62
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -47
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +0 -19
- data/spec/slack/real_time/event_handlers/bot_spec.rb +0 -44
- data/spec/slack/real_time/event_handlers/channel_spec.rb +0 -116
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +0 -15
- data/spec/slack/real_time/event_handlers/group_spec.rb +0 -90
- data/spec/slack/real_time/event_handlers/im_spec.rb +0 -47
- data/spec/slack/real_time/event_handlers/team_spec.rb +0 -62
- data/spec/slack/real_time/event_handlers/user_spec.rb +0 -63
- data/spec/slack/real_time/rtm_connect_spec.rb +0 -13
- data/spec/slack/real_time/rtm_start_spec.rb +0 -13
- data/spec/slack/real_time/store_spec.rb +0 -11
- data/spec/slack/slack_spec.rb +0 -58
- data/spec/slack/version_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/api_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -15
- data/spec/slack/web/api/endpoints/bots_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -100
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +0 -25
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -11
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +0 -105
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +0 -28
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -11
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +0 -33
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -12
- data/spec/slack/web/api/endpoints/emoji_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -34
- data/spec/slack/web/api/endpoints/files_spec.rb +0 -43
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -38
- data/spec/slack/web/api/endpoints/migration_spec.rb +0 -12
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -38
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -29
- data/spec/slack/web/api/endpoints/pins_spec.rb +0 -22
- data/spec/slack/web/api/endpoints/reactions_spec.rb +0 -17
- data/spec/slack/web/api/endpoints/reminders_spec.rb +0 -30
- data/spec/slack/web/api/endpoints/rtm_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/search_spec.rb +0 -22
- data/spec/slack/web/api/endpoints/stars_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/team_profile_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/team_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/usergroups_spec.rb +0 -27
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +0 -20
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +0 -17
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +0 -7
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +0 -7
- data/spec/slack/web/api/error_spec.rb +0 -14
- data/spec/slack/web/api/errors/slack_error_spec.rb +0 -14
- data/spec/slack/web/api/mixins/channels_spec.rb +0 -31
- data/spec/slack/web/api/mixins/groups_spec.rb +0 -31
- data/spec/slack/web/api/mixins/users_spec.rb +0 -39
- data/spec/slack/web/api/pagination/cursor_spec.rb +0 -70
- data/spec/slack/web/client_spec.rb +0 -174
- data/spec/spec_helper.rb +0 -14
- data/spec/support/queue_with_timeout.rb +0 -34
- data/spec/support/real_time/concurrency/mock.rb +0 -30
- data/spec/support/real_time/connected_client.rb +0 -21
- data/spec/support/real_time/event.rb +0 -11
- data/spec/support/token.rb +0 -10
- data/spec/support/vcr.rb +0 -9
- /data/examples/{hi_real_time_async_celluloid → hi_real_time_async_async}/Procfile +0 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -6,47 +7,59 @@ module Slack
|
|
6
7
|
module Endpoints
|
7
8
|
module Stars
|
8
9
|
#
|
9
|
-
#
|
10
|
+
# Save an item for later. Formerly known as adding a star.
|
10
11
|
#
|
11
12
|
# @option options [channel] :channel
|
12
13
|
# Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
|
13
14
|
# @option options [file] :file
|
14
15
|
# File to add star to.
|
15
|
-
# @option options [
|
16
|
+
# @option options [string] :file_comment
|
16
17
|
# File comment to add star to.
|
17
|
-
# @option options [
|
18
|
+
# @option options [string] :timestamp
|
18
19
|
# Timestamp of the message to add star to.
|
19
20
|
# @see https://api.slack.com/methods/stars.add
|
20
21
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.add.json
|
21
22
|
def stars_add(options = {})
|
22
|
-
options = options.merge(channel:
|
23
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
23
24
|
post('stars.add', options)
|
24
25
|
end
|
25
26
|
|
26
27
|
#
|
27
|
-
#
|
28
|
+
# Listed a user's saved items, formerly known as stars.
|
28
29
|
#
|
30
|
+
# @option options [string] :cursor
|
31
|
+
# 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.
|
32
|
+
# @option options [integer] :limit
|
33
|
+
# 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.
|
34
|
+
# @option options [string] :team_id
|
35
|
+
# encoded team id to list stars in, required if org token is used.
|
29
36
|
# @see https://api.slack.com/methods/stars.list
|
30
37
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.list.json
|
31
38
|
def stars_list(options = {})
|
32
|
-
|
39
|
+
if block_given?
|
40
|
+
Pagination::Cursor.new(self, :stars_list, options).each do |page|
|
41
|
+
yield page
|
42
|
+
end
|
43
|
+
else
|
44
|
+
post('stars.list', options)
|
45
|
+
end
|
33
46
|
end
|
34
47
|
|
35
48
|
#
|
36
|
-
# Removes a star from an item.
|
49
|
+
# Removes a saved item (star) from an item.
|
37
50
|
#
|
38
51
|
# @option options [channel] :channel
|
39
52
|
# Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).
|
40
53
|
# @option options [file] :file
|
41
54
|
# File to remove star from.
|
42
|
-
# @option options [
|
55
|
+
# @option options [string] :file_comment
|
43
56
|
# File comment to remove star from.
|
44
|
-
# @option options [
|
57
|
+
# @option options [string] :timestamp
|
45
58
|
# Timestamp of the message to remove star from.
|
46
59
|
# @see https://api.slack.com/methods/stars.remove
|
47
60
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.remove.json
|
48
61
|
def stars_remove(options = {})
|
49
|
-
options = options.merge(channel:
|
62
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
50
63
|
post('stars.remove', options)
|
51
64
|
end
|
52
65
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -8,29 +9,57 @@ module Slack
|
|
8
9
|
#
|
9
10
|
# Gets the access logs for the current team.
|
10
11
|
#
|
11
|
-
# @option options [
|
12
|
+
# @option options [string] :before
|
12
13
|
# End of time range of logs to include in results (inclusive).
|
14
|
+
# @option options [string] :cursor
|
15
|
+
# 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.
|
16
|
+
# @option options [integer] :limit
|
17
|
+
# 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. If specified, result is returned using a cursor-based approach instead of a classic one.
|
18
|
+
# @option options [string] :team_id
|
19
|
+
# encoded team id to get logs from, required if org token is used.
|
13
20
|
# @see https://api.slack.com/methods/team.accessLogs
|
14
21
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
|
15
22
|
def team_accessLogs(options = {})
|
16
|
-
|
23
|
+
if block_given?
|
24
|
+
Pagination::Cursor.new(self, :team_accessLogs, options).each do |page|
|
25
|
+
yield page
|
26
|
+
end
|
27
|
+
else
|
28
|
+
post('team.accessLogs', options)
|
29
|
+
end
|
17
30
|
end
|
18
31
|
|
19
32
|
#
|
20
33
|
# Gets billable users information for the current team.
|
21
34
|
#
|
35
|
+
# @option options [string] :cursor
|
36
|
+
# Set cursor to next_cursor returned by previous call, to indicate from where you want to list next page of users list. Default value fetches the first page.
|
37
|
+
# @option options [integer] :limit
|
38
|
+
# The maximum number of items to return.
|
39
|
+
# @option options [string] :team_id
|
40
|
+
# encoded team id to get the billable information from, required if org token is used.
|
22
41
|
# @option options [user] :user
|
23
42
|
# A user to retrieve the billable information for. Defaults to all users.
|
24
43
|
# @see https://api.slack.com/methods/team.billableInfo
|
25
44
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.billableInfo.json
|
26
45
|
def team_billableInfo(options = {})
|
27
46
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
28
|
-
|
47
|
+
if block_given?
|
48
|
+
Pagination::Cursor.new(self, :team_billableInfo, options).each do |page|
|
49
|
+
yield page
|
50
|
+
end
|
51
|
+
else
|
52
|
+
post('team.billableInfo', options)
|
53
|
+
end
|
29
54
|
end
|
30
55
|
|
31
56
|
#
|
32
57
|
# Gets information about the current team.
|
33
58
|
#
|
59
|
+
# @option options [string] :domain
|
60
|
+
# Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself. This is the value set up for the 'Joining This Workspace' workspace setting. If it contains more than one domain, the field will contain multiple comma-separated domain values. If no domain is set, the field is empty.
|
61
|
+
# @option options [string] :team
|
62
|
+
# Team to get info about; if omitted, will return information about the current team.
|
34
63
|
# @see https://api.slack.com/methods/team.info
|
35
64
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
|
36
65
|
def team_info(options = {})
|
@@ -40,12 +69,14 @@ module Slack
|
|
40
69
|
#
|
41
70
|
# Gets the integration logs for the current team.
|
42
71
|
#
|
43
|
-
# @option options [
|
72
|
+
# @option options [string] :app_id
|
44
73
|
# Filter logs to this Slack app. Defaults to all logs.
|
45
|
-
# @option options [
|
46
|
-
# Filter logs with this change type. Defaults to all logs.
|
47
|
-
# @option options [
|
74
|
+
# @option options [enum] :change_type
|
75
|
+
# Filter logs with this change type. Possible values are added, removed, enabled, disabled, and updated. Defaults to all logs.
|
76
|
+
# @option options [string] :service_id
|
48
77
|
# Filter logs to this service. Defaults to all logs.
|
78
|
+
# @option options [string] :team_id
|
79
|
+
# encoded team id to get logs from, required if org token is used.
|
49
80
|
# @option options [user] :user
|
50
81
|
# Filter logs generated by this user's actions. Defaults to all logs.
|
51
82
|
# @see https://api.slack.com/methods/team.integrationLogs
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module TeamBilling
|
9
|
+
#
|
10
|
+
# Reads a workspace's billing plan information.
|
11
|
+
#
|
12
|
+
# @see https://api.slack.com/methods/team.billing.info
|
13
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.billing/team.billing.info.json
|
14
|
+
def team_billing_info(options = {})
|
15
|
+
post('team.billing.info', options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module TeamExternalteams
|
9
|
+
#
|
10
|
+
# Disconnect an external organization.
|
11
|
+
#
|
12
|
+
# @option options [Object] :target_team
|
13
|
+
# The team ID of the target team.
|
14
|
+
# @see https://api.slack.com/methods/team.externalTeams.disconnect
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.externalTeams/team.externalTeams.disconnect.json
|
16
|
+
def team_externalTeams_disconnect(options = {})
|
17
|
+
raise ArgumentError, 'Required arguments :target_team missing' if options[:target_team].nil?
|
18
|
+
post('team.externalTeams.disconnect', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Returns a list of all the external teams connected and details about the connection.
|
23
|
+
#
|
24
|
+
# @option options [enum] :connection_status_filter
|
25
|
+
# Status of the connected team.
|
26
|
+
# @option options [string] :cursor
|
27
|
+
# Paginate through collections of data by setting parameter to the team_id attribute returned by a previous request's response_metadata. If not provided, the first page of the collection is returned. See pagination for more detail.
|
28
|
+
# @option options [integer] :limit
|
29
|
+
# The maximum number of items to return per page.
|
30
|
+
# @option options [array] :slack_connect_pref_filter
|
31
|
+
# Filters connected orgs by Slack Connect pref override(s). Value can be: approved_orgs_only allow_sc_file_uploads profile_visibility away_team_sc_invite_permissions accept_sc_invites sc_mpdm_to_private require_sc_channel_for_sc_dm external_awareness_context_bar.
|
32
|
+
# @option options [enum] :sort_direction
|
33
|
+
# Direction to sort in asc or desc.
|
34
|
+
# @option options [enum] :sort_field
|
35
|
+
# Name of the parameter that we are sorting by.
|
36
|
+
# @option options [array] :workspace_filter
|
37
|
+
# Shows connected orgs which are connected on a specified encoded workspace ID.
|
38
|
+
# @see https://api.slack.com/methods/team.externalTeams.list
|
39
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.externalTeams/team.externalTeams.list.json
|
40
|
+
def team_externalTeams_list(options = {})
|
41
|
+
if block_given?
|
42
|
+
Pagination::Cursor.new(self, :team_externalTeams_list, options).each do |page|
|
43
|
+
yield page
|
44
|
+
end
|
45
|
+
else
|
46
|
+
post('team.externalTeams.list', options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module TeamPreferences
|
9
|
+
#
|
10
|
+
# Retrieve a list of a workspace's team preferences.
|
11
|
+
#
|
12
|
+
# @see https://api.slack.com/methods/team.preferences.list
|
13
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.preferences/team.preferences.list.json
|
14
|
+
def team_preferences_list(options = {})
|
15
|
+
post('team.preferences.list', options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -8,7 +9,7 @@ module Slack
|
|
8
9
|
#
|
9
10
|
# Retrieve a team's profile.
|
10
11
|
#
|
11
|
-
# @option options [
|
12
|
+
# @option options [enum] :visibility
|
12
13
|
# Filter by visibility.
|
13
14
|
# @see https://api.slack.com/methods/team.profile.get
|
14
15
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.profile/team.profile.get.json
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module ToolingTokens
|
9
|
+
#
|
10
|
+
# Exchanges a refresh token for a new app configuration token.
|
11
|
+
#
|
12
|
+
# @option options [string] :refresh_token
|
13
|
+
# The xoxe refresh token that was issued along with the old app configuration token.
|
14
|
+
# @see https://api.slack.com/methods/tooling.tokens.rotate
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/tooling.tokens/tooling.tokens.rotate.json
|
16
|
+
def tooling_tokens_rotate(options = {})
|
17
|
+
raise ArgumentError, 'Required arguments :refresh_token missing' if options[:refresh_token].nil?
|
18
|
+
post('tooling.tokens.rotate', options)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -6,62 +7,74 @@ module Slack
|
|
6
7
|
module Endpoints
|
7
8
|
module Usergroups
|
8
9
|
#
|
9
|
-
# Create a User Group
|
10
|
+
# Create a User Group.
|
10
11
|
#
|
11
|
-
# @option options [
|
12
|
+
# @option options [string] :name
|
12
13
|
# A name for the User Group. Must be unique among User Groups.
|
13
|
-
# @option options [
|
14
|
+
# @option options [array] :additional_channels
|
15
|
+
# A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
|
16
|
+
# @option options [array] :channels
|
14
17
|
# A comma separated string of encoded channel IDs for which the User Group uses as a default.
|
15
|
-
# @option options [
|
18
|
+
# @option options [string] :description
|
16
19
|
# A short description of the User Group.
|
17
|
-
# @option options [
|
20
|
+
# @option options [boolean] :enable_section
|
21
|
+
# Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.
|
22
|
+
# @option options [string] :handle
|
18
23
|
# A mention handle. Must be unique among channels, users and User Groups.
|
19
|
-
# @option options [
|
24
|
+
# @option options [boolean] :include_count
|
20
25
|
# Include the number of users in each User Group.
|
26
|
+
# @option options [string] :team_id
|
27
|
+
# Encoded team id where the user group has to be created, required if org token is used.
|
21
28
|
# @see https://api.slack.com/methods/usergroups.create
|
22
29
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
|
23
30
|
def usergroups_create(options = {})
|
24
|
-
|
31
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
25
32
|
post('usergroups.create', options)
|
26
33
|
end
|
27
34
|
|
28
35
|
#
|
29
|
-
# Disable an existing User Group
|
36
|
+
# Disable an existing User Group.
|
30
37
|
#
|
31
38
|
# @option options [Object] :usergroup
|
32
39
|
# The encoded ID of the User Group to disable.
|
33
|
-
# @option options [
|
40
|
+
# @option options [boolean] :include_count
|
34
41
|
# Include the number of users in the User Group.
|
42
|
+
# @option options [Object] :team_id
|
43
|
+
# Encoded target team id where the user group is, required if org token is used.
|
35
44
|
# @see https://api.slack.com/methods/usergroups.disable
|
36
45
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json
|
37
46
|
def usergroups_disable(options = {})
|
38
|
-
|
47
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
39
48
|
post('usergroups.disable', options)
|
40
49
|
end
|
41
50
|
|
42
51
|
#
|
43
|
-
# Enable a User Group
|
52
|
+
# Enable a User Group.
|
44
53
|
#
|
45
|
-
# @option options [
|
54
|
+
# @option options [string] :usergroup
|
46
55
|
# The encoded ID of the User Group to enable.
|
47
|
-
# @option options [
|
56
|
+
# @option options [boolean] :include_count
|
48
57
|
# Include the number of users in the User Group.
|
58
|
+
# @option options [string] :team_id
|
59
|
+
# Encoded team id where the user group is, required if org token is used.
|
49
60
|
# @see https://api.slack.com/methods/usergroups.enable
|
50
61
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
|
51
62
|
def usergroups_enable(options = {})
|
52
|
-
|
63
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
53
64
|
post('usergroups.enable', options)
|
54
65
|
end
|
55
66
|
|
56
67
|
#
|
57
|
-
# List all User Groups for a team
|
68
|
+
# List all User Groups for a team.
|
58
69
|
#
|
59
|
-
# @option options [
|
70
|
+
# @option options [boolean] :include_count
|
60
71
|
# Include the number of users in each User Group.
|
61
|
-
# @option options [
|
72
|
+
# @option options [boolean] :include_disabled
|
62
73
|
# Include disabled User Groups.
|
63
|
-
# @option options [
|
74
|
+
# @option options [boolean] :include_users
|
64
75
|
# Include the list of users for each User Group.
|
76
|
+
# @option options [string] :team_id
|
77
|
+
# encoded team id to list user groups in, required if org token is used.
|
65
78
|
# @see https://api.slack.com/methods/usergroups.list
|
66
79
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
|
67
80
|
def usergroups_list(options = {})
|
@@ -69,24 +82,30 @@ module Slack
|
|
69
82
|
end
|
70
83
|
|
71
84
|
#
|
72
|
-
# Update an existing User Group
|
85
|
+
# Update an existing User Group.
|
73
86
|
#
|
74
87
|
# @option options [Object] :usergroup
|
75
88
|
# The encoded ID of the User Group to update.
|
76
|
-
# @option options [
|
89
|
+
# @option options [array] :additional_channels
|
90
|
+
# A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
|
91
|
+
# @option options [array] :channels
|
77
92
|
# A comma separated string of encoded channel IDs for which the User Group uses as a default.
|
78
|
-
# @option options [
|
93
|
+
# @option options [string] :description
|
79
94
|
# A short description of the User Group.
|
80
|
-
# @option options [
|
95
|
+
# @option options [boolean] :enable_section
|
96
|
+
# Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.
|
97
|
+
# @option options [string] :handle
|
81
98
|
# A mention handle. Must be unique among channels, users and User Groups.
|
82
|
-
# @option options [
|
99
|
+
# @option options [boolean] :include_count
|
83
100
|
# Include the number of users in the User Group.
|
84
|
-
# @option options [
|
101
|
+
# @option options [string] :name
|
85
102
|
# A name for the User Group. Must be unique among User Groups.
|
103
|
+
# @option options [Object] :team_id
|
104
|
+
# encoded team id where the user group exists, required if org token is used.
|
86
105
|
# @see https://api.slack.com/methods/usergroups.update
|
87
106
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json
|
88
107
|
def usergroups_update(options = {})
|
89
|
-
|
108
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
90
109
|
post('usergroups.update', options)
|
91
110
|
end
|
92
111
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -6,33 +7,41 @@ module Slack
|
|
6
7
|
module Endpoints
|
7
8
|
module UsergroupsUsers
|
8
9
|
#
|
9
|
-
# List all users in a User Group
|
10
|
+
# List all users in a User Group.
|
10
11
|
#
|
11
|
-
# @option options [
|
12
|
-
# The encoded ID of the User Group to
|
13
|
-
# @option options [
|
12
|
+
# @option options [string] :usergroup
|
13
|
+
# The encoded ID of the User Group to list users for.
|
14
|
+
# @option options [boolean] :include_disabled
|
14
15
|
# Allow results that involve disabled User Groups.
|
16
|
+
# @option options [string] :team_id
|
17
|
+
# encoded team id where the user group exists, required if org token is used.
|
15
18
|
# @see https://api.slack.com/methods/usergroups.users.list
|
16
19
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json
|
17
20
|
def usergroups_users_list(options = {})
|
18
|
-
|
21
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
19
22
|
post('usergroups.users.list', options)
|
20
23
|
end
|
21
24
|
|
22
25
|
#
|
23
|
-
# Update the list of users for a
|
26
|
+
# Update the list of users for a user group.
|
24
27
|
#
|
25
|
-
# @option options [
|
26
|
-
# The encoded ID of the
|
27
|
-
# @option options [
|
28
|
-
# A comma separated string of encoded user IDs that represent the entire list of users for the
|
29
|
-
# @option options [
|
30
|
-
#
|
28
|
+
# @option options [string] :usergroup
|
29
|
+
# The encoded ID of the user group to update.
|
30
|
+
# @option options [array] :users
|
31
|
+
# A comma separated string of encoded user IDs that represent the entire list of users for the user group.
|
32
|
+
# @option options [array] :additional_channels
|
33
|
+
# A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
|
34
|
+
# @option options [boolean] :include_count
|
35
|
+
# Include the number of users in the user group.
|
36
|
+
# @option options [boolean] :is_shared
|
37
|
+
# Boolean to identify if the API is getting called when a shared section is getting shared.
|
38
|
+
# @option options [string] :team_id
|
39
|
+
# encoded team id where the user group exists, required if org token is used.
|
31
40
|
# @see https://api.slack.com/methods/usergroups.users.update
|
32
41
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json
|
33
42
|
def usergroups_users_update(options = {})
|
34
|
-
|
35
|
-
|
43
|
+
raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
|
44
|
+
raise ArgumentError, 'Required arguments :users missing' if options[:users].nil?
|
36
45
|
post('usergroups.users.update', options)
|
37
46
|
end
|
38
47
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
2
3
|
|
3
4
|
module Slack
|
@@ -5,6 +6,34 @@ module Slack
|
|
5
6
|
module Api
|
6
7
|
module Endpoints
|
7
8
|
module Users
|
9
|
+
#
|
10
|
+
# List conversations the calling user may access.
|
11
|
+
#
|
12
|
+
# @option options [string] :cursor
|
13
|
+
# 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.
|
14
|
+
# @option options [boolean] :exclude_archived
|
15
|
+
# Set to true to exclude archived channels from the list.
|
16
|
+
# @option options [number] :limit
|
17
|
+
# 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 with a max value of 999.
|
18
|
+
# @option options [string] :team_id
|
19
|
+
# encoded team id to list conversations in, required if org token is used.
|
20
|
+
# @option options [string] :types
|
21
|
+
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
|
22
|
+
# @option options [user] :user
|
23
|
+
# Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership.
|
24
|
+
# @see https://api.slack.com/methods/users.conversations
|
25
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.conversations.json
|
26
|
+
def users_conversations(options = {})
|
27
|
+
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
28
|
+
if block_given?
|
29
|
+
Pagination::Cursor.new(self, :users_conversations, options).each do |page|
|
30
|
+
yield page
|
31
|
+
end
|
32
|
+
else
|
33
|
+
post('users.conversations', options)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
8
37
|
#
|
9
38
|
# Delete the user profile photo
|
10
39
|
#
|
@@ -22,7 +51,6 @@ module Slack
|
|
22
51
|
# @see https://api.slack.com/methods/users.getPresence
|
23
52
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.getPresence.json
|
24
53
|
def users_getPresence(options = {})
|
25
|
-
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
26
54
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
27
55
|
post('users.getPresence', options)
|
28
56
|
end
|
@@ -41,12 +69,12 @@ module Slack
|
|
41
69
|
#
|
42
70
|
# @option options [user] :user
|
43
71
|
# User to get info on.
|
44
|
-
# @option options [
|
72
|
+
# @option options [boolean] :include_locale
|
45
73
|
# Set this to true to receive the locale for this user. Defaults to false.
|
46
74
|
# @see https://api.slack.com/methods/users.info
|
47
75
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.info.json
|
48
76
|
def users_info(options = {})
|
49
|
-
|
77
|
+
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
|
50
78
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
51
79
|
post('users.info', options)
|
52
80
|
end
|
@@ -54,14 +82,14 @@ module Slack
|
|
54
82
|
#
|
55
83
|
# Lists all users in a Slack team.
|
56
84
|
#
|
57
|
-
# @option options [
|
85
|
+
# @option options [string] :cursor
|
58
86
|
# 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.
|
59
|
-
# @option options [
|
87
|
+
# @option options [boolean] :include_locale
|
60
88
|
# Set this to true to receive the locale for users. Defaults to false.
|
61
|
-
# @option options [
|
62
|
-
# 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.
|
63
|
-
# @option options [
|
64
|
-
#
|
89
|
+
# @option options [number] :limit
|
90
|
+
# 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.
|
91
|
+
# @option options [string] :team_id
|
92
|
+
# encoded team id to list users in, required if org token is used.
|
65
93
|
# @see https://api.slack.com/methods/users.list
|
66
94
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.list.json
|
67
95
|
def users_list(options = {})
|
@@ -75,7 +103,19 @@ module Slack
|
|
75
103
|
end
|
76
104
|
|
77
105
|
#
|
78
|
-
#
|
106
|
+
# Find a user with an email address.
|
107
|
+
#
|
108
|
+
# @option options [string] :email
|
109
|
+
# An email address belonging to a user in the workspace.
|
110
|
+
# @see https://api.slack.com/methods/users.lookupByEmail
|
111
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.lookupByEmail.json
|
112
|
+
def users_lookupByEmail(options = {})
|
113
|
+
raise ArgumentError, 'Required arguments :email missing' if options[:email].nil?
|
114
|
+
post('users.lookupByEmail', options)
|
115
|
+
end
|
116
|
+
|
117
|
+
#
|
118
|
+
# Marked a user as active. Deprecated and non-functional.
|
79
119
|
#
|
80
120
|
# @see https://api.slack.com/methods/users.setActive
|
81
121
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setActive.json
|
@@ -86,30 +126,29 @@ module Slack
|
|
86
126
|
#
|
87
127
|
# Set the user profile photo
|
88
128
|
#
|
89
|
-
# @option options [
|
90
|
-
# File contents via multipart/form-data.
|
91
|
-
# @option options [Object] :crop_w
|
129
|
+
# @option options [string] :crop_w
|
92
130
|
# Width/height of crop box (always square).
|
93
|
-
# @option options [
|
131
|
+
# @option options [string] :crop_x
|
94
132
|
# X coordinate of top-left corner of crop box.
|
95
|
-
# @option options [
|
133
|
+
# @option options [string] :crop_y
|
96
134
|
# Y coordinate of top-left corner of crop box.
|
135
|
+
# @option options [Object] :image
|
136
|
+
# File contents via multipart/form-data.
|
97
137
|
# @see https://api.slack.com/methods/users.setPhoto
|
98
138
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPhoto.json
|
99
139
|
def users_setPhoto(options = {})
|
100
|
-
throw ArgumentError.new('Required arguments :image missing') if options[:image].nil?
|
101
140
|
post('users.setPhoto', options)
|
102
141
|
end
|
103
142
|
|
104
143
|
#
|
105
144
|
# Manually sets user presence.
|
106
145
|
#
|
107
|
-
# @option options [
|
146
|
+
# @option options [enum] :presence
|
108
147
|
# Either auto or away.
|
109
148
|
# @see https://api.slack.com/methods/users.setPresence
|
110
149
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPresence.json
|
111
150
|
def users_setPresence(options = {})
|
112
|
-
|
151
|
+
raise ArgumentError, 'Required arguments :presence missing' if options[:presence].nil?
|
113
152
|
post('users.setPresence', options)
|
114
153
|
end
|
115
154
|
end
|