slack-ruby-client 2.3.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/workflows/test.yml +22 -12
- data/.github/workflows/update_api.yml +1 -1
- data/.gitignore +1 -0
- data/CHANGELOG.md +7 -0
- data/README.md +26 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_users.rb +4 -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/conversations.rb +1 -1
- data/bin/commands/conversations_canvases.rb +21 -0
- data/bin/commands/conversations_externalInvitePermissions.rb +22 -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/reminders.rb +1 -1
- data/bin/commands/team_externalTeams.rb +35 -0
- data/bin/commands/users_discoverableContacts.rb +20 -0
- data/bin/commands/workflows_triggers_permissions.rb +60 -0
- data/lib/slack/messages/formatting.rb +13 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +6 -2
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
- 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/conversations.rb +1 -1
- 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_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/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
- 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 +20 -0
- data/lib/slack/web/api/errors.rb +70 -4
- data/lib/slack/web/api/templates/method.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +2 -1
- 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/conversations_canvases_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +19 -0
- 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/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 +32 -2
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'WorkflowsTriggersPermissions methods.'
|
8
|
+
command 'workflows_triggers_permissions' do |g|
|
9
|
+
g.desc 'Allows users to run a trigger that has its permission type set to named_entities'
|
10
|
+
g.long_desc %( Allows users to run a trigger that has its permission type set to named_entities )
|
11
|
+
g.command 'add' do |c|
|
12
|
+
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
|
13
|
+
c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
|
14
|
+
c.flag 'org_ids', desc: 'List of encoded organization IDs.'
|
15
|
+
c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
|
16
|
+
c.flag 'user_ids', desc: 'List of encoded user IDs.'
|
17
|
+
c.action do |_global_options, options, _args|
|
18
|
+
puts JSON.dump(@client.workflows_triggers_permissions_add(options))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
g.desc 'Returns the permission type of a trigger and if applicable, includes the entities that have been granted access'
|
23
|
+
g.long_desc %( Returns the permission type of a trigger and if applicable, includes the entities that have been granted access )
|
24
|
+
g.command 'list' do |c|
|
25
|
+
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
|
26
|
+
c.action do |_global_options, options, _args|
|
27
|
+
puts JSON.dump(@client.workflows_triggers_permissions_list(options))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
g.desc "Revoke an entity's access to a trigger that has its permission type set to named_entities"
|
32
|
+
g.long_desc %( Revoke an entity's access to a trigger that has its permission type set to named_entities )
|
33
|
+
g.command 'remove' do |c|
|
34
|
+
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
|
35
|
+
c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
|
36
|
+
c.flag 'org_ids', desc: 'List of encoded organization IDs.'
|
37
|
+
c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
|
38
|
+
c.flag 'user_ids', desc: 'List of encoded user IDs.'
|
39
|
+
c.action do |_global_options, options, _args|
|
40
|
+
puts JSON.dump(@client.workflows_triggers_permissions_remove(options))
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
g.desc 'Set the permission type for who can run a trigger'
|
45
|
+
g.long_desc %( Set the permission type for who can run a trigger )
|
46
|
+
g.command 'set' do |c|
|
47
|
+
c.flag 'permission_type', desc: 'The type of permission that defines who can run a trigger.'
|
48
|
+
c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
|
49
|
+
c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
|
50
|
+
c.flag 'org_ids', desc: 'List of encoded organization IDs.'
|
51
|
+
c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
|
52
|
+
c.flag 'user_ids', desc: 'List of encoded user IDs.'
|
53
|
+
c.action do |_global_options, options, _args|
|
54
|
+
puts JSON.dump(@client.workflows_triggers_permissions_set(options))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -68,6 +68,19 @@ module Slack
|
|
68
68
|
def url_link(text, url)
|
69
69
|
"<#{url}|#{text}>"
|
70
70
|
end
|
71
|
+
|
72
|
+
#
|
73
|
+
# Converts text from basic markdown into Slack's mishmash
|
74
|
+
# @see https://api.slack.com/reference/surfaces/formatting#basic-formatting
|
75
|
+
#
|
76
|
+
def markdown(text)
|
77
|
+
text
|
78
|
+
.gsub(/(?<!\*)\*([^*]+)\*(?!\*)/, '_\1_') # italic
|
79
|
+
.gsub(/\*\*\*(.*?)\*\*\*/, '*_\1_*') # bold & italic
|
80
|
+
.gsub(/\*\*(.*?)\*\*/, '*\1*') # bold
|
81
|
+
.gsub(/~~(.*?)~~/, '~\1~') # strikethrough
|
82
|
+
.gsub(/\[(.*?)\]\((.*?)\)/, '<\2|\1>') # links
|
83
|
+
end
|
71
84
|
end
|
72
85
|
end
|
73
86
|
end
|
data/lib/slack/version.rb
CHANGED
@@ -10,7 +10,7 @@ module Slack
|
|
10
10
|
# Add an emoji.
|
11
11
|
#
|
12
12
|
# @option options [string] :name
|
13
|
-
# The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included.
|
13
|
+
# The name of the emoji to be added (using lower-case letters only). Colons (:myemoji:) around the value are not required, although they may be included.
|
14
14
|
# @option options [string] :url
|
15
15
|
# The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.
|
16
16
|
# @see https://api.slack.com/methods/admin.emoji.add
|
@@ -100,7 +100,7 @@ module Slack
|
|
100
100
|
end
|
101
101
|
|
102
102
|
#
|
103
|
-
# Set an existing
|
103
|
+
# Set an existing regular user or owner to be a workspace admin.
|
104
104
|
#
|
105
105
|
# @option options [Object] :team_id
|
106
106
|
# The ID (T1234) of the workspace.
|
@@ -132,7 +132,7 @@ module Slack
|
|
132
132
|
end
|
133
133
|
|
134
134
|
#
|
135
|
-
# Set an existing
|
135
|
+
# Set an existing regular user or admin to be a workspace owner.
|
136
136
|
#
|
137
137
|
# @option options [Object] :team_id
|
138
138
|
# The ID (T1234) of the workspace.
|
@@ -12,15 +12,17 @@ module Slack
|
|
12
12
|
# @option options [Object] :app_id
|
13
13
|
# The parent app ID for which to return workflows.
|
14
14
|
# @option options [array] :collaborator_ids
|
15
|
-
# Only include workflows
|
15
|
+
# Only include workflows where the provided user IDs are a manager/collaborator of that workflow.
|
16
16
|
# @option options [string] :cursor
|
17
17
|
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
18
|
+
# @option options [boolean] :is_sales_elevate
|
19
|
+
# Filter workflows by their Sales Elevate status.
|
18
20
|
# @option options [integer] :limit
|
19
21
|
# The number of results that will be returned by the API on each invocation.
|
20
22
|
# @option options [boolean] :no_collaborators
|
21
23
|
# Only include workflows with no collaborators in the result; default is false.
|
22
24
|
# @option options [integer] :num_trigger_ids
|
23
|
-
# Number of trigger IDs to fetch for each workflow; default is
|
25
|
+
# Number of trigger IDs to fetch for each workflow; default is 10.
|
24
26
|
# @option options [string] :query
|
25
27
|
# A search query to filter for workflow name or description.
|
26
28
|
# @option options [enum] :sort
|
@@ -29,6 +31,8 @@ module Slack
|
|
29
31
|
# Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).
|
30
32
|
# @option options [enum] :source
|
31
33
|
# Source of workflow creation, either from code or workflow builder.
|
34
|
+
# @option options [string] :trigger_type_id
|
35
|
+
# Only include workflows with this trigger type.
|
32
36
|
# @see https://api.slack.com/methods/admin.workflows.search
|
33
37
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.workflows/admin.workflows.search.json
|
34
38
|
def admin_workflows_search(options = {})
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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,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
|
@@ -12,7 +12,7 @@ module Slack
|
|
12
12
|
# @option options [string] :text
|
13
13
|
# The content of the reminder.
|
14
14
|
# @option options [string] :time
|
15
|
-
# When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").
|
15
|
+
# Can also take a type of integer. When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").
|
16
16
|
# @option options [object] :recurrence
|
17
17
|
# Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.
|
18
18
|
# @option options [string] :team_id
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module TeamExternalteams
|
9
|
+
#
|
10
|
+
# Disconnect an external organization.
|
11
|
+
#
|
12
|
+
# @option options [Object] :target_team
|
13
|
+
# The team ID of the target team.
|
14
|
+
# @see https://api.slack.com/methods/team.externalTeams.disconnect
|
15
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.externalTeams/team.externalTeams.disconnect.json
|
16
|
+
def team_externalTeams_disconnect(options = {})
|
17
|
+
raise ArgumentError, 'Required arguments :target_team missing' if options[:target_team].nil?
|
18
|
+
post('team.externalTeams.disconnect', options)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Returns a list of all the external teams connected and details about the connection.
|
23
|
+
#
|
24
|
+
# @option options [enum] :connection_status_filter
|
25
|
+
# Status of the connected team.
|
26
|
+
# @option options [string] :cursor
|
27
|
+
# Paginate through collections of data by setting parameter to the team_id attribute returned by a previous request's response_metadata. If not provided, the first page of the collection is returned. See pagination for more detail.
|
28
|
+
# @option options [integer] :limit
|
29
|
+
# The maximum number of items to return per page.
|
30
|
+
# @option options [array] :slack_connect_pref_filter
|
31
|
+
# Filters connected orgs by Slack Connect pref override(s). Value can be: approved_orgs_only allow_sc_file_uploads profile_visibility away_team_sc_invite_permissions accept_sc_invites sc_mpdm_to_private require_sc_channel_for_sc_dm external_awareness_context_bar.
|
32
|
+
# @option options [enum] :sort_direction
|
33
|
+
# Direction to sort in asc or desc.
|
34
|
+
# @option options [enum] :sort_field
|
35
|
+
# Name of the parameter that we are sorting by.
|
36
|
+
# @option options [array] :workspace_filter
|
37
|
+
# Shows connected orgs which are connected on a specified encoded workspace ID.
|
38
|
+
# @see https://api.slack.com/methods/team.externalTeams.list
|
39
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.externalTeams/team.externalTeams.list.json
|
40
|
+
def team_externalTeams_list(options = {})
|
41
|
+
if block_given?
|
42
|
+
Pagination::Cursor.new(self, :team_externalTeams_list, options).each do |page|
|
43
|
+
yield page
|
44
|
+
end
|
45
|
+
else
|
46
|
+
post('team.externalTeams.list', options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|