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
|
@@ -5,6 +6,42 @@ module Slack
|
|
5
6
|
module Api
|
6
7
|
module Endpoints
|
7
8
|
module Conversations
|
9
|
+
#
|
10
|
+
# Accepts an invitation to a Slack Connect channel.
|
11
|
+
#
|
12
|
+
# @option options [string] :channel_name
|
13
|
+
# Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.
|
14
|
+
# @option options [Object] :channel_id
|
15
|
+
# ID of the channel that you'd like to accept. Must provide either invite_id or channel_id.
|
16
|
+
# @option options [boolean] :free_trial_accepted
|
17
|
+
# Whether you'd like to use your workspace's free trial to begin using Slack Connect.
|
18
|
+
# @option options [Object] :invite_id
|
19
|
+
# ID of the invite that you'd like to accept. Must provide either invite_id or channel_id. See the shared_channel_invite_received event payload for more details on how to retrieve the ID of the invitation.
|
20
|
+
# @option options [boolean] :is_private
|
21
|
+
# Whether the channel should be private.
|
22
|
+
# @option options [Object] :team_id
|
23
|
+
# The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the team_id argument is required.
|
24
|
+
# @see https://api.slack.com/methods/conversations.acceptSharedInvite
|
25
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.acceptSharedInvite.json
|
26
|
+
def conversations_acceptSharedInvite(options = {})
|
27
|
+
raise ArgumentError, 'Required arguments :channel_name missing' if options[:channel_name].nil?
|
28
|
+
post('conversations.acceptSharedInvite', options)
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# Approves an invitation to a Slack Connect channel
|
33
|
+
#
|
34
|
+
# @option options [Object] :invite_id
|
35
|
+
# ID of the shared channel invite to approve.
|
36
|
+
# @option options [Object] :target_team
|
37
|
+
# The team or enterprise id of the other party involved in the invitation you are approving.
|
38
|
+
# @see https://api.slack.com/methods/conversations.approveSharedInvite
|
39
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.approveSharedInvite.json
|
40
|
+
def conversations_approveSharedInvite(options = {})
|
41
|
+
raise ArgumentError, 'Required arguments :invite_id missing' if options[:invite_id].nil?
|
42
|
+
post('conversations.approveSharedInvite', options)
|
43
|
+
end
|
44
|
+
|
8
45
|
#
|
9
46
|
# Archives a conversation.
|
10
47
|
#
|
@@ -13,8 +50,8 @@ module Slack
|
|
13
50
|
# @see https://api.slack.com/methods/conversations.archive
|
14
51
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
|
15
52
|
def conversations_archive(options = {})
|
16
|
-
|
17
|
-
options = options.merge(channel:
|
53
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
54
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
18
55
|
post('conversations.archive', options)
|
19
56
|
end
|
20
57
|
|
@@ -26,43 +63,63 @@ module Slack
|
|
26
63
|
# @see https://api.slack.com/methods/conversations.close
|
27
64
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
|
28
65
|
def conversations_close(options = {})
|
29
|
-
|
30
|
-
options = options.merge(channel:
|
66
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
67
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
31
68
|
post('conversations.close', options)
|
32
69
|
end
|
33
70
|
|
34
71
|
#
|
35
72
|
# Initiates a public or private channel-based conversation
|
36
73
|
#
|
37
|
-
# @option options [
|
74
|
+
# @option options [string] :name
|
38
75
|
# Name of the public or private channel to create.
|
39
|
-
# @option options [
|
76
|
+
# @option options [boolean] :is_private
|
40
77
|
# Create a private channel instead of a public one.
|
78
|
+
# @option options [string] :team_id
|
79
|
+
# encoded team id to create the channel in, required if org token is used.
|
41
80
|
# @see https://api.slack.com/methods/conversations.create
|
42
81
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
|
43
82
|
def conversations_create(options = {})
|
44
|
-
|
83
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
45
84
|
post('conversations.create', options)
|
46
85
|
end
|
47
86
|
|
87
|
+
#
|
88
|
+
# Declines a Slack Connect channel invite.
|
89
|
+
#
|
90
|
+
# @option options [Object] :invite_id
|
91
|
+
# ID of the Slack Connect invite to decline. Subscribe to the shared_channel_invite_accepted event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.
|
92
|
+
# @option options [Object] :target_team
|
93
|
+
# The team or enterprise id of the other party involved in the invitation you are declining.
|
94
|
+
# @see https://api.slack.com/methods/conversations.declineSharedInvite
|
95
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.declineSharedInvite.json
|
96
|
+
def conversations_declineSharedInvite(options = {})
|
97
|
+
raise ArgumentError, 'Required arguments :invite_id missing' if options[:invite_id].nil?
|
98
|
+
post('conversations.declineSharedInvite', options)
|
99
|
+
end
|
100
|
+
|
48
101
|
#
|
49
102
|
# Fetches a conversation's history of messages and events.
|
50
103
|
#
|
51
104
|
# @option options [channel] :channel
|
52
105
|
# Conversation ID to fetch history for.
|
53
|
-
# @option options [
|
106
|
+
# @option options [string] :cursor
|
54
107
|
# 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.
|
108
|
+
# @option options [boolean] :include_all_metadata
|
109
|
+
# Return all metadata associated with this message.
|
110
|
+
# @option options [boolean] :inclusive
|
111
|
+
# Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.
|
55
112
|
# @option options [timestamp] :latest
|
56
|
-
#
|
57
|
-
# @option options [
|
58
|
-
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the
|
113
|
+
# Only messages before this Unix timestamp will be included in results. Default is the current time.
|
114
|
+
# @option options [number] :limit
|
115
|
+
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the conversation history hasn't been reached. Maximum of 999.
|
59
116
|
# @option options [timestamp] :oldest
|
60
|
-
#
|
117
|
+
# Only messages after this Unix timestamp will be included in results.
|
61
118
|
# @see https://api.slack.com/methods/conversations.history
|
62
119
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
|
63
120
|
def conversations_history(options = {})
|
64
|
-
|
65
|
-
options = options.merge(channel:
|
121
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
122
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
66
123
|
if block_given?
|
67
124
|
Pagination::Cursor.new(self, :conversations_history, options).each do |page|
|
68
125
|
yield page
|
@@ -77,13 +134,15 @@ module Slack
|
|
77
134
|
#
|
78
135
|
# @option options [channel] :channel
|
79
136
|
# Conversation ID to learn more about.
|
80
|
-
# @option options [
|
137
|
+
# @option options [boolean] :include_locale
|
81
138
|
# Set this to true to receive the locale for this conversation. Defaults to false.
|
139
|
+
# @option options [boolean] :include_num_members
|
140
|
+
# Set to true to include the member count for the specified conversation. Defaults to false.
|
82
141
|
# @see https://api.slack.com/methods/conversations.info
|
83
142
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
|
84
143
|
def conversations_info(options = {})
|
85
|
-
|
86
|
-
options = options.merge(channel:
|
144
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
145
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
87
146
|
post('conversations.info', options)
|
88
147
|
end
|
89
148
|
|
@@ -92,17 +151,38 @@ module Slack
|
|
92
151
|
#
|
93
152
|
# @option options [channel] :channel
|
94
153
|
# The ID of the public or private channel to invite user(s) to.
|
95
|
-
# @option options [
|
96
|
-
# A comma separated list of user IDs. Up to
|
154
|
+
# @option options [string] :users
|
155
|
+
# A comma separated list of user IDs. Up to 1000 users may be listed.
|
156
|
+
# @option options [boolean] :force
|
157
|
+
# When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false.
|
97
158
|
# @see https://api.slack.com/methods/conversations.invite
|
98
159
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
|
99
160
|
def conversations_invite(options = {})
|
100
|
-
|
101
|
-
|
102
|
-
options = options.merge(channel:
|
161
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
162
|
+
raise ArgumentError, 'Required arguments :users missing' if options[:users].nil?
|
163
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
103
164
|
post('conversations.invite', options)
|
104
165
|
end
|
105
166
|
|
167
|
+
#
|
168
|
+
# Sends an invitation to a Slack Connect channel
|
169
|
+
#
|
170
|
+
# @option options [channel] :channel
|
171
|
+
# ID of the channel on your team that you'd like to share.
|
172
|
+
# @option options [array] :emails
|
173
|
+
# Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.
|
174
|
+
# @option options [boolean] :external_limited
|
175
|
+
# Optional boolean on whether invite is to an external limited member. Defaults to true.
|
176
|
+
# @option options [array] :user_ids
|
177
|
+
# Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.
|
178
|
+
# @see https://api.slack.com/methods/conversations.inviteShared
|
179
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.inviteShared.json
|
180
|
+
def conversations_inviteShared(options = {})
|
181
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
182
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
183
|
+
post('conversations.inviteShared', options)
|
184
|
+
end
|
185
|
+
|
106
186
|
#
|
107
187
|
# Joins an existing conversation.
|
108
188
|
#
|
@@ -111,8 +191,8 @@ module Slack
|
|
111
191
|
# @see https://api.slack.com/methods/conversations.join
|
112
192
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
|
113
193
|
def conversations_join(options = {})
|
114
|
-
|
115
|
-
options = options.merge(channel:
|
194
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
195
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
116
196
|
post('conversations.join', options)
|
117
197
|
end
|
118
198
|
|
@@ -126,9 +206,8 @@ module Slack
|
|
126
206
|
# @see https://api.slack.com/methods/conversations.kick
|
127
207
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.kick.json
|
128
208
|
def conversations_kick(options = {})
|
129
|
-
|
130
|
-
|
131
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
209
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
210
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
132
211
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
133
212
|
post('conversations.kick', options)
|
134
213
|
end
|
@@ -141,21 +220,23 @@ module Slack
|
|
141
220
|
# @see https://api.slack.com/methods/conversations.leave
|
142
221
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
|
143
222
|
def conversations_leave(options = {})
|
144
|
-
|
145
|
-
options = options.merge(channel:
|
223
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
224
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
146
225
|
post('conversations.leave', options)
|
147
226
|
end
|
148
227
|
|
149
228
|
#
|
150
229
|
# Lists all channels in a Slack team.
|
151
230
|
#
|
152
|
-
# @option options [
|
231
|
+
# @option options [string] :cursor
|
153
232
|
# 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.
|
154
|
-
# @option options [
|
233
|
+
# @option options [boolean] :exclude_archived
|
155
234
|
# Set to true to exclude archived channels from the list.
|
156
|
-
# @option options [
|
157
|
-
# 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
|
158
|
-
# @option options [
|
235
|
+
# @option options [number] :limit
|
236
|
+
# 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 under 1000.
|
237
|
+
# @option options [string] :team_id
|
238
|
+
# encoded team id to list channels in, required if token belongs to org-wide app.
|
239
|
+
# @option options [string] :types
|
159
240
|
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
|
160
241
|
# @see https://api.slack.com/methods/conversations.list
|
161
242
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.list.json
|
@@ -169,20 +250,55 @@ module Slack
|
|
169
250
|
end
|
170
251
|
end
|
171
252
|
|
253
|
+
#
|
254
|
+
# Lists shared channel invites that have been generated or received but have not been approved by all parties
|
255
|
+
#
|
256
|
+
# @option options [string] :cursor
|
257
|
+
# Set to next_cursor returned by previous call to list items in subsequent page.
|
258
|
+
# @option options [string] :team_id
|
259
|
+
# Encoded team id for the workspace to retrieve invites for, required if org token is used.
|
260
|
+
# @see https://api.slack.com/methods/conversations.listConnectInvites
|
261
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.listConnectInvites.json
|
262
|
+
def conversations_listConnectInvites(options = {})
|
263
|
+
if block_given?
|
264
|
+
Pagination::Cursor.new(self, :conversations_listConnectInvites, options).each do |page|
|
265
|
+
yield page
|
266
|
+
end
|
267
|
+
else
|
268
|
+
post('conversations.listConnectInvites', options)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# Sets the read cursor in a channel.
|
274
|
+
#
|
275
|
+
# @option options [channel] :channel
|
276
|
+
# Channel or conversation to set the read cursor for.
|
277
|
+
# @option options [timestamp] :ts
|
278
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
279
|
+
# @see https://api.slack.com/methods/conversations.mark
|
280
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.mark.json
|
281
|
+
def conversations_mark(options = {})
|
282
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
283
|
+
raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
|
284
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
285
|
+
post('conversations.mark', options)
|
286
|
+
end
|
287
|
+
|
172
288
|
#
|
173
289
|
# Retrieve members of a conversation.
|
174
290
|
#
|
175
291
|
# @option options [channel] :channel
|
176
292
|
# ID of the conversation to retrieve members for.
|
177
|
-
# @option options [
|
293
|
+
# @option options [string] :cursor
|
178
294
|
# 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.
|
179
|
-
# @option options [
|
295
|
+
# @option options [number] :limit
|
180
296
|
# 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.
|
181
297
|
# @see https://api.slack.com/methods/conversations.members
|
182
298
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
|
183
299
|
def conversations_members(options = {})
|
184
|
-
|
185
|
-
options = options.merge(channel:
|
300
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
301
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
186
302
|
if block_given?
|
187
303
|
Pagination::Cursor.new(self, :conversations_members, options).each do |page|
|
188
304
|
yield page
|
@@ -197,14 +313,16 @@ module Slack
|
|
197
313
|
#
|
198
314
|
# @option options [channel] :channel
|
199
315
|
# Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
|
200
|
-
# @option options [
|
316
|
+
# @option options [boolean] :prevent_creation
|
317
|
+
# Do not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.
|
318
|
+
# @option options [boolean] :return_im
|
201
319
|
# Boolean, indicates you want the full IM channel definition in the response.
|
202
|
-
# @option options [
|
320
|
+
# @option options [string] :users
|
203
321
|
# Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.
|
204
322
|
# @see https://api.slack.com/methods/conversations.open
|
205
323
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
|
206
324
|
def conversations_open(options = {})
|
207
|
-
options = options.merge(channel:
|
325
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
208
326
|
post('conversations.open', options)
|
209
327
|
end
|
210
328
|
|
@@ -213,14 +331,14 @@ module Slack
|
|
213
331
|
#
|
214
332
|
# @option options [channel] :channel
|
215
333
|
# ID of conversation to rename.
|
216
|
-
# @option options [
|
334
|
+
# @option options [string] :name
|
217
335
|
# New name for conversation.
|
218
336
|
# @see https://api.slack.com/methods/conversations.rename
|
219
337
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.rename.json
|
220
338
|
def conversations_rename(options = {})
|
221
|
-
|
222
|
-
|
223
|
-
options = options.merge(channel:
|
339
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
340
|
+
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
|
341
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
224
342
|
post('conversations.rename', options)
|
225
343
|
end
|
226
344
|
|
@@ -230,17 +348,25 @@ module Slack
|
|
230
348
|
# @option options [channel] :channel
|
231
349
|
# Conversation ID to fetch thread from.
|
232
350
|
# @option options [timestamp] :ts
|
233
|
-
# Unique identifier of a thread's parent message.
|
234
|
-
# @option options [
|
351
|
+
# Unique identifier of either a thread's parent message or a message in the thread. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message.
|
352
|
+
# @option options [string] :cursor
|
235
353
|
# 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.
|
236
|
-
# @option options [
|
354
|
+
# @option options [boolean] :include_all_metadata
|
355
|
+
# Return all metadata associated with this message.
|
356
|
+
# @option options [boolean] :inclusive
|
357
|
+
# Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.
|
358
|
+
# @option options [timestamp] :latest
|
359
|
+
# Only messages before this Unix timestamp will be included in results.
|
360
|
+
# @option options [number] :limit
|
237
361
|
# 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.
|
362
|
+
# @option options [timestamp] :oldest
|
363
|
+
# Only messages after this Unix timestamp will be included in results.
|
238
364
|
# @see https://api.slack.com/methods/conversations.replies
|
239
365
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.replies.json
|
240
366
|
def conversations_replies(options = {})
|
241
|
-
|
242
|
-
|
243
|
-
options = options.merge(channel:
|
367
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
368
|
+
raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
|
369
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
244
370
|
if block_given?
|
245
371
|
Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
|
246
372
|
yield page
|
@@ -251,18 +377,18 @@ module Slack
|
|
251
377
|
end
|
252
378
|
|
253
379
|
#
|
254
|
-
# Sets the
|
380
|
+
# Sets the channel description.
|
255
381
|
#
|
256
382
|
# @option options [channel] :channel
|
257
|
-
#
|
258
|
-
# @option options [
|
259
|
-
#
|
383
|
+
# Channel to set the description of.
|
384
|
+
# @option options [string] :purpose
|
385
|
+
# The description.
|
260
386
|
# @see https://api.slack.com/methods/conversations.setPurpose
|
261
387
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json
|
262
388
|
def conversations_setPurpose(options = {})
|
263
|
-
|
264
|
-
|
265
|
-
options = options.merge(channel:
|
389
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
390
|
+
raise ArgumentError, 'Required arguments :purpose missing' if options[:purpose].nil?
|
391
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
266
392
|
post('conversations.setPurpose', options)
|
267
393
|
end
|
268
394
|
|
@@ -271,14 +397,14 @@ module Slack
|
|
271
397
|
#
|
272
398
|
# @option options [channel] :channel
|
273
399
|
# Conversation to set the topic of.
|
274
|
-
# @option options [
|
400
|
+
# @option options [string] :topic
|
275
401
|
# The new topic string. Does not support formatting or linkification.
|
276
402
|
# @see https://api.slack.com/methods/conversations.setTopic
|
277
403
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setTopic.json
|
278
404
|
def conversations_setTopic(options = {})
|
279
|
-
|
280
|
-
|
281
|
-
options = options.merge(channel:
|
405
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
406
|
+
raise ArgumentError, 'Required arguments :topic missing' if options[:topic].nil?
|
407
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
282
408
|
post('conversations.setTopic', options)
|
283
409
|
end
|
284
410
|
|
@@ -290,8 +416,8 @@ module Slack
|
|
290
416
|
# @see https://api.slack.com/methods/conversations.unarchive
|
291
417
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
|
292
418
|
def conversations_unarchive(options = {})
|
293
|
-
|
294
|
-
options = options.merge(channel:
|
419
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
420
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
295
421
|
post('conversations.unarchive', options)
|
296
422
|
end
|
297
423
|
end
|
@@ -0,0 +1,28 @@
|
|
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 ConversationsCanvases
|
9
|
+
#
|
10
|
+
# Create a channel canvas for a channel
|
11
|
+
#
|
12
|
+
# @option options [string] :channel_id
|
13
|
+
# Channel ID of the channel we create the channel canvas for.
|
14
|
+
# @option options [Object] :document_content
|
15
|
+
# Structure describing the type and value of the content to create.
|
16
|
+
# @option options [string] :title
|
17
|
+
# Title of the newly created canvas.
|
18
|
+
# @see https://api.slack.com/methods/conversations.canvases.create
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.canvases/conversations.canvases.create.json
|
20
|
+
def conversations_canvases_create(options = {})
|
21
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
22
|
+
post('conversations.canvases.create', options)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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 ConversationsExternalinvitepermissions
|
9
|
+
#
|
10
|
+
# Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'.
|
11
|
+
#
|
12
|
+
# @option options [enum] :action
|
13
|
+
# Type of action to be taken: upgrade or downgrade.
|
14
|
+
# @option options [channel] :channel
|
15
|
+
# The channel ID to change external invite permissions for.
|
16
|
+
# @option options [Object] :target_team
|
17
|
+
# The encoded team ID of the target team. Must be in the specified channel.
|
18
|
+
# @see https://api.slack.com/methods/conversations.externalInvitePermissions.set
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.externalInvitePermissions/conversations.externalInvitePermissions.set.json
|
20
|
+
def conversations_externalInvitePermissions_set(options = {})
|
21
|
+
raise ArgumentError, 'Required arguments :action missing' if options[:action].nil?
|
22
|
+
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
23
|
+
raise ArgumentError, 'Required arguments :target_team missing' if options[:target_team].nil?
|
24
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
25
|
+
post('conversations.externalInvitePermissions.set', options)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,73 @@
|
|
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 ConversationsRequestsharedinvite
|
9
|
+
#
|
10
|
+
# Approves a request to add an external user to a channel and sends them a Slack Connect invite
|
11
|
+
#
|
12
|
+
# @option options [Object] :invite_id
|
13
|
+
# ID of the requested shared channel invite to approve.
|
14
|
+
# @option options [string] :channel_id
|
15
|
+
# Optional channel_id to which external user will be invited to. Will override the value on the requested invite.
|
16
|
+
# @option options [boolean] :is_external_limited
|
17
|
+
# Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite.
|
18
|
+
# @option options [object] :message
|
19
|
+
# Object describing the text to send along with the invite. If this object is specified, both text and is_override are required properties. If is_override is set to true, text will override the original invitation message. Otherwise, text will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If is_override is set to false, the length of text and the user specified message on the invite request in total must be less than 560 characters.
|
20
|
+
# @see https://api.slack.com/methods/conversations.requestSharedInvite.approve
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.requestSharedInvite/conversations.requestSharedInvite.approve.json
|
22
|
+
def conversations_requestSharedInvite_approve(options = {})
|
23
|
+
raise ArgumentError, 'Required arguments :invite_id missing' if options[:invite_id].nil?
|
24
|
+
post('conversations.requestSharedInvite.approve', options)
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# Denies a request to invite an external user to a channel
|
29
|
+
#
|
30
|
+
# @option options [Object] :invite_id
|
31
|
+
# ID of the requested shared channel invite to deny.
|
32
|
+
# @option options [string] :message
|
33
|
+
# Optional message explaining why the request to invite was denied.
|
34
|
+
# @see https://api.slack.com/methods/conversations.requestSharedInvite.deny
|
35
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.requestSharedInvite/conversations.requestSharedInvite.deny.json
|
36
|
+
def conversations_requestSharedInvite_deny(options = {})
|
37
|
+
raise ArgumentError, 'Required arguments :invite_id missing' if options[:invite_id].nil?
|
38
|
+
post('conversations.requestSharedInvite.deny', options)
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Lists requests to add external users to channels with ability to filter.
|
43
|
+
#
|
44
|
+
# @option options [string] :cursor
|
45
|
+
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail.
|
46
|
+
# @option options [boolean] :include_approved
|
47
|
+
# When true approved invitation requests will be returned, otherwise they will be excluded.
|
48
|
+
# @option options [boolean] :include_denied
|
49
|
+
# When true denied invitation requests will be returned, otherwise they will be excluded.
|
50
|
+
# @option options [boolean] :include_expired
|
51
|
+
# When true expired invitation requests will be returned, otherwise they will be excluded.
|
52
|
+
# @option options [array] :invite_ids
|
53
|
+
# An optional list of invitation ids to look up.
|
54
|
+
# @option options [integer] :limit
|
55
|
+
# The number of items to return. Must be between 1 - 1000 (inclusive).
|
56
|
+
# @option options [Object] :user_id
|
57
|
+
# Optional filter to return invitation requests for the inviting user.
|
58
|
+
# @see https://api.slack.com/methods/conversations.requestSharedInvite.list
|
59
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.requestSharedInvite/conversations.requestSharedInvite.list.json
|
60
|
+
def conversations_requestSharedInvite_list(options = {})
|
61
|
+
if block_given?
|
62
|
+
Pagination::Cursor.new(self, :conversations_requestSharedInvite_list, options).each do |page|
|
63
|
+
yield page
|
64
|
+
end
|
65
|
+
else
|
66
|
+
post('conversations.requestSharedInvite.list', options)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
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,21 +9,16 @@ module Slack
|
|
8
9
|
#
|
9
10
|
# Open a dialog with a user
|
10
11
|
#
|
11
|
-
# @option options [
|
12
|
+
# @option options [string] :dialog
|
12
13
|
# The dialog definition. This must be a JSON-encoded string.
|
13
|
-
# @option options [
|
14
|
+
# @option options [string] :trigger_id
|
14
15
|
# Exchange a trigger to post to the user.
|
15
16
|
# @see https://api.slack.com/methods/dialog.open
|
16
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dialog/dialog.open.json
|
17
18
|
def dialog_open(options = {})
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if options.key?(:dialog)
|
22
|
-
dialog = options[:dialog]
|
23
|
-
dialog = JSON.dump(dialog) unless dialog.is_a?(String)
|
24
|
-
options = options.merge(dialog: dialog)
|
25
|
-
end
|
19
|
+
raise ArgumentError, 'Required arguments :dialog missing' if options[:dialog].nil?
|
20
|
+
raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
|
21
|
+
options = encode_options_as_json(options, %i[dialog])
|
26
22
|
post('dialog.open', options)
|
27
23
|
end
|
28
24
|
end
|