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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +22 -12
  3. data/.github/workflows/update_api.yml +1 -1
  4. data/.gitignore +1 -0
  5. data/CHANGELOG.md +7 -0
  6. data/README.md +26 -1
  7. data/bin/commands/admin_emoji.rb +1 -1
  8. data/bin/commands/admin_users.rb +4 -4
  9. data/bin/commands/admin_workflows.rb +4 -2
  10. data/bin/commands/admin_workflows_triggers_types_permissions.rb +31 -0
  11. data/bin/commands/apps_datastore.rb +46 -0
  12. data/bin/commands/canvases.rb +40 -0
  13. data/bin/commands/canvases_access.rb +34 -0
  14. data/bin/commands/canvases_sections.rb +21 -0
  15. data/bin/commands/conversations.rb +1 -1
  16. data/bin/commands/conversations_canvases.rb +21 -0
  17. data/bin/commands/conversations_externalInvitePermissions.rb +22 -0
  18. data/bin/commands/functions_distributions_permissions.rb +59 -0
  19. data/bin/commands/oauth.rb +2 -2
  20. data/bin/commands/oauth_v2.rb +2 -2
  21. data/bin/commands/reminders.rb +1 -1
  22. data/bin/commands/team_externalTeams.rb +35 -0
  23. data/bin/commands/users_discoverableContacts.rb +20 -0
  24. data/bin/commands/workflows_triggers_permissions.rb +60 -0
  25. data/lib/slack/messages/formatting.rb +13 -0
  26. data/lib/slack/version.rb +1 -1
  27. data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
  28. data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
  29. data/lib/slack/web/api/endpoints/admin_workflows.rb +6 -2
  30. data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +41 -0
  31. data/lib/slack/web/api/endpoints/apps_datastore.rb +71 -0
  32. data/lib/slack/web/api/endpoints/canvases.rb +52 -0
  33. data/lib/slack/web/api/endpoints/canvases_access.rb +47 -0
  34. data/lib/slack/web/api/endpoints/canvases_sections.rb +27 -0
  35. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  36. data/lib/slack/web/api/endpoints/conversations_canvases.rb +26 -0
  37. data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +31 -0
  38. data/lib/slack/web/api/endpoints/dnd.rb +1 -0
  39. data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +80 -0
  40. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  41. data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
  42. data/lib/slack/web/api/endpoints/reminders.rb +1 -1
  43. data/lib/slack/web/api/endpoints/team_externalTeams.rb +53 -0
  44. data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +24 -0
  45. data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +87 -0
  46. data/lib/slack/web/api/endpoints.rb +20 -0
  47. data/lib/slack/web/api/errors.rb +70 -4
  48. data/lib/slack/web/api/templates/method.erb +1 -0
  49. data/lib/slack/web/api/templates/method_spec.erb +2 -1
  50. data/spec/slack/messages/formatting_spec.rb +32 -0
  51. data/spec/slack/web/api/endpoints/admin_workflows_triggers_types_permissions_spec.rb +21 -0
  52. data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +29 -0
  53. data/spec/slack/web/api/endpoints/canvases_access_spec.rb +21 -0
  54. data/spec/slack/web/api/endpoints/canvases_sections_spec.rb +16 -0
  55. data/spec/slack/web/api/endpoints/canvases_spec.rb +21 -0
  56. data/spec/slack/web/api/endpoints/conversations_canvases_spec.rb +13 -0
  57. data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +19 -0
  58. data/spec/slack/web/api/endpoints/dnd_spec.rb +5 -0
  59. data/spec/slack/web/api/endpoints/functions_distributions_permissions_spec.rb +10 -0
  60. data/spec/slack/web/api/endpoints/team_externalTeams_spec.rb +13 -0
  61. data/spec/slack/web/api/endpoints/users_discoverableContacts_spec.rb +13 -0
  62. data/spec/slack/web/api/endpoints/workflows_triggers_permissions_spec.rb +31 -0
  63. metadata +32 -2
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module UsersDiscoverablecontacts
9
+ #
10
+ # Look up an email address to see if someone is discoverable on Slack
11
+ #
12
+ # @option options [string] :email
13
+ # .
14
+ # @see https://api.slack.com/methods/users.discoverableContacts.lookup
15
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users.discoverableContacts/users.discoverableContacts.lookup.json
16
+ def users_discoverableContacts_lookup(options = {})
17
+ raise ArgumentError, 'Required arguments :email missing' if options[:email].nil?
18
+ post('users.discoverableContacts.lookup', options)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,87 @@
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 WorkflowsTriggersPermissions
9
+ #
10
+ # Allows users to run a trigger that has its permission type set to named_entities
11
+ #
12
+ # @option options [string] :trigger_id
13
+ # Encoded ID of the trigger.
14
+ # @option options [array] :channel_ids
15
+ # List of encoded channel IDs.
16
+ # @option options [array] :org_ids
17
+ # List of encoded organization IDs.
18
+ # @option options [array] :team_ids
19
+ # List of encoded workspace IDs.
20
+ # @option options [array] :user_ids
21
+ # List of encoded user IDs.
22
+ # @see https://api.slack.com/methods/workflows.triggers.permissions.add
23
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows.triggers.permissions/workflows.triggers.permissions.add.json
24
+ def workflows_triggers_permissions_add(options = {})
25
+ raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
26
+ post('workflows.triggers.permissions.add', options)
27
+ end
28
+
29
+ #
30
+ # Returns the permission type of a trigger and if applicable, includes the entities that have been granted access
31
+ #
32
+ # @option options [string] :trigger_id
33
+ # Encoded ID of the trigger.
34
+ # @see https://api.slack.com/methods/workflows.triggers.permissions.list
35
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows.triggers.permissions/workflows.triggers.permissions.list.json
36
+ def workflows_triggers_permissions_list(options = {})
37
+ raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
38
+ post('workflows.triggers.permissions.list', options)
39
+ end
40
+
41
+ #
42
+ # Revoke an entity's access to a trigger that has its permission type set to named_entities
43
+ #
44
+ # @option options [string] :trigger_id
45
+ # Encoded ID of the trigger.
46
+ # @option options [array] :channel_ids
47
+ # List of encoded channel IDs.
48
+ # @option options [array] :org_ids
49
+ # List of encoded organization IDs.
50
+ # @option options [array] :team_ids
51
+ # List of encoded workspace IDs.
52
+ # @option options [array] :user_ids
53
+ # List of encoded user IDs.
54
+ # @see https://api.slack.com/methods/workflows.triggers.permissions.remove
55
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows.triggers.permissions/workflows.triggers.permissions.remove.json
56
+ def workflows_triggers_permissions_remove(options = {})
57
+ raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
58
+ post('workflows.triggers.permissions.remove', options)
59
+ end
60
+
61
+ #
62
+ # Set the permission type for who can run a trigger
63
+ #
64
+ # @option options [enum] :permission_type
65
+ # The type of permission that defines who can run a trigger.
66
+ # @option options [string] :trigger_id
67
+ # Encoded ID of the trigger.
68
+ # @option options [array] :channel_ids
69
+ # List of encoded channel IDs.
70
+ # @option options [array] :org_ids
71
+ # List of encoded organization IDs.
72
+ # @option options [array] :team_ids
73
+ # List of encoded workspace IDs.
74
+ # @option options [array] :user_ids
75
+ # List of encoded user IDs.
76
+ # @see https://api.slack.com/methods/workflows.triggers.permissions.set
77
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows.triggers.permissions/workflows.triggers.permissions.set.json
78
+ def workflows_triggers_permissions_set(options = {})
79
+ raise ArgumentError, 'Required arguments :permission_type missing' if options[:permission_type].nil?
80
+ raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
81
+ post('workflows.triggers.permissions.set', options)
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -32,6 +32,7 @@ require_relative 'endpoints/admin_users_unsupportedVersions'
32
32
  require_relative 'endpoints/admin_workflows'
33
33
  require_relative 'endpoints/admin_workflows_collaborators'
34
34
  require_relative 'endpoints/admin_workflows_permissions'
35
+ require_relative 'endpoints/admin_workflows_triggers_types_permissions'
35
36
  require_relative 'endpoints/api'
36
37
  require_relative 'endpoints/apps'
37
38
  require_relative 'endpoints/apps_activities'
@@ -46,9 +47,14 @@ require_relative 'endpoints/bookmarks'
46
47
  require_relative 'endpoints/bots'
47
48
  require_relative 'endpoints/calls'
48
49
  require_relative 'endpoints/calls_participants'
50
+ require_relative 'endpoints/canvases'
51
+ require_relative 'endpoints/canvases_access'
52
+ require_relative 'endpoints/canvases_sections'
49
53
  require_relative 'endpoints/chat'
50
54
  require_relative 'endpoints/chat_scheduledMessages'
51
55
  require_relative 'endpoints/conversations'
56
+ require_relative 'endpoints/conversations_canvases'
57
+ require_relative 'endpoints/conversations_externalInvitePermissions'
52
58
  require_relative 'endpoints/dialog'
53
59
  require_relative 'endpoints/dnd'
54
60
  require_relative 'endpoints/emoji'
@@ -56,6 +62,7 @@ require_relative 'endpoints/files'
56
62
  require_relative 'endpoints/files_comments'
57
63
  require_relative 'endpoints/files_remote'
58
64
  require_relative 'endpoints/functions'
65
+ require_relative 'endpoints/functions_distributions_permissions'
59
66
  require_relative 'endpoints/functions_workflows_steps'
60
67
  require_relative 'endpoints/functions_workflows_steps_responses'
61
68
  require_relative 'endpoints/migration'
@@ -70,6 +77,7 @@ require_relative 'endpoints/search'
70
77
  require_relative 'endpoints/stars'
71
78
  require_relative 'endpoints/team'
72
79
  require_relative 'endpoints/team_billing'
80
+ require_relative 'endpoints/team_externalTeams'
73
81
  require_relative 'endpoints/team_preferences'
74
82
  require_relative 'endpoints/team_profile'
75
83
  require_relative 'endpoints/tooling_tokens'
@@ -77,10 +85,12 @@ require_relative 'endpoints/usergroups'
77
85
  require_relative 'endpoints/usergroups_users'
78
86
  require_relative 'endpoints/users'
79
87
  require_relative 'endpoints/users_admin'
88
+ require_relative 'endpoints/users_discoverableContacts'
80
89
  require_relative 'endpoints/users_prefs'
81
90
  require_relative 'endpoints/users_profile'
82
91
  require_relative 'endpoints/views'
83
92
  require_relative 'endpoints/workflows'
93
+ require_relative 'endpoints/workflows_triggers_permissions'
84
94
 
85
95
  module Slack
86
96
  module Web
@@ -120,6 +130,7 @@ module Slack
120
130
  include AdminWorkflows
121
131
  include AdminWorkflowsCollaborators
122
132
  include AdminWorkflowsPermissions
133
+ include AdminWorkflowsTriggersTypesPermissions
123
134
  include Api
124
135
  include Apps
125
136
  include AppsActivities
@@ -134,9 +145,14 @@ module Slack
134
145
  include Bots
135
146
  include Calls
136
147
  include CallsParticipants
148
+ include Canvases
149
+ include CanvasesAccess
150
+ include CanvasesSections
137
151
  include Chat
138
152
  include ChatScheduledmessages
139
153
  include Conversations
154
+ include ConversationsCanvases
155
+ include ConversationsExternalinvitepermissions
140
156
  include Dialog
141
157
  include Dnd
142
158
  include Emoji
@@ -144,6 +160,7 @@ module Slack
144
160
  include FilesComments
145
161
  include FilesRemote
146
162
  include Functions
163
+ include FunctionsDistributionsPermissions
147
164
  include FunctionsWorkflowsSteps
148
165
  include FunctionsWorkflowsStepsResponses
149
166
  include Migration
@@ -158,6 +175,7 @@ module Slack
158
175
  include Stars
159
176
  include Team
160
177
  include TeamBilling
178
+ include TeamExternalteams
161
179
  include TeamPreferences
162
180
  include TeamProfile
163
181
  include ToolingTokens
@@ -165,10 +183,12 @@ module Slack
165
183
  include UsergroupsUsers
166
184
  include Users
167
185
  include UsersAdmin
186
+ include UsersDiscoverablecontacts
168
187
  include UsersPrefs
169
188
  include UsersProfile
170
189
  include Views
171
190
  include Workflows
191
+ include WorkflowsTriggersPermissions
172
192
  end
173
193
  end
174
194
  end
@@ -68,6 +68,7 @@ module Slack
68
68
  class CannotCompleteRecurring < SlackError; end
69
69
  class CannotCreateChannel < SlackError; end
70
70
  class CannotCreateDialog < SlackError; end
71
+ class CannotFetchVersions < SlackError; end
71
72
  class CannotFindChannel < SlackError; end
72
73
  class CannotFindMessage < SlackError; end
73
74
  class CannotFindService < SlackError; end
@@ -102,11 +103,18 @@ module Slack
102
103
  class CantKickSelf < SlackError; end
103
104
  class CantLeaveGeneral < SlackError; end
104
105
  class CantUpdateMessage < SlackError; end
106
+ class CanvasCreationFailed < SlackError; end
107
+ class CanvasDeleted < SlackError; end
108
+ class CanvasDeletingDisabled < SlackError; end
105
109
  class CanvasDisabledFileTeam < SlackError; end
106
110
  class CanvasDisabledUserTeam < SlackError; end
111
+ class CanvasEditingFailed < SlackError; end
107
112
  class CanvasGloballyDisabled < SlackError; end
113
+ class CanvasNotFound < SlackError; end
108
114
  class ChannelArchived < SlackError; end
109
115
  class ChannelCannotBeUnshared < SlackError; end
116
+ class ChannelCanvasAlreadyExists < SlackError; end
117
+ class ChannelCanvasCreationFailed < SlackError; end
110
118
  class ChannelCanvasDeleted < SlackError; end
111
119
  class ChannelConversionInProgress < SlackError; end
112
120
  class ChannelIsNotPrivate < SlackError; end
@@ -117,7 +125,10 @@ module Slack
117
125
  class ChannelTypeNotSupported < SlackError; end
118
126
  class ClientIdTokenMismatch < SlackError; end
119
127
  class CodeAlreadyUsed < SlackError; end
128
+ class ConnectedOrgDenied < SlackError; end
129
+ class ConnectedTeamDenied < SlackError; end
120
130
  class ConnectedTeamPassedInIsNotTopLevelTeam < SlackError; end
131
+ class ConnectedUserDenied < SlackError; end
121
132
  class ConnectionLimitExceeded < SlackError; end
122
133
  class ConnectionLimitExceededPending < SlackError; end
123
134
  class CouldNotArchiveChannel < SlackError; end
@@ -180,10 +191,12 @@ module Slack
180
191
  class ExternalChannelMigrating < SlackError; end
181
192
  class ExternalLimitedRestriction < SlackError; end
182
193
  class ExternalTeamNotConnectedToThisOrg < SlackError; end
194
+ class ExternalWorkspaceDenied < SlackError; end
183
195
  class ExternallySharedOrDisconnectedChannel < SlackError; end
184
196
  class FailToGetTeamsForRestrictedUser < SlackError; end
185
197
  class FailedAddingCollaborator < SlackError; end
186
198
  class FailedCreatingApp < SlackError; end
199
+ class FailedDatastoreOperation < SlackError; end
187
200
  class FailedExport < SlackError; end
188
201
  class FailedForSomeEntities < SlackError; end
189
202
  class FailedForSomeUsers < SlackError; end
@@ -233,6 +246,8 @@ module Slack
233
246
  class ForbiddenHandle < SlackError; end
234
247
  class ForbiddenTeam < SlackError; end
235
248
  class FreeTeamNotAllowed < SlackError; end
249
+ class FreeTeamsCannotCreateStandaloneCanvases < SlackError; end
250
+ class FreeTeamsCannotEditStandaloneCanvases < SlackError; end
236
251
  class FunctionExecutionNotFound < SlackError; end
237
252
  class FunctionNotFound < SlackError; end
238
253
  class GroupAlreadyLinkedToChannel < SlackError; end
@@ -299,9 +314,12 @@ module Slack
299
314
  class InvalidNamePunctuation < SlackError; end
300
315
  class InvalidNameRequired < SlackError; end
301
316
  class InvalidNameSpecials < SlackError; end
317
+ class InvalidNamedEntities < SlackError; end
302
318
  class InvalidOutputs < SlackError; end
319
+ class InvalidParameters < SlackError; end
303
320
  class InvalidParentType < SlackError; end
304
321
  class InvalidPayload < SlackError; end
322
+ class InvalidPermissionType < SlackError; end
305
323
  class InvalidPermissions < SlackError; end
306
324
  class InvalidPostType < SlackError; end
307
325
  class InvalidPresence < SlackError; end
@@ -346,7 +364,9 @@ module Slack
346
364
  class InvalidUserId < SlackError; end
347
365
  class InvalidUsers < SlackError; end
348
366
  class InvalidValue < SlackError; end
367
+ class InvalidVisibility < SlackError; end
349
368
  class InvalidWorkflowAuthStrategy < SlackError; end
369
+ class InvalidWorkspaceFilter < SlackError; end
350
370
  class InviteFromSameOrg < SlackError; end
351
371
  class InviteLookupError < SlackError; end
352
372
  class InviteNotFound < SlackError; end
@@ -403,6 +423,7 @@ module Slack
403
423
  class MissingUnfurlId < SlackError; end
404
424
  class MissingUnfurls < SlackError; end
405
425
  class MissingUser < SlackError; end
426
+ class MsgBlocksTooLong < SlackError; end
406
427
  class MsgTooLong < SlackError; end
407
428
  class MustClearBothStatusTextAndStatusEmoji < SlackError; end
408
429
  class MustProvideTeamDomain < SlackError; end
@@ -413,6 +434,7 @@ module Slack
413
434
  class NameTaken < SlackError; end
414
435
  class NameTakenInOrg < SlackError; end
415
436
  class NameTooLong < SlackError; end
437
+ class NamedEntitiesCannotBeEmpty < SlackError; end
416
438
  class NoActiveSessions < SlackError; end
417
439
  class NoAliasSelected < SlackError; end
418
440
  class NoBotUserForApp < SlackError; end
@@ -420,6 +442,7 @@ module Slack
420
442
  class NoChannelMemberships < SlackError; end
421
443
  class NoDomainsProvided < SlackError; end
422
444
  class NoDualBroadcastContentUpdate < SlackError; end
445
+ class NoExternalInvitePermission < SlackError; end
423
446
  class NoImageUploaded < SlackError; end
424
447
  class NoItemSpecified < SlackError; end
425
448
  class NoLocalUserOnTeam < SlackError; end
@@ -438,6 +461,7 @@ module Slack
438
461
  class NoUsersProvided < SlackError; end
439
462
  class NoValidChannels < SlackError; end
440
463
  class NoValidEntities < SlackError; end
464
+ class NoValidNamedEntities < SlackError; end
441
465
  class NoValidTeams < SlackError; end
442
466
  class NoValidUsers < SlackError; end
443
467
  class NotAdmin < SlackError; end
@@ -470,6 +494,7 @@ module Slack
470
494
  class OneOrMoreInvalidChannels < SlackError; end
471
495
  class OrgLevelEmailDisplayDisabled < SlackError; end
472
496
  class OrgLoginRequired < SlackError; end
497
+ class OrgNotConnected < SlackError; end
473
498
  class OrgNotFound < SlackError; end
474
499
  class OrgResolutionRequired < SlackError; end
475
500
  class OrgUserNotInTeam < SlackError; end
@@ -481,8 +506,10 @@ module Slack
481
506
  class ParameterValidationFailed < SlackError; end
482
507
  class ParentBookmarkDisabled < SlackError; end
483
508
  class ParentWithLink < SlackError; end
509
+ class PartialFailure < SlackError; end
484
510
  class PartialProfileSetFailed < SlackError; end
485
511
  class PermissionDenied < SlackError; end
512
+ class PermissionTypeRequired < SlackError; end
486
513
  class PlanUpgradeRequired < SlackError; end
487
514
  class PolicyNotFound < SlackError; end
488
515
  class PostContentsTooLarge < SlackError; end
@@ -518,11 +545,13 @@ module Slack
518
545
  class SessionInvalidationFailed < SlackError; end
519
546
  class SessionNotFound < SlackError; end
520
547
  class SessionResetNotAllowed < SlackError; end
548
+ class SharedChannelDenied < SlackError; end
521
549
  class SlackConnectBlockedFileType < SlackError; end
522
550
  class SlackConnectCanvasSharingBlocked < SlackError; end
523
551
  class SlackConnectClipSharingBlocked < SlackError; end
524
552
  class SlackConnectFileLinkSharingBlocked < SlackError; end
525
553
  class SlackConnectFileUploadSharingBlocked < SlackError; end
554
+ class SlackConnectListsSharingBlocked < SlackError; end
526
555
  class SnippetTooLarge < SlackError; end
527
556
  class SnoozeEndFailed < SlackError; end
528
557
  class SnoozeFailed < SlackError; end
@@ -537,6 +566,7 @@ module Slack
537
566
  class TeamAddedToOrg < SlackError; end
538
567
  class TeamIdOrOrgRequired < SlackError; end
539
568
  class TeamIdRequiredForEnterprise < SlackError; end
569
+ class TeamNotConnected < SlackError; end
540
570
  class TeamNotFound < SlackError; end
541
571
  class TeamNotOnEnterprise < SlackError; end
542
572
  class TeamQuotaExceeded < SlackError; end
@@ -556,8 +586,6 @@ module Slack
556
586
  class TooManyAttachments < SlackError; end
557
587
  class TooManyBookmarks < SlackError; end
558
588
  class TooManyContactCards < SlackError; end
559
- class TooManyConvosForAppOnTeam < SlackError; end
560
- class TooManyConvosForTeam < SlackError; end
561
589
  class TooManyDomainsProvided < SlackError; end
562
590
  class TooManyEmails < SlackError; end
563
591
  class TooManyEmoji < SlackError; end
@@ -567,6 +595,7 @@ module Slack
567
595
  class TooManyIdsProvided < SlackError; end
568
596
  class TooManyLinkedChannels < SlackError; end
569
597
  class TooManyMembers < SlackError; end
598
+ class TooManyNamedEntities < SlackError; end
570
599
  class TooManyPins < SlackError; end
571
600
  class TooManyReactions < SlackError; end
572
601
  class TooManyTargetTeams < SlackError; end
@@ -575,6 +604,8 @@ module Slack
575
604
  class TooManyUsers < SlackError; end
576
605
  class TriggerExchanged < SlackError; end
577
606
  class TriggerExpired < SlackError; end
607
+ class TriggerNotFound < SlackError; end
608
+ class TriggerTypeIdNotFound < SlackError; end
578
609
  class TwoFactorSetupRequired < SlackError; end
579
610
  class UnableToDelete < SlackError; end
580
611
  class UnableToFetchCustomEmojis < SlackError; end
@@ -603,6 +634,7 @@ module Slack
603
634
  class UserAlreadyDeleted < SlackError; end
604
635
  class UserAlreadyTeamMember < SlackError; end
605
636
  class UserCannotCreateChannel < SlackError; end
637
+ class UserCannotManageWorkspace < SlackError; end
606
638
  class UserDisabled < SlackError; end
607
639
  class UserDoesNotOwnChannel < SlackError; end
608
640
  class UserIsAlreadyDeleted < SlackError; end
@@ -624,6 +656,7 @@ module Slack
624
656
  class UsersNotFound < SlackError; end
625
657
  class ValidationErrors < SlackError; end
626
658
  class ViewTooLarge < SlackError; end
659
+ class VisibilityIsNotNamedEntities < SlackError; end
627
660
  class WorkflowsExportCsvNotEnabled < SlackError; end
628
661
 
629
662
  ERROR_CLASSES = {
@@ -690,6 +723,7 @@ module Slack
690
723
  'cannot_complete_recurring' => CannotCompleteRecurring,
691
724
  'cannot_create_channel' => CannotCreateChannel,
692
725
  'cannot_create_dialog' => CannotCreateDialog,
726
+ 'cannot_fetch_versions' => CannotFetchVersions,
693
727
  'cannot_find_channel' => CannotFindChannel,
694
728
  'cannot_find_message' => CannotFindMessage,
695
729
  'cannot_find_service' => CannotFindService,
@@ -724,11 +758,18 @@ module Slack
724
758
  'cant_kick_self' => CantKickSelf,
725
759
  'cant_leave_general' => CantLeaveGeneral,
726
760
  'cant_update_message' => CantUpdateMessage,
761
+ 'canvas_creation_failed' => CanvasCreationFailed,
762
+ 'canvas_deleted' => CanvasDeleted,
763
+ 'canvas_deleting_disabled' => CanvasDeletingDisabled,
727
764
  'canvas_disabled_file_team' => CanvasDisabledFileTeam,
728
765
  'canvas_disabled_user_team' => CanvasDisabledUserTeam,
766
+ 'canvas_editing_failed' => CanvasEditingFailed,
729
767
  'canvas_globally_disabled' => CanvasGloballyDisabled,
768
+ 'canvas_not_found' => CanvasNotFound,
730
769
  'channel_archived' => ChannelArchived,
731
770
  'channel_cannot_be_unshared' => ChannelCannotBeUnshared,
771
+ 'channel_canvas_already_exists' => ChannelCanvasAlreadyExists,
772
+ 'channel_canvas_creation_failed' => ChannelCanvasCreationFailed,
732
773
  'channel_canvas_deleted' => ChannelCanvasDeleted,
733
774
  'channel_conversion_in_progress' => ChannelConversionInProgress,
734
775
  'channel_is_not_private' => ChannelIsNotPrivate,
@@ -739,7 +780,10 @@ module Slack
739
780
  'channel_type_not_supported' => ChannelTypeNotSupported,
740
781
  'client_id_token_mismatch' => ClientIdTokenMismatch,
741
782
  'code_already_used' => CodeAlreadyUsed,
783
+ 'connected_org_denied' => ConnectedOrgDenied,
784
+ 'connected_team_denied' => ConnectedTeamDenied,
742
785
  'connected_team_passed_in_is_not_top_level_team' => ConnectedTeamPassedInIsNotTopLevelTeam,
786
+ 'connected_user_denied' => ConnectedUserDenied,
743
787
  'connection_limit_exceeded' => ConnectionLimitExceeded,
744
788
  'connection_limit_exceeded_pending' => ConnectionLimitExceededPending,
745
789
  'could_not_archive_channel' => CouldNotArchiveChannel,
@@ -802,10 +846,12 @@ module Slack
802
846
  'external_channel_migrating' => ExternalChannelMigrating,
803
847
  'external_limited_restriction' => ExternalLimitedRestriction,
804
848
  'external_team_not_connected_to_this_org' => ExternalTeamNotConnectedToThisOrg,
849
+ 'external_workspace_denied' => ExternalWorkspaceDenied,
805
850
  'externally_shared_or_disconnected_channel' => ExternallySharedOrDisconnectedChannel,
806
851
  'fail_to_get_teams_for_restricted_user' => FailToGetTeamsForRestrictedUser,
807
852
  'failed_adding_collaborator' => FailedAddingCollaborator,
808
853
  'failed_creating_app' => FailedCreatingApp,
854
+ 'failed_datastore_operation' => FailedDatastoreOperation,
809
855
  'failed_export' => FailedExport,
810
856
  'failed_for_some_entities' => FailedForSomeEntities,
811
857
  'failed_for_some_users' => FailedForSomeUsers,
@@ -855,6 +901,8 @@ module Slack
855
901
  'forbidden_handle' => ForbiddenHandle,
856
902
  'forbidden_team' => ForbiddenTeam,
857
903
  'free_team_not_allowed' => FreeTeamNotAllowed,
904
+ 'free_teams_cannot_create_standalone_canvases' => FreeTeamsCannotCreateStandaloneCanvases,
905
+ 'free_teams_cannot_edit_standalone_canvases' => FreeTeamsCannotEditStandaloneCanvases,
858
906
  'function_execution_not_found' => FunctionExecutionNotFound,
859
907
  'function_not_found' => FunctionNotFound,
860
908
  'group_already_linked_to_channel' => GroupAlreadyLinkedToChannel,
@@ -921,9 +969,12 @@ module Slack
921
969
  'invalid_name_punctuation' => InvalidNamePunctuation,
922
970
  'invalid_name_required' => InvalidNameRequired,
923
971
  'invalid_name_specials' => InvalidNameSpecials,
972
+ 'invalid_named_entities' => InvalidNamedEntities,
924
973
  'invalid_outputs' => InvalidOutputs,
974
+ 'invalid_parameters' => InvalidParameters,
925
975
  'invalid_parent_type' => InvalidParentType,
926
976
  'invalid_payload' => InvalidPayload,
977
+ 'invalid_permission_type' => InvalidPermissionType,
927
978
  'invalid_permissions' => InvalidPermissions,
928
979
  'invalid_post_type' => InvalidPostType,
929
980
  'invalid_presence' => InvalidPresence,
@@ -968,7 +1019,9 @@ module Slack
968
1019
  'invalid_user_id' => InvalidUserId,
969
1020
  'invalid_users' => InvalidUsers,
970
1021
  'invalid_value' => InvalidValue,
1022
+ 'invalid_visibility' => InvalidVisibility,
971
1023
  'invalid_workflow_auth_strategy' => InvalidWorkflowAuthStrategy,
1024
+ 'invalid_workspace_filter' => InvalidWorkspaceFilter,
972
1025
  'invite_from_same_org' => InviteFromSameOrg,
973
1026
  'invite_lookup_error' => InviteLookupError,
974
1027
  'invite_not_found' => InviteNotFound,
@@ -1025,6 +1078,7 @@ module Slack
1025
1078
  'missing_unfurl_id' => MissingUnfurlId,
1026
1079
  'missing_unfurls' => MissingUnfurls,
1027
1080
  'missing_user' => MissingUser,
1081
+ 'msg_blocks_too_long' => MsgBlocksTooLong,
1028
1082
  'msg_too_long' => MsgTooLong,
1029
1083
  'must_clear_both_status_text_and_status_emoji' => MustClearBothStatusTextAndStatusEmoji,
1030
1084
  'must_provide_team_domain' => MustProvideTeamDomain,
@@ -1035,6 +1089,7 @@ module Slack
1035
1089
  'name_taken' => NameTaken,
1036
1090
  'name_taken_in_org' => NameTakenInOrg,
1037
1091
  'name_too_long' => NameTooLong,
1092
+ 'named_entities_cannot_be_empty' => NamedEntitiesCannotBeEmpty,
1038
1093
  'no_active_sessions' => NoActiveSessions,
1039
1094
  'no_alias_selected' => NoAliasSelected,
1040
1095
  'no_bot_user_for_app' => NoBotUserForApp,
@@ -1042,6 +1097,7 @@ module Slack
1042
1097
  'no_channel_memberships' => NoChannelMemberships,
1043
1098
  'no_domains_provided' => NoDomainsProvided,
1044
1099
  'no_dual_broadcast_content_update' => NoDualBroadcastContentUpdate,
1100
+ 'no_external_invite_permission' => NoExternalInvitePermission,
1045
1101
  'no_image_uploaded' => NoImageUploaded,
1046
1102
  'no_item_specified' => NoItemSpecified,
1047
1103
  'no_local_user_on_team' => NoLocalUserOnTeam,
@@ -1060,6 +1116,7 @@ module Slack
1060
1116
  'no_users_provided' => NoUsersProvided,
1061
1117
  'no_valid_channels' => NoValidChannels,
1062
1118
  'no_valid_entities' => NoValidEntities,
1119
+ 'no_valid_named_entities' => NoValidNamedEntities,
1063
1120
  'no_valid_teams' => NoValidTeams,
1064
1121
  'no_valid_users' => NoValidUsers,
1065
1122
  'not_admin' => NotAdmin,
@@ -1092,6 +1149,7 @@ module Slack
1092
1149
  'one_or_more_invalid_channels' => OneOrMoreInvalidChannels,
1093
1150
  'org_level_email_display_disabled' => OrgLevelEmailDisplayDisabled,
1094
1151
  'org_login_required' => OrgLoginRequired,
1152
+ 'org_not_connected' => OrgNotConnected,
1095
1153
  'org_not_found' => OrgNotFound,
1096
1154
  'org_resolution_required' => OrgResolutionRequired,
1097
1155
  'org_user_not_in_team' => OrgUserNotInTeam,
@@ -1103,8 +1161,10 @@ module Slack
1103
1161
  'parameter_validation_failed' => ParameterValidationFailed,
1104
1162
  'parent_bookmark_disabled' => ParentBookmarkDisabled,
1105
1163
  'parent_with_link' => ParentWithLink,
1164
+ 'partial_failure' => PartialFailure,
1106
1165
  'partial_profile_set_failed' => PartialProfileSetFailed,
1107
1166
  'permission_denied' => PermissionDenied,
1167
+ 'permission_type_required' => PermissionTypeRequired,
1108
1168
  'plan_upgrade_required' => PlanUpgradeRequired,
1109
1169
  'policy_not_found' => PolicyNotFound,
1110
1170
  'post_contents_too_large' => PostContentsTooLarge,
@@ -1140,11 +1200,13 @@ module Slack
1140
1200
  'session_invalidation_failed' => SessionInvalidationFailed,
1141
1201
  'session_not_found' => SessionNotFound,
1142
1202
  'session_reset_not_allowed' => SessionResetNotAllowed,
1203
+ 'shared_channel_denied' => SharedChannelDenied,
1143
1204
  'slack_connect_blocked_file_type' => SlackConnectBlockedFileType,
1144
1205
  'slack_connect_canvas_sharing_blocked' => SlackConnectCanvasSharingBlocked,
1145
1206
  'slack_connect_clip_sharing_blocked' => SlackConnectClipSharingBlocked,
1146
1207
  'slack_connect_file_link_sharing_blocked' => SlackConnectFileLinkSharingBlocked,
1147
1208
  'slack_connect_file_upload_sharing_blocked' => SlackConnectFileUploadSharingBlocked,
1209
+ 'slack_connect_lists_sharing_blocked' => SlackConnectListsSharingBlocked,
1148
1210
  'snippet_too_large' => SnippetTooLarge,
1149
1211
  'snooze_end_failed' => SnoozeEndFailed,
1150
1212
  'snooze_failed' => SnoozeFailed,
@@ -1159,6 +1221,7 @@ module Slack
1159
1221
  'team_added_to_org' => TeamAddedToOrg,
1160
1222
  'team_id_or_org_required' => TeamIdOrOrgRequired,
1161
1223
  'team_id_required_for_enterprise' => TeamIdRequiredForEnterprise,
1224
+ 'team_not_connected' => TeamNotConnected,
1162
1225
  'team_not_found' => TeamNotFound,
1163
1226
  'team_not_on_enterprise' => TeamNotOnEnterprise,
1164
1227
  'team_quota_exceeded' => TeamQuotaExceeded,
@@ -1178,8 +1241,6 @@ module Slack
1178
1241
  'too_many_attachments' => TooManyAttachments,
1179
1242
  'too_many_bookmarks' => TooManyBookmarks,
1180
1243
  'too_many_contact_cards' => TooManyContactCards,
1181
- 'too_many_convos_for_app_on_team' => TooManyConvosForAppOnTeam,
1182
- 'too_many_convos_for_team' => TooManyConvosForTeam,
1183
1244
  'too_many_domains_provided' => TooManyDomainsProvided,
1184
1245
  'too_many_emails' => TooManyEmails,
1185
1246
  'too_many_emoji' => TooManyEmoji,
@@ -1189,6 +1250,7 @@ module Slack
1189
1250
  'too_many_ids_provided' => TooManyIdsProvided,
1190
1251
  'too_many_linked_channels' => TooManyLinkedChannels,
1191
1252
  'too_many_members' => TooManyMembers,
1253
+ 'too_many_named_entities' => TooManyNamedEntities,
1192
1254
  'too_many_pins' => TooManyPins,
1193
1255
  'too_many_reactions' => TooManyReactions,
1194
1256
  'too_many_target_teams' => TooManyTargetTeams,
@@ -1197,6 +1259,8 @@ module Slack
1197
1259
  'too_many_users' => TooManyUsers,
1198
1260
  'trigger_exchanged' => TriggerExchanged,
1199
1261
  'trigger_expired' => TriggerExpired,
1262
+ 'trigger_not_found' => TriggerNotFound,
1263
+ 'trigger_type_id_not_found' => TriggerTypeIdNotFound,
1200
1264
  'two_factor_setup_required' => TwoFactorSetupRequired,
1201
1265
  'unable_to_delete' => UnableToDelete,
1202
1266
  'unable_to_fetch_custom_emojis' => UnableToFetchCustomEmojis,
@@ -1225,6 +1289,7 @@ module Slack
1225
1289
  'user_already_deleted' => UserAlreadyDeleted,
1226
1290
  'user_already_team_member' => UserAlreadyTeamMember,
1227
1291
  'user_cannot_create_channel' => UserCannotCreateChannel,
1292
+ 'user_cannot_manage_workspace' => UserCannotManageWorkspace,
1228
1293
  'user_disabled' => UserDisabled,
1229
1294
  'user_does_not_own_channel' => UserDoesNotOwnChannel,
1230
1295
  'user_is_already_deleted' => UserIsAlreadyDeleted,
@@ -1246,6 +1311,7 @@ module Slack
1246
1311
  'users_not_found' => UsersNotFound,
1247
1312
  'validation_errors' => ValidationErrors,
1248
1313
  'view_too_large' => ViewTooLarge,
1314
+ 'visibility_is_not_named_entities' => VisibilityIsNotNamedEntities,
1249
1315
  'workflows_export_csv_not_enabled' => WorkflowsExportCsvNotEnabled,
1250
1316
  }.freeze
1251
1317
  end
@@ -38,6 +38,7 @@ module Slack
38
38
  raise ArgumentError, 'Required arguments :<%= arg_name %> missing' if options[:<%= arg_name %>].nil?
39
39
  <% end %>
40
40
  <% data['arg_groups']&.each do |arg_group| %>
41
+ <% next if arg_group['args'].size <= 1 %>
41
42
  <% arg_string = arg_group['args'].map { |arg_name| ":#{arg_name}" }.join(', ') %>
42
43
  <% if arg_group['mutually_exclusive'] %>
43
44
  raise ArgumentError, 'Exactly one of <%= arg_string %> is required' unless <%= arg_group['args'].map { |arg_name| "options[:#{arg_name}].nil?" }.join(' ^ ') %>
@@ -7,7 +7,7 @@ RSpec.describe Slack::Web::Api::Endpoints::<%= group.gsub(".", "_").camelize %>
7
7
  let(:client) { Slack::Web::Client.new }
8
8
  <% names.sort.each_with_index do |(name, data), index| %>
9
9
  <% next if data['mixin'] %>
10
- <% group_required_params = data['arg_groups']&.map { |grp| grp['args'].first } || [] %>
10
+ <% group_required_params = data['arg_groups']&.map { |grp| grp['args'].first if grp['args'].size > 1 } || [] %>
11
11
  <% required_params = data['args'].select{ |k, v| v['required'] || group_required_params.include?(k) } %>
12
12
  <% json_params = data['args'].map { |arg_name, arg_v| arg_name if arg_v['format'] == 'json' }.compact %>
13
13
  <% next if (required_params.none? || custom_spec_exists) && json_params.none? && data['arg_groups'].nil? %>
@@ -23,6 +23,7 @@ RSpec.describe Slack::Web::Api::Endpoints::<%= group.gsub(".", "_").camelize %>
23
23
  <% end %>
24
24
  <% end %>
25
25
  <% data['arg_groups']&.each do |arg_group| %>
26
+ <% next if arg_group['args'].size <= 1 %>
26
27
  it 'requires one of <%= arg_group['args'].join(', ') %>' do
27
28
  <% params_except_required = example_params.reject { |name, _| arg_group['args'].include?(name) }.map { |name, val| "#{name}: %q[#{val}]" }.join(', ') %>
28
29
  <% error_message = arg_group['mutually_exclusive'] ? 'Exactly' : 'At least' %>
@@ -121,4 +121,36 @@ describe Slack::Messages::Formatting do
121
121
  expect(formatting.url_link(text, url)).to eq "<#{url}|#{text}>"
122
122
  end
123
123
  end
124
+
125
+ context '#markdown' do
126
+ it 'formats markdown bold' do
127
+ expect(formatting.markdown('**Le bold**')).to eq '*Le bold*'
128
+ end
129
+
130
+ it 'formats markdown italic' do
131
+ expect(formatting.markdown("*L'italic*")).to eq "_L'italic_"
132
+ end
133
+
134
+ it 'formats markdown bold and italic' do
135
+ expect(formatting.markdown('***Le bold italic***')).to eq '*_Le bold italic_*'
136
+ end
137
+
138
+ it 'formats markdown strikethrough' do
139
+ expect(formatting.markdown('~~Le strikethrough~~')).to eq '~Le strikethrough~'
140
+ end
141
+
142
+ it 'formats markdown links' do
143
+ expect(formatting.markdown('[Le link](https://theuselessweb.site)')).to eq '<https://theuselessweb.site|Le link>'
144
+ end
145
+
146
+ it 'formats nested markdown' do
147
+ expect(formatting.markdown('**[Le **bold and ~~struckout with *italic*~~** link](https://theuselessweb.site)**')).to(
148
+ eq '*<https://theuselessweb.site|Le *bold and ~struckout with _italic_~* link>*'
149
+ )
150
+ end
151
+
152
+ it "doesn't format other markdown" do
153
+ expect(formatting.markdown('## A heading\n_Italics_\n`code`')).to eq '## A heading\n_Italics_\n`code`'
154
+ end
155
+ end
124
156
  end