slack-ruby-client 0.14.6 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +9 -2
  4. data/.rubocop_todo.yml +52 -12
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +10 -0
  7. data/CONTRIBUTING.md +24 -6
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/README.md +20 -1
  11. data/UPGRADING.md +6 -0
  12. data/bin/commands.rb +5 -0
  13. data/bin/commands/admin_conversations.rb +1 -1
  14. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  15. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  16. data/bin/commands/admin_usergroups.rb +48 -0
  17. data/bin/commands/calls.rb +52 -0
  18. data/bin/commands/calls_participants.rb +25 -0
  19. data/bin/commands/chat.rb +5 -5
  20. data/bin/commands/conversations.rb +0 -1
  21. data/lib/slack-ruby-client.rb +2 -4
  22. data/lib/slack/messages/message.rb +0 -4
  23. data/lib/slack/real_time/concurrency/async.rb +1 -3
  24. data/lib/slack/real_time/concurrency/eventmachine.rb +3 -3
  25. data/lib/slack/real_time/models/base.rb +0 -4
  26. data/lib/slack/real_time/socket.rb +2 -2
  27. data/lib/slack/real_time/stores/base.rb +3 -1
  28. data/lib/slack/version.rb +1 -1
  29. data/lib/slack/web/api/endpoints.rb +11 -0
  30. data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -1
  31. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  32. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  33. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  34. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  35. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  36. data/lib/slack/web/api/endpoints/channels.rb +28 -13
  37. data/lib/slack/web/api/endpoints/chat.rb +12 -12
  38. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +1 -1
  39. data/lib/slack/web/api/endpoints/conversations.rb +15 -17
  40. data/lib/slack/web/api/endpoints/files.rb +2 -2
  41. data/lib/slack/web/api/endpoints/files_remote.rb +1 -1
  42. data/lib/slack/web/api/endpoints/groups.rb +16 -0
  43. data/lib/slack/web/api/endpoints/im.rb +10 -4
  44. data/lib/slack/web/api/endpoints/mpim.rb +10 -4
  45. data/lib/slack/web/api/endpoints/oauth.rb +0 -3
  46. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  47. data/lib/slack/web/api/endpoints/reactions.rb +3 -3
  48. data/lib/slack/web/api/endpoints/stars.rb +2 -2
  49. data/lib/slack/web/api/errors.rb +92 -2
  50. data/lib/slack/web/api/mixins.rb +1 -0
  51. data/lib/slack/web/api/mixins/conversations.id.rb +27 -0
  52. data/lib/slack/web/api/mixins/ids.id.rb +1 -3
  53. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +29 -26
  54. data/lib/slack/web/api/templates/method.erb +4 -1
  55. data/lib/slack/web/faraday/connection.rb +23 -20
  56. data/lib/slack/web/pagination/cursor.rb +2 -2
  57. data/slack-ruby-client.gemspec +5 -5
  58. data/spec/fixtures/slack/web/channels_info.yml +108 -15
  59. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  60. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +32 -0
  61. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  62. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  63. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  64. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +3 -3
  65. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  66. data/spec/slack/web/api/errors/service_unavailable_spec.rb +2 -2
  67. data/spec/slack/web/api/mixins/conversations_spec.rb +41 -0
  68. data/spec/slack/web/client_spec.rb +26 -0
  69. metadata +49 -30
  70. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  71. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  72. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  73. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  74. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24883016f639f51e34aa4026ff203ef1cb6fa66abac9c0017d5653508f9169c7
4
- data.tar.gz: 49bf4585f49dba526c764e018150ed9e884161c67529e442ef9e5df104d48345
3
+ metadata.gz: c889cedf29a72dd4c60c2d8c1338538c2f35ed7be9d42defa10f04866466997a
4
+ data.tar.gz: f23223bf65696509321856a536f60411db15c3fe34db3c42f2284672fbc99f47
5
5
  SHA512:
6
- metadata.gz: db889eac4fbc7effec2f2f8bd319523f4e3c646ad0be8b52e2221a444d79cca38bae6fed8d0b6aac100c4869f862f6cfddb4644407d305977ad8b2a3fc1da670
7
- data.tar.gz: 636f316d2e9efba1f663ccf0691fcf715b4f6a16d80bb98d8e5676d5479d6536beaa9a5c4de0452319a166ef50f9c7e6cddf451e6898600b3a57897b862472d2
6
+ metadata.gz: b1c55f1840dbb1604294e83e922188467aa63a8aa04c2d38c744e6e96287db2ba961b33f408ee83c68dae70f9554d362e1fb1278c36dc45b1e1a5190e6b3189f
7
+ data.tar.gz: 582c4f3d190b998521b5c7e358188c0662d1e3c2c43021cf9e93345e7ca162c027e0d170364c87367ba548132aeb4c0ab989d08c01bc4e5eec4f8312dbaf8ea6
@@ -0,0 +1 @@
1
+ github: [dblock]
@@ -13,18 +13,25 @@ AllCops:
13
13
  - lib/slack/web/api/endpoints/* # Auto-generated
14
14
  - lib/slack/web/api/errors.rb # Auto-generated
15
15
  - spec/slack/web/api/endpoints/* # Auto-generated
16
+
16
17
  Layout/EmptyLineAfterMagicComment:
17
18
  Enabled: false
19
+
18
20
  Metrics/BlockLength:
19
21
  Max: 250
22
+
20
23
  Metrics/ClassLength:
21
24
  Max: 250
22
- Metrics/LineLength:
23
- Max: 100
25
+
26
+ Layout/LineLength:
27
+ Max: 128
28
+
24
29
  Style/Documentation:
25
30
  Enabled: false
31
+
26
32
  Style/ModuleFunction:
27
33
  Enabled: false
34
+
28
35
  Naming/FileName:
29
36
  Exclude:
30
37
  - lib/slack-ruby-client.rb # Required to match gemspec name
@@ -1,24 +1,37 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-12-23 15:50:03 -0500 using RuboCop version 0.73.0.
3
+ # on 2020-06-29 08:44:31 -0400 using RuboCop version 0.82.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ Lint/NonDeterministicRequireOrder:
12
+ Exclude:
13
+ - 'spec/spec_helper.rb'
14
+
15
+ # Offense count: 2
16
+ # Cop supports --auto-correct.
17
+ Lint/RedundantCopDisableDirective:
18
+ Exclude:
19
+ - 'lib/slack-ruby-client.rb'
20
+
21
+ # Offense count: 2
10
22
  # Configuration parameters: AllowComments.
11
- Lint/HandleExceptions:
23
+ Lint/SuppressedException:
12
24
  Exclude:
13
- - 'lib/slack/real_time/concurrency/async.rb'
14
25
  - 'spec/slack/real_time/concurrency/celluloid_spec.rb'
15
26
  - 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
16
27
 
17
- # Offense count: 10
28
+ # Offense count: 11
29
+ # Configuration parameters: IgnoredMethods.
18
30
  Metrics/AbcSize:
19
31
  Max: 39
20
32
 
21
- # Offense count: 1
33
+ # Offense count: 2
34
+ # Configuration parameters: IgnoredMethods.
22
35
  Metrics/CyclomaticComplexity:
23
36
  Max: 9
24
37
 
@@ -28,21 +41,43 @@ Metrics/MethodLength:
28
41
  Max: 32
29
42
 
30
43
  # Offense count: 1
44
+ # Configuration parameters: IgnoredMethods.
31
45
  Metrics/PerceivedComplexity:
32
46
  Max: 9
33
47
 
48
+ # Offense count: 2
49
+ # Cop supports --auto-correct.
50
+ Performance/RegexpMatch:
51
+ Exclude:
52
+ - 'lib/tasks/web.rake'
53
+
34
54
  # Offense count: 1
35
55
  RSpec/AnyInstance:
36
56
  Exclude:
37
57
  - 'spec/slack/real_time/concurrency/celluloid_spec.rb'
38
58
 
39
- # Offense count: 70
59
+ # Offense count: 5
60
+ # Cop supports --auto-correct.
61
+ RSpec/ContextMethod:
62
+ Exclude:
63
+ - 'spec/slack/messages/formatting_spec.rb'
64
+ - 'spec/slack/web/api/mixins/channels_spec.rb'
65
+ - 'spec/slack/web/api/mixins/groups_spec.rb'
66
+ - 'spec/slack/web/api/mixins/users_spec.rb'
67
+
68
+ # Offense count: 71
40
69
  # Configuration parameters: Prefixes.
41
70
  # Prefixes: when, with, without
42
71
  RSpec/ContextWording:
43
72
  Enabled: false
44
73
 
45
- # Offense count: 64
74
+ # Offense count: 129
75
+ # Cop supports --auto-correct.
76
+ # Configuration parameters: AllowConsecutiveOneLiners.
77
+ RSpec/EmptyLineAfterExample:
78
+ Enabled: false
79
+
80
+ # Offense count: 66
46
81
  # Configuration parameters: Max.
47
82
  RSpec/ExampleLength:
48
83
  Enabled: false
@@ -60,18 +95,17 @@ RSpec/InstanceVariable:
60
95
  - 'spec/slack/real_time/client_spec.rb'
61
96
  - 'spec/slack/slack_spec.rb'
62
97
 
63
- # Offense count: 75
98
+ # Offense count: 77
64
99
  # Configuration parameters: .
65
100
  # SupportedStyles: have_received, receive
66
101
  RSpec/MessageSpies:
67
102
  EnforcedStyle: receive
68
103
 
69
- # Offense count: 93
70
- # Configuration parameters: AggregateFailuresByDefault.
104
+ # Offense count: 95
71
105
  RSpec/MultipleExpectations:
72
106
  Max: 5
73
107
 
74
- # Offense count: 34
108
+ # Offense count: 35
75
109
  RSpec/NestedGroups:
76
110
  Max: 6
77
111
 
@@ -92,3 +126,9 @@ RSpec/VerifiedDoubles:
92
126
  - 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
93
127
  - 'spec/slack/web/faraday/response/raise_error_spec.rb'
94
128
  - 'spec/support/real_time/connected_client.rb'
129
+
130
+ # Offense count: 4
131
+ # Configuration parameters: .
132
+ # SupportedStyles: annotated, template, unannotated
133
+ Style/FormatStringToken:
134
+ EnforcedStyle: unannotated
@@ -3,7 +3,6 @@ language: ruby
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.3.8
7
6
  - 2.5.3
8
7
  - 2.6.0
9
8
  - ruby-head
@@ -1,3 +1,13 @@
1
+ ### 0.15.0 (2020/7/26)
2
+
3
+ * [#322](https://github.com/slack-ruby/slack-ruby-client/pull/322): Cache `Faraday::Connection` for persistent adapters - [@drbrain](https://github.com/drbrain).
4
+ * [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Require Faraday >= 1.0 - [@dblock](https://github.com/dblock).
5
+ * [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Upgrade slack-ruby-danger, rubocop, rubocop-rspec and rubocop-performance - [@dblock](https://github.com/dblock).
6
+ * [#327](https://github.com/slack-ruby/slack-ruby-client/pull/327), [#326](https://github.com/slack-ruby/slack-ruby-client/pull/326): Added `admin_conversations_whitelist`, `admin_usergroups`, `calls` and `calls_participants` endpoints - [@wasabigeek](https://github.com/wasabigeek).
7
+ * [#329](https://github.com/slack-ruby/slack-ruby-client/pull/329): Log when methods are deprecated - [@wasabigeek](https://github.com/wasabigeek).
8
+ * [#325](https://github.com/slack-ruby/slack-ruby-client/pull/325): Remove activesupport dependency - [@ianks](https://github.com/ianks).
9
+ * [#331](https://github.com/slack-ruby/slack-ruby-client/pull/331): Use `conversations_list` instead of deprecated `channels_list`. Added `admin_conversations_restrictAccess_addGroup`, `admin_conversations_restrictAccess_listGroups` and `admin_conversations_restrictAccess_removeGroup` endpoints - [@wasabigeek](https://github.com/wasabigeek).
10
+
1
11
  ### 0.14.6 (2020/3/28)
2
12
 
3
13
  * [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin_inviteRequests_approve`, `admin_inviteRequests_deny`, `admin_inviteRequests_list`, `admin_inviteRequests_approved_list`, `admin_inviteRequests_denied_list`, `admin_teams_create`, `admin_teams_list`, `admin_teams_admins_list`, `admin_teams_owners_list`, `admin_teams_settings`, `admin_teams_settings_setIcon`, `admin_teams_settings_setName`, `admin_teams_settings_setDescription`, `admin_users_assign`, `admin_users_invite`, `admin_users_remove`, `admin_users_setAdmin`, `admin_users_setOwner` and `admin_users_setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
@@ -75,13 +75,31 @@ rake slack:api:update
75
75
 
76
76
  Sometimes it's necessary to patch auto-generated Slack Web API methods. For example, we want to help clients with calling `to_json` on the `attachments` parameter sent to `chat_postMessage`. See [#20](https://github.com/slack-ruby/slack-ruby-client/issues/20).
77
77
 
78
- Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb` and generate a patch.
78
+ The broad steps are:
79
+ 1. Run `rake slack:api:update` to check that existing patches are still valid.
80
+ - If you run into a `failed to apply patch` error, the auto-generated methods likely drifted from the last patch. Follow the steps [below](#resolving-patch-errors).
81
+ - This may add new methods if the API has updated, please split them up into multiple PRs if so.
82
+ 2. Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb`.
83
+ 3. Generate a patch:
84
+ ```
85
+ git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.1.patch
86
+ ```
87
+ 4. Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
88
+
89
+ ##### Resolving Patch Errors
90
+
91
+ The auto-generated method files may drift overtime e.g. new arguments may be added or descriptions changed. Since previous patches were based on the older auto-generated files, git may be unable to apply them to the new files. Resolving them requires some good ol' splicing:
92
+ 1. Comment out the patching code in `lib/tasks/web.rake`:
93
+ ```ruby
94
+ # Dir.glob("lib/slack/web/api/patches/#{group}*.patch").sort.each do |patch|
95
+ # puts "- patching #{patch}"
96
+ # system("git apply #{patch}") || raise('failed to apply patch')
97
+ # end
98
+ ```
99
+ 2. Run `rake slack:api:update` to create the raw auto-generated files. Commit the files that you are updating, so we can run `git diff` later.
100
+ 3. Go through the old patches for the files (e.g. in `lib/slack/web/api/patches/chat.1.patch`), copying code into the new files.
101
+ 4. Continue with Step 2 [above](#patching-slack-web-api).
79
102
 
80
- ```
81
- git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.1.patch
82
- ```
83
-
84
- Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
85
103
 
86
104
  ### Write Documentation
87
105
 
data/Dangerfile CHANGED
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  danger.import_dangerfile(gem: 'slack-ruby-danger')
3
- toc.check
data/Gemfile CHANGED
@@ -13,6 +13,5 @@ if ENV.key?('CONCURRENCY')
13
13
  end
14
14
 
15
15
  group :test do
16
- gem 'danger-toc', '~> 0.1.3', require: false
17
- gem 'slack-ruby-danger', '~> 0.1.0', require: false
16
+ gem 'slack-ruby-danger', '~> 0.2.0', require: false
18
17
  end
data/README.md CHANGED
@@ -31,6 +31,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
31
31
  - [Other](#other)
32
32
  - [Web Client Options](#web-client-options)
33
33
  - [Pagination Support](#pagination-support)
34
+ - [Character Encoding](#character-encoding)
34
35
  - [Error Handling](#error-handling)
35
36
  - [Slack Errors](#slack-errors)
36
37
  - [Rate Limiting](#rate-limiting)
@@ -71,7 +72,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
71
72
 
72
73
  ## Stable Release
73
74
 
74
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.6. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
75
+ You're reading the documentation for the **stale** release of slack-ruby-client, v0.15.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
75
76
 
76
77
  ## Installation
77
78
 
@@ -276,6 +277,24 @@ end
276
277
  all_members # many thousands of team members retrieved 10 at a time
277
278
  ```
278
279
 
280
+ #### Character Encoding
281
+
282
+ Note that Slack expects `text` to be UTF-8 encoded. If your messages appear with text such as `BAD+11` in Slack, check `text.encoding` and `.encode(Encoding::UTF_8)` your messages before sending them to Slack.
283
+
284
+ ```ruby
285
+ text = 'characters such as "Ñ", "Á", "É"'
286
+ text.encoding
287
+ => #<Encoding:UTF-8>
288
+ client.chat_postMessage(channel: '#general', text: text, as_user: true)
289
+ # renders 'characters such as "Ñ", "Á", "É"' in Slack
290
+
291
+ text = text.encode(Encoding::ISO_8859_1)
292
+ text.encoding
293
+ # => #<Encoding:ISO-8859-1>
294
+ client.chat_postMessage(channel: '#general', text: text, as_user: true)
295
+ # renders 'characters such as "BAD+11", "", "BAD+9"' in Slack
296
+ ```
297
+
279
298
  #### Error Handling
280
299
 
281
300
  ##### Slack Errors
@@ -1,6 +1,12 @@
1
1
  Upgrading Slack-Ruby-Client
2
2
  ===========================
3
3
 
4
+ ### Upgrading to >= 0.15.0
5
+
6
+ As of 0.15.0, `activesupport` is no longer required. Add `gem 'activesupport'` to your Gemfile if you required ActiveSupport via this library.
7
+
8
+ See [#325](https://github.com/slack-ruby/slack-ruby-client/pull/325) for more information.
9
+
4
10
  ### Upgrading to >= 0.14.0
5
11
 
6
12
  If you are using async-websocket, lock down its version to 0.8.0 as newer versions are currently incompatible.
@@ -6,6 +6,8 @@ require 'commands/admin_apps_approved'
6
6
  require 'commands/admin_apps_requests'
7
7
  require 'commands/admin_apps_restricted'
8
8
  require 'commands/admin_conversations'
9
+ require 'commands/admin_conversations_restrictAccess'
10
+ require 'commands/admin_conversations_whitelist'
9
11
  require 'commands/admin_emoji'
10
12
  require 'commands/admin_inviteRequests'
11
13
  require 'commands/admin_inviteRequests_approved'
@@ -14,6 +16,7 @@ require 'commands/admin_teams'
14
16
  require 'commands/admin_teams_admins'
15
17
  require 'commands/admin_teams_owners'
16
18
  require 'commands/admin_teams_settings'
19
+ require 'commands/admin_usergroups'
17
20
  require 'commands/admin_users'
18
21
  require 'commands/admin_users_session'
19
22
  require 'commands/api'
@@ -24,6 +27,8 @@ require 'commands/apps_permissions_scopes'
24
27
  require 'commands/apps_permissions_users'
25
28
  require 'commands/auth'
26
29
  require 'commands/bots'
30
+ require 'commands/calls'
31
+ require 'commands/calls_participants'
27
32
  require 'commands/channels'
28
33
  require 'commands/chat'
29
34
  require 'commands/chat_scheduledMessages'
@@ -8,7 +8,7 @@ command 'admin_conversations' do |g|
8
8
  g.command 'setTeams' do |c|
9
9
  c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.'
10
10
  c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.'
11
- c.flag 'target_team_ids', desc: "The list of workspaces to which the channel should be shared. Not required if the channel is being shared orgwide. Example: ['T1234', 'T5678']."
11
+ 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.'
12
12
  c.flag 'team_id', desc: 'The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.'
13
13
  c.action do |_global_options, options, _args|
14
14
  puts JSON.dump($client.admin_conversations_setTeams(options))
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminConversationsRestrictaccess methods.'
5
+ command 'admin_conversations_restrictAccess' do |g|
6
+ g.desc 'Add an allowlist of IDP groups for accessing a channel'
7
+ g.long_desc %( Add an allowlist of IDP groups for accessing a channel )
8
+ g.command 'addGroup' do |c|
9
+ c.flag 'channel_id', desc: 'The channel to link this group to.'
10
+ c.flag 'group_id', desc: 'The IDP Group ID to be an allowlist for the private channel.'
11
+ c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.admin_conversations_restrictAccess_addGroup(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'List all IDP Groups linked to a channel'
18
+ g.long_desc %( List all IDP Groups linked to a channel )
19
+ g.command 'listGroups' do |c|
20
+ c.flag 'channel_id', desc: '.'
21
+ c.flag 'team_id', desc: 'The workspace where the channele exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump($client.admin_conversations_restrictAccess_listGroups(options))
24
+ end
25
+ end
26
+
27
+ g.desc 'Remove a linked IDP group linked from a private channel'
28
+ g.long_desc %( Remove a linked IDP group linked from a private channel )
29
+ g.command 'removeGroup' do |c|
30
+ c.flag 'channel_id', desc: 'The channel to remove the linked group from.'
31
+ c.flag 'group_id', desc: 'The IDP Group ID to remove from the private channel.'
32
+ c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
33
+ c.action do |_global_options, options, _args|
34
+ puts JSON.dump($client.admin_conversations_restrictAccess_removeGroup(options))
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminConversationsWhitelist methods.'
5
+ command 'admin_conversations_whitelist' do |g|
6
+ g.desc 'Add an allowlist of IDP groups for accessing a channel'
7
+ g.long_desc %( Add an allowlist of IDP groups for accessing a channel )
8
+ g.command 'add' do |c|
9
+ c.flag 'channel_id', desc: 'The channel to whitelist a group for.'
10
+ c.flag 'group_id', desc: 'The IDP Group ID to whitelist for the private channel.'
11
+ c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.admin_conversations_whitelist_add(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'List all IDP Groups linked to a channel'
18
+ g.long_desc %( List all IDP Groups linked to a channel )
19
+ g.command 'listGroupsLinkedToChannel' do |c|
20
+ c.flag 'channel_id', desc: '.'
21
+ c.flag 'team_id', desc: 'The workspace where the channele exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump($client.admin_conversations_whitelist_listGroupsLinkedToChannel(options))
24
+ end
25
+ end
26
+
27
+ g.desc 'Remove an allowlisted IDP group linked to a private channel'
28
+ g.long_desc %( Remove an allowlisted IDP group linked to a private channel )
29
+ g.command 'remove' do |c|
30
+ c.flag 'channel_id', desc: 'The channel to remove a whitelisted group for.'
31
+ c.flag 'group_id', desc: 'The IDP Group ID to remove from the private channel whitelist.'
32
+ c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
33
+ c.action do |_global_options, options, _args|
34
+ puts JSON.dump($client.admin_conversations_whitelist_remove(options))
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminUsergroups methods.'
5
+ command 'admin_usergroups' do |g|
6
+ g.desc 'Add one or more default channels to an IDP group.'
7
+ g.long_desc %( Add one or more default channels to an IDP group. )
8
+ g.command 'addChannels' do |c|
9
+ c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.'
10
+ c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.'
11
+ c.flag 'team_id', desc: 'The workspace to add default channels in.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.admin_usergroups_addChannels(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'Associate one or more default workspaces with an organization-wide IDP group.'
18
+ g.long_desc %( Associate one or more default workspaces with an organization-wide IDP group. )
19
+ g.command 'addTeams' do |c|
20
+ c.flag 'team_ids', desc: 'A comma separated list of encoded team (workspace) IDs. Each workspace MUST belong to the organization associated with the token.'
21
+ c.flag 'usergroup_id', desc: 'An encoded usergroup (IDP Group) ID.'
22
+ c.flag 'auto_provision', desc: 'When true, this method automatically creates new workspace accounts for the IDP group members.'
23
+ c.action do |_global_options, options, _args|
24
+ puts JSON.dump($client.admin_usergroups_addTeams(options))
25
+ end
26
+ end
27
+
28
+ g.desc 'List the channels linked to an org-level IDP group (user group).'
29
+ g.long_desc %( List the channels linked to an org-level IDP group (user group). )
30
+ g.command 'listChannels' do |c|
31
+ c.flag 'usergroup_id', desc: 'ID of the IDP group to list default channels for.'
32
+ c.flag 'include_num_members', desc: 'Flag to include or exclude the count of members per channel.'
33
+ c.flag 'team_id', desc: 'ID of the the workspace.'
34
+ c.action do |_global_options, options, _args|
35
+ puts JSON.dump($client.admin_usergroups_listChannels(options))
36
+ end
37
+ end
38
+
39
+ g.desc 'Remove one or more default channels from an org-level IDP group (user group).'
40
+ g.long_desc %( Remove one or more default channels from an org-level IDP group (user group). )
41
+ g.command 'removeChannels' do |c|
42
+ c.flag 'channel_ids', desc: 'Comma-separated string of channel IDs.'
43
+ c.flag 'usergroup_id', desc: 'ID of the IDP Group.'
44
+ c.action do |_global_options, options, _args|
45
+ puts JSON.dump($client.admin_usergroups_removeChannels(options))
46
+ end
47
+ end
48
+ end