slack-ruby-client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +19 -0
  4. data/.github/workflows/pr_lint.yml +1 -1
  5. data/.github/workflows/test.yml +1 -0
  6. data/CHANGELOG.md +9 -0
  7. data/README.md +18 -14
  8. data/SECURITY.md +9 -0
  9. data/bin/commands/admin_analytics.rb +16 -10
  10. data/bin/commands/admin_apps.rb +48 -42
  11. data/bin/commands/admin_apps_approved.rb +17 -11
  12. data/bin/commands/admin_apps_requests.rb +27 -21
  13. data/bin/commands/admin_apps_restricted.rb +17 -11
  14. data/bin/commands/admin_audit_anomaly_allow.rb +22 -16
  15. data/bin/commands/admin_auth_policy.rb +37 -31
  16. data/bin/commands/admin_barriers.rb +44 -38
  17. data/bin/commands/admin_conversations.rb +221 -165
  18. data/bin/commands/admin_conversations_ekm.rb +17 -11
  19. data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
  20. data/bin/commands/admin_emoji.rb +50 -44
  21. data/bin/commands/admin_inviteRequests.rb +34 -28
  22. data/bin/commands/admin_inviteRequests_approved.rb +16 -10
  23. data/bin/commands/admin_inviteRequests_denied.rb +16 -10
  24. data/bin/commands/admin_roles.rb +46 -0
  25. data/bin/commands/admin_teams.rb +26 -20
  26. data/bin/commands/admin_teams_admins.rb +16 -10
  27. data/bin/commands/admin_teams_owners.rb +16 -10
  28. data/bin/commands/admin_teams_settings.rb +59 -53
  29. data/bin/commands/admin_usergroups.rb +45 -39
  30. data/bin/commands/admin_users.rb +91 -85
  31. data/bin/commands/admin_users_session.rb +72 -66
  32. data/bin/commands/admin_users_unsupportedVersions.rb +15 -9
  33. data/bin/commands/api.rb +14 -8
  34. data/bin/commands/apps.rb +15 -9
  35. data/bin/commands/apps_connections.rb +13 -7
  36. data/bin/commands/apps_event_authorizations.rb +16 -10
  37. data/bin/commands/apps_manifest.rb +48 -42
  38. data/bin/commands/auth.rb +21 -15
  39. data/bin/commands/auth_teams.rb +16 -10
  40. data/bin/commands/bookmarks.rb +50 -44
  41. data/bin/commands/bots.rb +15 -9
  42. data/bin/commands/calls.rb +49 -43
  43. data/bin/commands/calls_participants.rb +24 -18
  44. data/bin/commands/chat.rb +150 -144
  45. data/bin/commands/chat_scheduledMessages.rb +19 -13
  46. data/bin/commands/conversations.rb +233 -227
  47. data/bin/commands/dialog.rb +15 -9
  48. data/bin/commands/dnd.rb +46 -40
  49. data/bin/commands/emoji.rb +14 -7
  50. data/bin/commands/files.rb +110 -105
  51. data/bin/commands/files_comments.rb +15 -9
  52. data/bin/commands/files_remote.rb +73 -67
  53. data/bin/commands/functions_workflows_steps.rb +22 -0
  54. data/bin/commands/functions_workflows_steps_responses.rb +22 -0
  55. data/bin/commands/migration.rb +16 -10
  56. data/bin/commands/oauth.rb +18 -12
  57. data/bin/commands/oauth_v2.rb +28 -22
  58. data/bin/commands/openid_connect.rb +26 -20
  59. data/bin/commands/pins.rb +33 -26
  60. data/bin/commands/reactions.rb +52 -46
  61. data/bin/commands/reminders.rb +53 -47
  62. data/bin/commands/rtm.rb +15 -9
  63. data/bin/commands/search.rb +43 -37
  64. data/bin/commands/stars.rb +38 -32
  65. data/bin/commands/team.rb +47 -39
  66. data/bin/commands/team_billing.rb +13 -7
  67. data/bin/commands/team_preferences.rb +13 -7
  68. data/bin/commands/team_profile.rb +14 -8
  69. data/bin/commands/tooling_tokens.rb +14 -8
  70. data/bin/commands/usergroups.rb +64 -58
  71. data/bin/commands/usergroups_users.rb +27 -21
  72. data/bin/commands/users.rb +111 -105
  73. data/bin/commands/users_admin.rb +28 -22
  74. data/bin/commands/users_prefs.rb +13 -7
  75. data/bin/commands/users_profile.rb +26 -20
  76. data/bin/commands/views.rb +47 -41
  77. data/bin/commands/workflows.rb +36 -30
  78. data/bin/slack +48 -43
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
  81. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
  82. data/lib/slack/web/api/endpoints/admin_conversations.rb +78 -0
  83. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  84. data/lib/slack/web/api/endpoints/chat.rb +2 -2
  85. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  86. data/lib/slack/web/api/endpoints/emoji.rb +2 -0
  87. data/lib/slack/web/api/endpoints/files.rb +0 -2
  88. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
  89. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
  90. data/lib/slack/web/api/endpoints/pins.rb +2 -0
  91. data/lib/slack/web/api/endpoints/team.rb +11 -1
  92. data/lib/slack/web/api/endpoints/usergroups.rb +1 -1
  93. data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
  94. data/lib/slack/web/api/endpoints.rb +6 -0
  95. data/lib/slack/web/api/errors.rb +62 -0
  96. data/lib/slack/web/api/templates/command.erb +18 -12
  97. data/lib/tasks/web.rake +0 -6
  98. data/slack-ruby-client.gemspec +0 -1
  99. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
  100. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
  101. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
  102. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
  103. metadata +13 -19
  104. data/bin/commands.rb +0 -69
  105. data/lib/slack/web/api/templates/commands.erb +0 -6
@@ -1,47 +1,53 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminBarriers methods.'
5
- command 'admin_barriers' do |g|
6
- g.desc 'Create an Information Barrier'
7
- g.long_desc %( Create an Information Barrier )
8
- g.command 'create' do |c|
9
- c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.'
10
- c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.'
11
- c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.admin_barriers_create(options))
14
- end
15
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminBarriers methods.'
8
+ command 'admin_barriers' do |g|
9
+ g.desc 'Create an Information Barrier'
10
+ g.long_desc %( Create an Information Barrier )
11
+ g.command 'create' do |c|
12
+ c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.'
13
+ c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.'
14
+ c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.admin_barriers_create(options))
17
+ end
18
+ end
16
19
 
17
- g.desc 'Delete an existing Information Barrier'
18
- g.long_desc %( Delete an existing Information Barrier )
19
- g.command 'delete' do |c|
20
- c.flag 'barrier_id', desc: "The ID of the barrier you're trying to delete."
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.admin_barriers_delete(options))
23
- end
24
- end
20
+ g.desc 'Delete an existing Information Barrier'
21
+ g.long_desc %( Delete an existing Information Barrier )
22
+ g.command 'delete' do |c|
23
+ c.flag 'barrier_id', desc: "The ID of the barrier you're trying to delete."
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump(@client.admin_barriers_delete(options))
26
+ end
27
+ end
25
28
 
26
- g.desc 'Get all Information Barriers for your organization'
27
- g.long_desc %( Get all Information Barriers for your organization )
28
- g.command 'list' do |c|
29
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
30
- c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
31
- c.action do |_global_options, options, _args|
32
- puts JSON.dump($client.admin_barriers_list(options))
33
- end
34
- end
29
+ g.desc 'Get all Information Barriers for your organization'
30
+ g.long_desc %( Get all Information Barriers for your organization )
31
+ g.command 'list' do |c|
32
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
33
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
34
+ c.action do |_global_options, options, _args|
35
+ puts JSON.dump(@client.admin_barriers_list(options))
36
+ end
37
+ end
35
38
 
36
- g.desc 'Update an existing Information Barrier'
37
- g.long_desc %( Update an existing Information Barrier )
38
- g.command 'update' do |c|
39
- c.flag 'barrier_id', desc: "The ID of the barrier you're trying to modify."
40
- c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.'
41
- c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.'
42
- c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.'
43
- c.action do |_global_options, options, _args|
44
- puts JSON.dump($client.admin_barriers_update(options))
39
+ g.desc 'Update an existing Information Barrier'
40
+ g.long_desc %( Update an existing Information Barrier )
41
+ g.command 'update' do |c|
42
+ c.flag 'barrier_id', desc: "The ID of the barrier you're trying to modify."
43
+ c.flag 'barriered_from_usergroup_ids', desc: 'A list of IDP Groups ids that the primary usergroup is to be barriered from.'
44
+ c.flag 'primary_usergroup_id', desc: 'The id of the primary IDP Group.'
45
+ c.flag 'restricted_subjects', desc: 'What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.'
46
+ c.action do |_global_options, options, _args|
47
+ puts JSON.dump(@client.admin_barriers_update(options))
48
+ end
49
+ end
50
+ end
45
51
  end
46
52
  end
47
53
  end
@@ -1,171 +1,227 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminConversations methods.'
5
- command 'admin_conversations' do |g|
6
- g.desc 'Archive a public or private channel.'
7
- g.long_desc %( Archive a public or private channel. )
8
- g.command 'archive' do |c|
9
- c.flag 'channel_id', desc: 'The channel to archive.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.admin_conversations_archive(options))
12
- end
13
- end
14
-
15
- g.desc 'Convert a public channel to a private channel.'
16
- g.long_desc %( Convert a public channel to a private channel. )
17
- g.command 'convertToPrivate' do |c|
18
- c.flag 'channel_id', desc: 'The channel to convert to private.'
19
- c.flag 'name', desc: 'Name of private channel to create. Only respected when converting an MPIM.'
20
- c.action do |_global_options, options, _args|
21
- puts JSON.dump($client.admin_conversations_convertToPrivate(options))
22
- end
23
- end
24
-
25
- g.desc 'Create a public or private channel-based conversation.'
26
- g.long_desc %( Create a public or private channel-based conversation. )
27
- g.command 'create' do |c|
28
- c.flag 'is_private', desc: 'When true, creates a private channel instead of a public channel.'
29
- c.flag 'name', desc: 'Name of the public or private channel to create.'
30
- c.flag 'description', desc: 'Description of the public or private channel to create.'
31
- c.flag 'org_wide', desc: 'When true, the channel will be available org-wide. Note: if the channel is not org_wide=true, you must specify a team_id for this channel.'
32
- c.flag 'team_id', desc: 'The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.'
33
- c.action do |_global_options, options, _args|
34
- puts JSON.dump($client.admin_conversations_create(options))
35
- end
36
- end
37
-
38
- g.desc 'Delete a public or private channel.'
39
- g.long_desc %( Delete a public or private channel. )
40
- g.command 'delete' do |c|
41
- c.flag 'channel_id', desc: 'The channel to delete.'
42
- c.action do |_global_options, options, _args|
43
- puts JSON.dump($client.admin_conversations_delete(options))
44
- end
45
- end
46
-
47
- g.desc 'Disconnect a connected channel from one or more workspaces.'
48
- g.long_desc %( Disconnect a connected channel from one or more workspaces. )
49
- g.command 'disconnectShared' do |c|
50
- c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
51
- c.flag 'leaving_team_ids', desc: 'team IDs getting removed from the channel, optional if there are only two teams in the channel.'
52
- c.action do |_global_options, options, _args|
53
- puts JSON.dump($client.admin_conversations_disconnectShared(options))
54
- end
55
- end
56
-
57
- g.desc 'Get conversation preferences for a public or private channel.'
58
- g.long_desc %( Get conversation preferences for a public or private channel. )
59
- g.command 'getConversationPrefs' do |c|
60
- c.flag 'channel_id', desc: 'The channel to get preferences for.'
61
- c.action do |_global_options, options, _args|
62
- puts JSON.dump($client.admin_conversations_getConversationPrefs(options))
63
- end
64
- end
65
-
66
- g.desc "This API endpoint can be used by any admin to get a conversation's retention policy."
67
- g.long_desc %( This API endpoint can be used by any admin to get a conversation's retention policy. )
68
- g.command 'getCustomRetention' do |c|
69
- c.flag 'channel_id', desc: 'The conversation to get the retention policy for.'
70
- c.action do |_global_options, options, _args|
71
- puts JSON.dump($client.admin_conversations_getCustomRetention(options))
72
- end
73
- end
74
-
75
- g.desc 'Get all the workspaces a given public or private channel is connected to within this Enterprise org.'
76
- g.long_desc %( Get all the workspaces a given public or private channel is connected to within this Enterprise org. )
77
- g.command 'getTeams' do |c|
78
- c.flag 'channel_id', desc: 'The channel to determine connected workspaces within the organization for.'
79
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
80
- c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
81
- c.action do |_global_options, options, _args|
82
- puts JSON.dump($client.admin_conversations_getTeams(options))
83
- end
84
- end
85
-
86
- g.desc 'Invite a user to a public or private channel.'
87
- g.long_desc %( Invite a user to a public or private channel. )
88
- g.command 'invite' do |c|
89
- c.flag 'channel_id', desc: 'The channel that the users will be invited to.'
90
- c.flag 'user_ids', desc: 'The users to invite.'
91
- c.action do |_global_options, options, _args|
92
- puts JSON.dump($client.admin_conversations_invite(options))
93
- end
94
- end
95
-
96
- g.desc "This API endpoint can be used by any admin to remove a conversation's retention policy."
97
- g.long_desc %( This API endpoint can be used by any admin to remove a conversation's retention policy. )
98
- g.command 'removeCustomRetention' do |c|
99
- c.flag 'channel_id', desc: 'The conversation to set the retention policy for.'
100
- c.action do |_global_options, options, _args|
101
- puts JSON.dump($client.admin_conversations_removeCustomRetention(options))
102
- end
103
- end
104
-
105
- g.desc 'Rename a public or private channel.'
106
- g.long_desc %( Rename a public or private channel. )
107
- g.command 'rename' do |c|
108
- c.flag 'channel_id', desc: 'The channel to rename.'
109
- c.flag 'name', desc: '.'
110
- c.action do |_global_options, options, _args|
111
- puts JSON.dump($client.admin_conversations_rename(options))
112
- end
113
- end
114
-
115
- g.desc 'Search for public or private channels in an Enterprise organization.'
116
- g.long_desc %( Search for public or private channels in an Enterprise organization. )
117
- g.command 'search' do |c|
118
- c.flag 'connected_team_ids', desc: 'Array of encoded team IDs, signifying the external orgs to search through.'
119
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
120
- c.flag 'limit', desc: 'Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.'
121
- c.flag 'query', desc: 'Name of the the channel to query by.'
122
- c.flag 'search_channel_types', desc: 'The type of channel to include or exclude in the search. For example private will search private channels, while private_exclude will exclude them. For a full list of types, check the Types section.'
123
- c.flag 'sort', desc: 'Possible values are relevant (search ranking based on what we think is closest), name (alphabetical), member_count (number of users in the channel), and created (date channel was created). You can optionally pair this with the sort_dir arg to change how it is sorted.'
124
- c.flag 'sort_dir', desc: '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).'
125
- c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the internal workspaces to search through.'
126
- c.action do |_global_options, options, _args|
127
- puts JSON.dump($client.admin_conversations_search(options))
128
- end
129
- end
130
-
131
- g.desc 'Set the posting permissions for a public or private channel.'
132
- g.long_desc %( Set the posting permissions for a public or private channel. )
133
- g.command 'setConversationPrefs' do |c|
134
- c.flag 'channel_id', desc: 'The channel to set the prefs for.'
135
- c.flag 'prefs', desc: 'The prefs for this channel in a stringified JSON format.'
136
- c.action do |_global_options, options, _args|
137
- puts JSON.dump($client.admin_conversations_setConversationPrefs(options))
138
- end
139
- end
140
-
141
- g.desc "This API endpoint can be used by any admin to set a conversation's retention policy."
142
- g.long_desc %( This API endpoint can be used by any admin to set a conversation's retention policy. )
143
- g.command 'setCustomRetention' do |c|
144
- c.flag 'channel_id', desc: 'The conversation to set the retention policy for.'
145
- c.flag 'duration_days', desc: 'The message retention duration in days to set for this conversation.'
146
- c.action do |_global_options, options, _args|
147
- puts JSON.dump($client.admin_conversations_setCustomRetention(options))
148
- end
149
- end
150
-
151
- g.desc 'Set the workspaces in an Enterprise grid org that connect to a public or private channel.'
152
- g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a public or private channel. )
153
- g.command 'setTeams' do |c|
154
- c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
155
- c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
156
- c.flag 'target_team_ids', desc: 'A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.'
157
- c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
158
- c.action do |_global_options, options, _args|
159
- puts JSON.dump($client.admin_conversations_setTeams(options))
160
- end
161
- end
162
-
163
- g.desc 'Unarchive a public or private channel.'
164
- g.long_desc %( Unarchive a public or private channel. )
165
- g.command 'unarchive' do |c|
166
- c.flag 'channel_id', desc: 'The channel to unarchive.'
167
- c.action do |_global_options, options, _args|
168
- puts JSON.dump($client.admin_conversations_unarchive(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminConversations methods.'
8
+ command 'admin_conversations' do |g|
9
+ g.desc 'Archive a public or private channel.'
10
+ g.long_desc %( Archive a public or private channel. )
11
+ g.command 'archive' do |c|
12
+ c.flag 'channel_id', desc: 'The channel to archive.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.admin_conversations_archive(options))
15
+ end
16
+ end
17
+
18
+ g.desc 'Archive public or private channels in bulk.'
19
+ g.long_desc %( Archive public or private channels in bulk. )
20
+ g.command 'bulkArchive' do |c|
21
+ c.flag 'channel_ids', desc: 'An array of channel IDs to archive.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump(@client.admin_conversations_bulkArchive(options))
24
+ end
25
+ end
26
+
27
+ g.desc 'Delete public or private channels in bulk'
28
+ g.long_desc %( Delete public or private channels in bulk )
29
+ g.command 'bulkDelete' do |c|
30
+ c.flag 'channel_ids', desc: 'An array of channel IDs.'
31
+ c.action do |_global_options, options, _args|
32
+ puts JSON.dump(@client.admin_conversations_bulkDelete(options))
33
+ end
34
+ end
35
+
36
+ g.desc 'Move public or private channels in bulk.'
37
+ g.long_desc %( Move public or private channels in bulk. )
38
+ g.command 'bulkMove' do |c|
39
+ c.flag 'channel_ids', desc: 'An array of channel IDs.'
40
+ c.flag 'target_team_id', desc: 'Target team ID.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.admin_conversations_bulkMove(options))
43
+ end
44
+ end
45
+
46
+ g.desc 'Convert a public channel to a private channel.'
47
+ g.long_desc %( Convert a public channel to a private channel. )
48
+ g.command 'convertToPrivate' do |c|
49
+ c.flag 'channel_id', desc: 'The channel to convert to private.'
50
+ c.flag 'name', desc: 'Name of private channel to create. Only respected when converting an MPIM.'
51
+ c.action do |_global_options, options, _args|
52
+ puts JSON.dump(@client.admin_conversations_convertToPrivate(options))
53
+ end
54
+ end
55
+
56
+ g.desc 'Convert a private channel to a public channel.'
57
+ g.long_desc %( Convert a private channel to a public channel. )
58
+ g.command 'convertToPublic' do |c|
59
+ c.flag 'channel_id', desc: 'The channel to convert to public.'
60
+ c.action do |_global_options, options, _args|
61
+ puts JSON.dump(@client.admin_conversations_convertToPublic(options))
62
+ end
63
+ end
64
+
65
+ g.desc 'Create a public or private channel-based conversation.'
66
+ g.long_desc %( Create a public or private channel-based conversation. )
67
+ g.command 'create' do |c|
68
+ c.flag 'is_private', desc: 'When true, creates a private channel instead of a public channel.'
69
+ c.flag 'name', desc: 'Name of the public or private channel to create.'
70
+ c.flag 'description', desc: 'Description of the public or private channel to create.'
71
+ c.flag 'org_wide', desc: 'When true, the channel will be available org-wide. Note: if the channel is not org_wide=true, you must specify a team_id for this channel.'
72
+ c.flag 'team_id', desc: 'The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.'
73
+ c.action do |_global_options, options, _args|
74
+ puts JSON.dump(@client.admin_conversations_create(options))
75
+ end
76
+ end
77
+
78
+ g.desc 'Delete a public or private channel.'
79
+ g.long_desc %( Delete a public or private channel. )
80
+ g.command 'delete' do |c|
81
+ c.flag 'channel_id', desc: 'The channel to delete.'
82
+ c.action do |_global_options, options, _args|
83
+ puts JSON.dump(@client.admin_conversations_delete(options))
84
+ end
85
+ end
86
+
87
+ g.desc 'Disconnect a connected channel from one or more workspaces.'
88
+ g.long_desc %( Disconnect a connected channel from one or more workspaces. )
89
+ g.command 'disconnectShared' do |c|
90
+ c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
91
+ c.flag 'leaving_team_ids', desc: 'team IDs getting removed from the channel, optional if there are only two teams in the channel.'
92
+ c.action do |_global_options, options, _args|
93
+ puts JSON.dump(@client.admin_conversations_disconnectShared(options))
94
+ end
95
+ end
96
+
97
+ g.desc 'Get conversation preferences for a public or private channel.'
98
+ g.long_desc %( Get conversation preferences for a public or private channel. )
99
+ g.command 'getConversationPrefs' do |c|
100
+ c.flag 'channel_id', desc: 'The channel to get preferences for.'
101
+ c.action do |_global_options, options, _args|
102
+ puts JSON.dump(@client.admin_conversations_getConversationPrefs(options))
103
+ end
104
+ end
105
+
106
+ g.desc "This API endpoint can be used by any admin to get a conversation's retention policy."
107
+ g.long_desc %( This API endpoint can be used by any admin to get a conversation's retention policy. )
108
+ g.command 'getCustomRetention' do |c|
109
+ c.flag 'channel_id', desc: 'The conversation to get the retention policy for.'
110
+ c.action do |_global_options, options, _args|
111
+ puts JSON.dump(@client.admin_conversations_getCustomRetention(options))
112
+ end
113
+ end
114
+
115
+ g.desc 'Get all the workspaces a given public or private channel is connected to within this Enterprise org.'
116
+ g.long_desc %( Get all the workspaces a given public or private channel is connected to within this Enterprise org. )
117
+ g.command 'getTeams' do |c|
118
+ c.flag 'channel_id', desc: 'The channel to determine connected workspaces within the organization for.'
119
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
120
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
121
+ c.action do |_global_options, options, _args|
122
+ puts JSON.dump(@client.admin_conversations_getTeams(options))
123
+ end
124
+ end
125
+
126
+ g.desc 'Invite a user to a public or private channel.'
127
+ g.long_desc %( Invite a user to a public or private channel. )
128
+ g.command 'invite' do |c|
129
+ c.flag 'channel_id', desc: 'The channel that the users will be invited to.'
130
+ c.flag 'user_ids', desc: 'The users to invite.'
131
+ c.action do |_global_options, options, _args|
132
+ puts JSON.dump(@client.admin_conversations_invite(options))
133
+ end
134
+ end
135
+
136
+ g.desc 'Returns channels on the given team using the filters.'
137
+ g.long_desc %( Returns channels on the given team using the filters. )
138
+ g.command 'lookup' do |c|
139
+ c.flag 'last_message_activity_before', desc: 'Filter by public channels where the most recent message was sent before last_message_activity.'
140
+ c.flag 'team_ids', desc: 'Array of team IDs to filter by.'
141
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned in the previous call, to fetch the next page.'
142
+ c.flag 'limit', desc: 'Maximum number of results.'
143
+ c.flag 'max_member_count', desc: 'Filter by public channels with member count equal to or less than the specified number.'
144
+ c.action do |_global_options, options, _args|
145
+ puts JSON.dump(@client.admin_conversations_lookup(options))
146
+ end
147
+ end
148
+
149
+ g.desc "This API endpoint can be used by any admin to remove a conversation's retention policy."
150
+ g.long_desc %( This API endpoint can be used by any admin to remove a conversation's retention policy. )
151
+ g.command 'removeCustomRetention' do |c|
152
+ c.flag 'channel_id', desc: 'The conversation to set the retention policy for.'
153
+ c.action do |_global_options, options, _args|
154
+ puts JSON.dump(@client.admin_conversations_removeCustomRetention(options))
155
+ end
156
+ end
157
+
158
+ g.desc 'Rename a public or private channel.'
159
+ g.long_desc %( Rename a public or private channel. )
160
+ g.command 'rename' do |c|
161
+ c.flag 'channel_id', desc: 'The channel to rename.'
162
+ c.flag 'name', desc: '.'
163
+ c.action do |_global_options, options, _args|
164
+ puts JSON.dump(@client.admin_conversations_rename(options))
165
+ end
166
+ end
167
+
168
+ g.desc 'Search for public or private channels in an Enterprise organization.'
169
+ g.long_desc %( Search for public or private channels in an Enterprise organization. )
170
+ g.command 'search' do |c|
171
+ c.flag 'connected_team_ids', desc: 'Array of encoded team IDs, signifying the external orgs to search through.'
172
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
173
+ c.flag 'limit', desc: 'Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.'
174
+ c.flag 'query', desc: 'Name of the the channel to query by.'
175
+ c.flag 'search_channel_types', desc: 'The type of channel to include or exclude in the search. For example private will search private channels, while private_exclude will exclude them. For a full list of types, check the Types section.'
176
+ c.flag 'sort', desc: 'Possible values are relevant (search ranking based on what we think is closest), name (alphabetical), member_count (number of users in the channel), and created (date channel was created). You can optionally pair this with the sort_dir arg to change how it is sorted.'
177
+ c.flag 'sort_dir', desc: '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).'
178
+ c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the internal workspaces to search through.'
179
+ c.action do |_global_options, options, _args|
180
+ puts JSON.dump(@client.admin_conversations_search(options))
181
+ end
182
+ end
183
+
184
+ g.desc 'Set the posting permissions for a public or private channel.'
185
+ g.long_desc %( Set the posting permissions for a public or private channel. )
186
+ g.command 'setConversationPrefs' do |c|
187
+ c.flag 'channel_id', desc: 'The channel to set the prefs for.'
188
+ c.flag 'prefs', desc: 'The prefs for this channel in a stringified JSON format.'
189
+ c.action do |_global_options, options, _args|
190
+ puts JSON.dump(@client.admin_conversations_setConversationPrefs(options))
191
+ end
192
+ end
193
+
194
+ g.desc "This API endpoint can be used by any admin to set a conversation's retention policy."
195
+ g.long_desc %( This API endpoint can be used by any admin to set a conversation's retention policy. )
196
+ g.command 'setCustomRetention' do |c|
197
+ c.flag 'channel_id', desc: 'The conversation to set the retention policy for.'
198
+ c.flag 'duration_days', desc: 'The message retention duration in days to set for this conversation.'
199
+ c.action do |_global_options, options, _args|
200
+ puts JSON.dump(@client.admin_conversations_setCustomRetention(options))
201
+ end
202
+ end
203
+
204
+ g.desc 'Set the workspaces in an Enterprise grid org that connect to a public or private channel.'
205
+ g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a public or private channel. )
206
+ g.command 'setTeams' do |c|
207
+ c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
208
+ c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
209
+ c.flag 'target_team_ids', desc: 'A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.'
210
+ c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
211
+ c.action do |_global_options, options, _args|
212
+ puts JSON.dump(@client.admin_conversations_setTeams(options))
213
+ end
214
+ end
215
+
216
+ g.desc 'Unarchive a public or private channel.'
217
+ g.long_desc %( Unarchive a public or private channel. )
218
+ g.command 'unarchive' do |c|
219
+ c.flag 'channel_id', desc: 'The channel to unarchive.'
220
+ c.action do |_global_options, options, _args|
221
+ puts JSON.dump(@client.admin_conversations_unarchive(options))
222
+ end
223
+ end
224
+ end
169
225
  end
170
226
  end
171
227
  end
@@ -1,17 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminConversationsEkm methods.'
5
- command 'admin_conversations_ekm' do |g|
6
- g.desc 'List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.'
7
- g.long_desc %( List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM. )
8
- g.command 'listOriginalConnectedChannelInfo' do |c|
9
- c.flag 'channel_ids', desc: 'A comma-separated list of channels to filter to.'
10
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
11
- c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
12
- c.flag 'team_ids', desc: 'A comma-separated list of the workspaces to which the channels you would like returned belong.'
13
- c.action do |_global_options, options, _args|
14
- puts JSON.dump($client.admin_conversations_ekm_listOriginalConnectedChannelInfo(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminConversationsEkm methods.'
8
+ command 'admin_conversations_ekm' do |g|
9
+ g.desc 'List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.'
10
+ g.long_desc %( List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM. )
11
+ g.command 'listOriginalConnectedChannelInfo' do |c|
12
+ c.flag 'channel_ids', desc: 'A comma-separated list of channels to filter to.'
13
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
14
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
15
+ c.flag 'team_ids', desc: 'A comma-separated list of the workspaces to which the channels you would like returned belong.'
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump(@client.admin_conversations_ekm_listOriginalConnectedChannelInfo(options))
18
+ end
19
+ end
20
+ end
15
21
  end
16
22
  end
17
23
  end