slack-ruby-client 2.2.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/integration_test.yml +1 -1
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/pr_lint.yml +1 -1
- data/.github/workflows/test.yml +23 -13
- data/.github/workflows/update_api.yml +8 -3
- data/.gitignore +1 -0
- data/CHANGELOG.md +14 -0
- data/README.md +27 -2
- data/bin/commands/admin_apps_activities.rb +4 -4
- data/bin/commands/admin_apps_config.rb +2 -2
- data/bin/commands/admin_conversations.rb +2 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_users.rb +6 -4
- data/bin/commands/admin_workflows.rb +4 -2
- data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
- data/bin/commands/apps_datastore.rb +46 -0
- data/bin/commands/canvases.rb +40 -0
- data/bin/commands/canvases_access.rb +34 -0
- data/bin/commands/canvases_sections.rb +21 -0
- data/bin/commands/chat.rb +9 -9
- data/bin/commands/conversations.rb +3 -2
- data/bin/commands/conversations_canvases.rb +21 -0
- data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
- data/bin/commands/functions.rb +31 -0
- data/bin/commands/functions_distributions_permissions.rb +59 -0
- data/bin/commands/oauth.rb +2 -2
- data/bin/commands/oauth_v2.rb +2 -2
- data/bin/commands/pins.rb +0 -1
- data/bin/commands/reminders.rb +1 -1
- data/bin/commands/team.rb +2 -2
- data/bin/commands/team_externalTeams.rb +35 -0
- data/bin/commands/usergroups.rb +10 -10
- data/bin/commands/usergroups_users.rb +8 -8
- data/bin/commands/users_discoverableContacts.rb +20 -0
- data/bin/commands/workflows_triggers_permissions.rb +60 -0
- data/lib/slack/events/request.rb +4 -2
- data/lib/slack/messages/formatting.rb +13 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_conversations.rb +3 -1
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +6 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +9 -5
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_datastore.rb +71 -0
- data/lib/slack/web/api/endpoints/canvases.rb +52 -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 +21 -21
- data/lib/slack/web/api/endpoints/conversations.rb +4 -2
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +26 -0
- data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
- data/lib/slack/web/api/endpoints/dnd.rb +1 -0
- data/lib/slack/web/api/endpoints/functions.rb +43 -0
- data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +80 -0
- data/lib/slack/web/api/endpoints/oauth.rb +2 -2
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/openid_connect.rb +1 -1
- data/lib/slack/web/api/endpoints/pins.rb +0 -2
- data/lib/slack/web/api/endpoints/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/team.rb +3 -3
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +6 -6
- data/lib/slack/web/api/endpoints/users.rb +1 -1
- data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +24 -0
- data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
- data/lib/slack/web/api/endpoints.rb +22 -0
- data/lib/slack/web/api/errors.rb +84 -4
- data/lib/slack/web/api/patches/.gitkeep +0 -0
- data/lib/slack/web/api/templates/method.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +2 -1
- data/spec/slack/events/request_spec.rb +11 -0
- data/spec/slack/messages/formatting_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_workflows_triggers_types_permissions_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +29 -0
- data/spec/slack/web/api/endpoints/canvases_access_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/canvases_sections_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/canvases_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/chat_spec.rb +76 -4
- data/spec/slack/web/api/endpoints/conversations_canvases_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +19 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +2 -9
- data/spec/slack/web/api/endpoints/dnd_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/functions_distributions_permissions_spec.rb +10 -0
- data/spec/slack/web/api/endpoints/functions_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/team_externalTeams_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/users_discoverableContacts_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/workflows_triggers_permissions_spec.rb +31 -0
- metadata +37 -3
- data/lib/slack/web/api/patches/chat.attachments-blocks.patch +0 -21
@@ -0,0 +1,41 @@
|
|
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 AdminWorkflowsTriggersTypesPermissions
|
9
|
+
#
|
10
|
+
# list the permissions for using each trigger type in workflow builder
|
11
|
+
#
|
12
|
+
# @option options [array] :trigger_type_ids
|
13
|
+
# The trigger types IDs for which to get the permissions.
|
14
|
+
# @see https://api.slack.com/methods/admin.workflows.triggers.types.permissions.lookup
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.triggers.types.permissions/admin.workflows.triggers.types.permissions.lookup.json
|
16
|
+
def admin_workflows_triggers_types_permissions_lookup(options = {})
|
17
|
+
raise ArgumentError, 'Required arguments :trigger_type_ids missing' if options[:trigger_type_ids].nil?
|
18
|
+
post('admin.workflows.triggers.types.permissions.lookup', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Set the permissions for using a trigger type in workflow builder
|
23
|
+
#
|
24
|
+
# @option options [Object] :id
|
25
|
+
# The trigger type ID for which to set the permissions.
|
26
|
+
# @option options [enum] :visibility
|
27
|
+
# The function visibility.
|
28
|
+
# @option options [array] :user_ids
|
29
|
+
# List of user IDs to allow for named_entities visibility.
|
30
|
+
# @see https://api.slack.com/methods/admin.workflows.triggers.types.permissions.set
|
31
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows.triggers.types.permissions/admin.workflows.triggers.types.permissions.set.json
|
32
|
+
def admin_workflows_triggers_types_permissions_set(options = {})
|
33
|
+
raise ArgumentError, 'Required arguments :id missing' if options[:id].nil?
|
34
|
+
raise ArgumentError, 'Required arguments :visibility missing' if options[:visibility].nil?
|
35
|
+
post('admin.workflows.triggers.types.permissions.set', options)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -27,7 +27,7 @@ module Slack
|
|
27
27
|
# The earliest timestamp of the log to retrieve (epoch microseconds).
|
28
28
|
# @option options [string] :min_log_level
|
29
29
|
# The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal').
|
30
|
-
# @option options [
|
30
|
+
# @option options [enum] :sort_direction
|
31
31
|
# The direction you want the data sorted by (always by timestamp).
|
32
32
|
# @option options [string] :source
|
33
33
|
# The source of log events to be returned. Acceptable values are ('slack', 'developer').
|
@@ -6,6 +6,77 @@ module Slack
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module AppsDatastore
|
9
|
+
#
|
10
|
+
# Delete items from a datastore in bulk
|
11
|
+
#
|
12
|
+
# @option options [string] :datastore
|
13
|
+
# name of the datastore.
|
14
|
+
# @option options [array] :ids
|
15
|
+
# IDs of items to be deleted.
|
16
|
+
# @option options [Object] :app_id
|
17
|
+
# .
|
18
|
+
# @see https://api.slack.com/methods/apps.datastore.bulkDelete
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.bulkDelete.json
|
20
|
+
def apps_datastore_bulkDelete(options = {})
|
21
|
+
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
|
22
|
+
raise ArgumentError, 'Required arguments :ids missing' if options[:ids].nil?
|
23
|
+
post('apps.datastore.bulkDelete', options)
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Get items from a datastore in bulk
|
28
|
+
#
|
29
|
+
# @option options [string] :datastore
|
30
|
+
# name of the datastore.
|
31
|
+
# @option options [array] :ids
|
32
|
+
# items' ids.
|
33
|
+
# @option options [Object] :app_id
|
34
|
+
# .
|
35
|
+
# @see https://api.slack.com/methods/apps.datastore.bulkGet
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.bulkGet.json
|
37
|
+
def apps_datastore_bulkGet(options = {})
|
38
|
+
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
|
39
|
+
raise ArgumentError, 'Required arguments :ids missing' if options[:ids].nil?
|
40
|
+
post('apps.datastore.bulkGet', options)
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Creates or replaces existing items in bulk
|
45
|
+
#
|
46
|
+
# @option options [string] :datastore
|
47
|
+
# name of the datastore.
|
48
|
+
# @option options [array] :items
|
49
|
+
# attribute names and values of the items; limit of 25.
|
50
|
+
# @option options [Object] :app_id
|
51
|
+
# .
|
52
|
+
# @see https://api.slack.com/methods/apps.datastore.bulkPut
|
53
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.bulkPut.json
|
54
|
+
def apps_datastore_bulkPut(options = {})
|
55
|
+
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
|
56
|
+
raise ArgumentError, 'Required arguments :items missing' if options[:items].nil?
|
57
|
+
post('apps.datastore.bulkPut', options)
|
58
|
+
end
|
59
|
+
|
60
|
+
#
|
61
|
+
# Count the number of items in a datastore that match a query
|
62
|
+
#
|
63
|
+
# @option options [string] :datastore
|
64
|
+
# Name of the datastore.
|
65
|
+
# @option options [Object] :app_id
|
66
|
+
# Required if calling with user token.
|
67
|
+
# @option options [string] :expression
|
68
|
+
# A query filter expression https://api.slack.com/future/datastores.
|
69
|
+
# @option options [object] :expression_attributes
|
70
|
+
# A map of attributes referenced in expression.
|
71
|
+
# @option options [object] :expression_values
|
72
|
+
# A map of values referenced in expression.
|
73
|
+
# @see https://api.slack.com/methods/apps.datastore.count
|
74
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.count.json
|
75
|
+
def apps_datastore_count(options = {})
|
76
|
+
raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
|
77
|
+
post('apps.datastore.count', options)
|
78
|
+
end
|
79
|
+
|
9
80
|
#
|
10
81
|
# Delete an item from a datastore
|
11
82
|
#
|
@@ -0,0 +1,52 @@
|
|
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 Canvases
|
9
|
+
#
|
10
|
+
# Create Canvas for a user.
|
11
|
+
#
|
12
|
+
# @option options [Object] :document_content
|
13
|
+
# Structure describing the type and value of the content to create.
|
14
|
+
# @option options [string] :title
|
15
|
+
# Title of the newly created canvas.
|
16
|
+
# @see https://api.slack.com/methods/canvases.create
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.create.json
|
18
|
+
def canvases_create(options = {})
|
19
|
+
post('canvases.create', options)
|
20
|
+
end
|
21
|
+
|
22
|
+
#
|
23
|
+
# Deletes a canvas.
|
24
|
+
#
|
25
|
+
# @option options [Object] :canvas_id
|
26
|
+
# Encoded ID of the canvas.
|
27
|
+
# @see https://api.slack.com/methods/canvases.delete
|
28
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.delete.json
|
29
|
+
def canvases_delete(options = {})
|
30
|
+
raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
|
31
|
+
post('canvases.delete', options)
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Update an existing canvas
|
36
|
+
#
|
37
|
+
# @option options [Object] :canvas_id
|
38
|
+
# Encoded ID of the canvas.
|
39
|
+
# @option options [array] :changes
|
40
|
+
# List of changes to apply on the specified canvas.
|
41
|
+
# @see https://api.slack.com/methods/canvases.edit
|
42
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.edit.json
|
43
|
+
def canvases_edit(options = {})
|
44
|
+
raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
|
45
|
+
raise ArgumentError, 'Required arguments :changes missing' if options[:changes].nil?
|
46
|
+
post('canvases.edit', options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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 CanvasesAccess
|
9
|
+
#
|
10
|
+
# Remove access to a canvas for specified entities
|
11
|
+
#
|
12
|
+
# @option options [Object] :canvas_id
|
13
|
+
# Encoded ID of the canvas.
|
14
|
+
# @option options [array] :channel_ids
|
15
|
+
# List of channels you wish to update access for.
|
16
|
+
# @option options [array] :user_ids
|
17
|
+
# List of users you wish to update access for.
|
18
|
+
# @see https://api.slack.com/methods/canvases.access.delete
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases.access/canvases.access.delete.json
|
20
|
+
def canvases_access_delete(options = {})
|
21
|
+
raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
|
22
|
+
post('canvases.access.delete', options)
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# Sets the access level to a canvas for specified entities
|
27
|
+
#
|
28
|
+
# @option options [Object] :access_level
|
29
|
+
# Desired level of access (e.g. read, write).
|
30
|
+
# @option options [Object] :canvas_id
|
31
|
+
# Encoded ID of the canvas.
|
32
|
+
# @option options [array] :channel_ids
|
33
|
+
# List of channels you wish to update access for.
|
34
|
+
# @option options [array] :user_ids
|
35
|
+
# List of users you wish to update access for.
|
36
|
+
# @see https://api.slack.com/methods/canvases.access.set
|
37
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases.access/canvases.access.set.json
|
38
|
+
def canvases_access_set(options = {})
|
39
|
+
raise ArgumentError, 'Required arguments :access_level missing' if options[:access_level].nil?
|
40
|
+
raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
|
41
|
+
post('canvases.access.set', options)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,27 @@
|
|
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 CanvasesSections
|
9
|
+
#
|
10
|
+
# Find sections matching the provided criteria
|
11
|
+
#
|
12
|
+
# @option options [Object] :canvas_id
|
13
|
+
# Encoded ID of the canvas.
|
14
|
+
# @option options [Object] :criteria
|
15
|
+
# Filtering criteria.
|
16
|
+
# @see https://api.slack.com/methods/canvases.sections.lookup
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases.sections/canvases.sections.lookup.json
|
18
|
+
def canvases_sections_lookup(options = {})
|
19
|
+
raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
|
20
|
+
raise ArgumentError, 'Required arguments :criteria missing' if options[:criteria].nil?
|
21
|
+
post('canvases.sections.lookup', options)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -96,16 +96,16 @@ module Slack
|
|
96
96
|
#
|
97
97
|
# @option options [channel] :channel
|
98
98
|
# Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
|
99
|
-
# @option options [string] :text
|
100
|
-
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
101
99
|
# @option options [user] :user
|
102
100
|
# id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.
|
103
|
-
# @option options [boolean] :as_user
|
104
|
-
# (Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.
|
105
101
|
# @option options [string] :attachments
|
106
102
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
107
103
|
# @option options [blocks[] as string] :blocks
|
108
104
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
105
|
+
# @option options [string] :text
|
106
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
107
|
+
# @option options [boolean] :as_user
|
108
|
+
# (Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.
|
109
109
|
# @option options [string] :icon_emoji
|
110
110
|
# Emoji to use as the icon for this message. Overrides icon_url.
|
111
111
|
# @option options [string] :icon_url
|
@@ -122,8 +122,8 @@ module Slack
|
|
122
122
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
|
123
123
|
def chat_postEphemeral(options = {})
|
124
124
|
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
125
|
-
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
|
126
125
|
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
|
126
|
+
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
|
127
127
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
128
128
|
options = encode_options_as_json(options, %i[attachments blocks])
|
129
129
|
post('chat.postEphemeral', options)
|
@@ -139,7 +139,7 @@ module Slack
|
|
139
139
|
# @option options [blocks[] as string] :blocks
|
140
140
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
141
141
|
# @option options [string] :text
|
142
|
-
#
|
142
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
143
143
|
# @option options [boolean] :as_user
|
144
144
|
# (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic Slack apps. See authorship below.
|
145
145
|
# @option options [string] :icon_emoji
|
@@ -179,20 +179,20 @@ module Slack
|
|
179
179
|
# @option options [channel] :channel
|
180
180
|
# Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
|
181
181
|
# @option options [integer] :post_at
|
182
|
-
# Unix
|
183
|
-
# @option options [string] :text
|
184
|
-
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
185
|
-
# @option options [boolean] :as_user
|
186
|
-
# Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.
|
182
|
+
# Unix timestamp representing the future time the message should post to Slack.
|
187
183
|
# @option options [string] :attachments
|
188
184
|
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
189
185
|
# @option options [blocks[] as string] :blocks
|
190
186
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
187
|
+
# @option options [string] :text
|
188
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
189
|
+
# @option options [boolean] :as_user
|
190
|
+
# Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.
|
191
191
|
# @option options [boolean] :link_names
|
192
192
|
# Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
|
193
193
|
# @option options [string] :metadata
|
194
194
|
# JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
|
195
|
-
# @option options [
|
195
|
+
# @option options [enum] :parse
|
196
196
|
# Change how messages are treated. See chat.postMessage.
|
197
197
|
# @option options [boolean] :reply_broadcast
|
198
198
|
# Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
|
@@ -207,7 +207,7 @@ module Slack
|
|
207
207
|
def chat_scheduleMessage(options = {})
|
208
208
|
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
209
209
|
raise ArgumentError, 'Required arguments :post_at missing' if options[:post_at].nil?
|
210
|
-
raise ArgumentError, '
|
210
|
+
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
|
211
211
|
options = encode_options_as_json(options, %i[attachments blocks metadata])
|
212
212
|
post('chat.scheduleMessage', options)
|
213
213
|
end
|
@@ -221,7 +221,7 @@ module Slack
|
|
221
221
|
# Timestamp of the message to add unfurl behavior to.
|
222
222
|
# @option options [string] :unfurls
|
223
223
|
# URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.
|
224
|
-
# @option options [
|
224
|
+
# @option options [enum] :source
|
225
225
|
# The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.
|
226
226
|
# @option options [string] :unfurl_id
|
227
227
|
# The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.
|
@@ -251,12 +251,14 @@ module Slack
|
|
251
251
|
# Channel containing the message to be updated.
|
252
252
|
# @option options [timestamp] :ts
|
253
253
|
# Timestamp of the message to be updated.
|
254
|
-
# @option options [boolean] :as_user
|
255
|
-
# Pass true to update the message as the authed user. Bot users in this context are considered authed users.
|
256
254
|
# @option options [string] :attachments
|
257
|
-
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
255
|
+
# A JSON-based array of structured attachments, presented as a URL-encoded string.
|
258
256
|
# @option options [blocks[] as string] :blocks
|
259
|
-
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
257
|
+
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
258
|
+
# @option options [string] :text
|
259
|
+
# How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
|
260
|
+
# @option options [boolean] :as_user
|
261
|
+
# Pass true to update the message as the authed user. Bot users in this context are considered authed users.
|
260
262
|
# @option options [array] :file_ids
|
261
263
|
# Array of new file ids that will be sent with this message.
|
262
264
|
# @option options [boolean] :link_names
|
@@ -267,14 +269,12 @@ module Slack
|
|
267
269
|
# Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.
|
268
270
|
# @option options [boolean] :reply_broadcast
|
269
271
|
# Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.
|
270
|
-
# @option options [string] :text
|
271
|
-
# New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments.
|
272
272
|
# @see https://api.slack.com/methods/chat.update
|
273
273
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
|
274
274
|
def chat_update(options = {})
|
275
275
|
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
276
276
|
raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
|
277
|
-
raise ArgumentError, 'At least one of :attachments, :blocks, :text
|
277
|
+
raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
|
278
278
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
279
279
|
options = encode_options_as_json(options, %i[attachments blocks metadata])
|
280
280
|
post('chat.update', options)
|
@@ -112,7 +112,7 @@ module Slack
|
|
112
112
|
# @option options [timestamp] :latest
|
113
113
|
# Only messages before this Unix timestamp will be included in results. Default is the current time.
|
114
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
|
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.
|
116
116
|
# @option options [timestamp] :oldest
|
117
117
|
# Only messages after this Unix timestamp will be included in results.
|
118
118
|
# @see https://api.slack.com/methods/conversations.history
|
@@ -153,6 +153,8 @@ module Slack
|
|
153
153
|
# The ID of the public or private channel to invite user(s) to.
|
154
154
|
# @option options [string] :users
|
155
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.
|
156
158
|
# @see https://api.slack.com/methods/conversations.invite
|
157
159
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
|
158
160
|
def conversations_invite(options = {})
|
@@ -232,7 +234,7 @@ module Slack
|
|
232
234
|
# @option options [boolean] :exclude_archived
|
233
235
|
# Set to true to exclude archived channels from the list.
|
234
236
|
# @option options [number] :limit
|
235
|
-
# 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
|
237
|
+
# 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.
|
236
238
|
# @option options [string] :team_id
|
237
239
|
# encoded team id to list channels in, required if token belongs to org-wide app.
|
238
240
|
# @option options [string] :types
|
@@ -0,0 +1,26 @@
|
|
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
|
+
# @see https://api.slack.com/methods/conversations.canvases.create
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.canvases/conversations.canvases.create.json
|
18
|
+
def conversations_canvases_create(options = {})
|
19
|
+
raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
|
20
|
+
post('conversations.canvases.create', options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
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
|
@@ -46,6 +46,7 @@ module Slack
|
|
46
46
|
# @see https://api.slack.com/methods/dnd.setSnooze
|
47
47
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dnd/dnd.setSnooze.json
|
48
48
|
def dnd_setSnooze(options = {})
|
49
|
+
raise ArgumentError, 'Required arguments :num_minutes missing' if options[:num_minutes].nil?
|
49
50
|
post('dnd.setSnooze', options)
|
50
51
|
end
|
51
52
|
|
@@ -0,0 +1,43 @@
|
|
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 Functions
|
9
|
+
#
|
10
|
+
# Signal that a function failed to complete
|
11
|
+
#
|
12
|
+
# @option options [string] :error
|
13
|
+
# A human-readable error message that contains information about why the function failed to complete.
|
14
|
+
# @option options [string] :function_execution_id
|
15
|
+
# Context identifier that maps to the executed function.
|
16
|
+
# @see https://api.slack.com/methods/functions.completeError
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions/functions.completeError.json
|
18
|
+
def functions_completeError(options = {})
|
19
|
+
raise ArgumentError, 'Required arguments :error missing' if options[:error].nil?
|
20
|
+
raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
|
21
|
+
post('functions.completeError', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# Signal the successful completion of a function
|
26
|
+
#
|
27
|
+
# @option options [string] :function_execution_id
|
28
|
+
# Context identifier that maps to the executed function.
|
29
|
+
# @option options [object] :outputs
|
30
|
+
# A JSON-based object that conforms to the output parameters schema for the custom function defined in the manifest.
|
31
|
+
# @see https://api.slack.com/methods/functions.completeSuccess
|
32
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions/functions.completeSuccess.json
|
33
|
+
def functions_completeSuccess(options = {})
|
34
|
+
raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
|
35
|
+
raise ArgumentError, 'Required arguments :outputs missing' if options[:outputs].nil?
|
36
|
+
options = encode_options_as_json(options, %i[outputs])
|
37
|
+
post('functions.completeSuccess', options)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,80 @@
|
|
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 FunctionsDistributionsPermissions
|
9
|
+
#
|
10
|
+
# Grant users access to a custom slack function if its permission_type is set to named_entities
|
11
|
+
#
|
12
|
+
# @option options [string] :function_app_id
|
13
|
+
# The encoded ID of the app.
|
14
|
+
# @option options [string] :function_callback_id
|
15
|
+
# The callback ID defined in the function's definition file.
|
16
|
+
# @option options [string] :function_id
|
17
|
+
# The encoded ID of the function.
|
18
|
+
# @option options [array] :user_ids
|
19
|
+
# List of encoded user IDs.
|
20
|
+
# @see https://api.slack.com/methods/functions.distributions.permissions.add
|
21
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions.distributions.permissions/functions.distributions.permissions.add.json
|
22
|
+
def functions_distributions_permissions_add(options = {})
|
23
|
+
post('functions.distributions.permissions.add', options)
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# List the access type of a custom slack function and include the users with access if its permission_type is set to named_entities
|
28
|
+
#
|
29
|
+
# @option options [string] :function_app_id
|
30
|
+
# The encoded ID of the app.
|
31
|
+
# @option options [string] :function_callback_id
|
32
|
+
# The callback ID defined in the function's definition file.
|
33
|
+
# @option options [string] :function_id
|
34
|
+
# The encoded ID of the function.
|
35
|
+
# @see https://api.slack.com/methods/functions.distributions.permissions.list
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions.distributions.permissions/functions.distributions.permissions.list.json
|
37
|
+
def functions_distributions_permissions_list(options = {})
|
38
|
+
post('functions.distributions.permissions.list', options)
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Revoke user access to a custom slack function if permission_type set to named_entities
|
43
|
+
#
|
44
|
+
# @option options [string] :function_app_id
|
45
|
+
# The encoded ID of the app.
|
46
|
+
# @option options [string] :function_callback_id
|
47
|
+
# The callback ID defined in the function's definition file.
|
48
|
+
# @option options [string] :function_id
|
49
|
+
# The encoded ID of the function.
|
50
|
+
# @option options [array] :user_ids
|
51
|
+
# List of encoded user IDs.
|
52
|
+
# @see https://api.slack.com/methods/functions.distributions.permissions.remove
|
53
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions.distributions.permissions/functions.distributions.permissions.remove.json
|
54
|
+
def functions_distributions_permissions_remove(options = {})
|
55
|
+
post('functions.distributions.permissions.remove', options)
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Set the access type of a custom slack function and define the users to be granted access if permission_type is set to named_entities
|
60
|
+
#
|
61
|
+
# @option options [enum] :permission_type
|
62
|
+
# The type of permission that defines how the function can be distributed.
|
63
|
+
# @option options [string] :function_app_id
|
64
|
+
# The encoded ID of the app.
|
65
|
+
# @option options [string] :function_callback_id
|
66
|
+
# The callback ID defined in the function's definition file.
|
67
|
+
# @option options [string] :function_id
|
68
|
+
# The encoded ID of the function.
|
69
|
+
# @option options [array] :user_ids
|
70
|
+
# List of encoded user IDs.
|
71
|
+
# @see https://api.slack.com/methods/functions.distributions.permissions.set
|
72
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/functions.distributions.permissions/functions.distributions.permissions.set.json
|
73
|
+
def functions_distributions_permissions_set(options = {})
|
74
|
+
post('functions.distributions.permissions.set', options)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -10,9 +10,9 @@ module Slack
|
|
10
10
|
# Exchanges a temporary OAuth verifier code for an access token.
|
11
11
|
#
|
12
12
|
# @option options [string] :client_id
|
13
|
-
# Issued when you created your application.
|
13
|
+
# Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.
|
14
14
|
# @option options [string] :client_secret
|
15
|
-
# Issued when you created your application.
|
15
|
+
# Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.
|
16
16
|
# @option options [string] :code
|
17
17
|
# The code param returned via the OAuth callback.
|
18
18
|
# @option options [string] :redirect_uri
|
@@ -10,9 +10,9 @@ module Slack
|
|
10
10
|
# Exchanges a temporary OAuth verifier code for an access token.
|
11
11
|
#
|
12
12
|
# @option options [string] :client_id
|
13
|
-
# Issued when you created your application.
|
13
|
+
# Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.
|
14
14
|
# @option options [string] :client_secret
|
15
|
-
# Issued when you created your application.
|
15
|
+
# Issued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.
|
16
16
|
# @option options [string] :code
|
17
17
|
# The code param returned via the OAuth callback.
|
18
18
|
# @option options [string] :grant_type
|
@@ -15,7 +15,7 @@ module Slack
|
|
15
15
|
# Issued when you created your application.
|
16
16
|
# @option options [string] :code
|
17
17
|
# The code param returned via the OAuth callback.
|
18
|
-
# @option options [
|
18
|
+
# @option options [enum] :grant_type
|
19
19
|
# The grant_type param as described in the OAuth spec.
|
20
20
|
# @option options [string] :redirect_uri
|
21
21
|
# This must match the originally submitted URI (if one was sent).
|