-
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathadmin_users.rb
More file actions
106 lines (98 loc) · 5.91 KB
/
Copy pathadmin_users.rb
File metadata and controls
106 lines (98 loc) · 5.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake
module Slack
module Cli
class App
desc 'AdminUsers methods.'
command 'admin_users' do |g|
g.desc 'Add an Enterprise user to a workspace.'
g.long_desc %( Add an Enterprise user to a workspace. )
g.command 'assign' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'The ID of the user to add to the workspace.'
c.flag 'channel_ids', desc: 'Comma separated values of channel IDs to add user in the new workspace.'
c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.'
c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_assign(options))
end
end
g.desc 'Invite a user to a workspace.'
g.long_desc %( Invite a user to a workspace. )
g.command 'invite' do |c|
c.flag 'channel_ids', desc: 'A comma-separated list of channel_ids for this user to join. At least one channel is required.'
c.flag 'email', desc: 'The email address of the person to invite.'
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'custom_message', desc: 'An optional message to send to the user in the invite email.'
c.flag 'email_password_policy_enabled', desc: 'Allow invited user to sign in via email and password. Only available for Enterprise Grid teams via admin invite.'
c.flag 'guest_expiration_ts', desc: 'Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.'
c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).'
c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).'
c.flag 'real_name', desc: 'Full name of the user.'
c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. Resending can only be done via the UI and has no expiration. (default: false).'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_invite(options))
end
end
g.desc 'List users on a workspace'
g.long_desc %( List users on a workspace )
g.command 'list' do |c|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
c.flag 'include_deactivated_user_workspaces', desc: 'Only applies with org token and no team_id. If true, return workspaces for a user even if they may be deactivated on them. If false, return workspaces for a user only when user is active on them. Default is false.'
c.flag 'is_active', desc: 'If true, only active users will be returned. If false, only deactivated users will be returned. Default is true.'
c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.'
c.flag 'team_id', desc: 'The ID (T1234) of a workspace. Filters results to just the specified workspace.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_list(options))
end
end
g.desc 'Remove a user from a workspace.'
g.long_desc %( Remove a user from a workspace. )
g.command 'remove' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'The ID of the user to remove.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_remove(options))
end
end
g.desc 'Set an existing regular user or owner to be a workspace admin.'
g.long_desc %( Set an existing regular user or owner to be a workspace admin. )
g.command 'setAdmin' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setAdmin(options))
end
end
g.desc 'Set an expiration for a guest user'
g.long_desc %( Set an expiration for a guest user )
g.command 'setExpiration' do |c|
c.flag 'expiration_ts', desc: 'Epoch timestamp in seconds when guest account should be disabled.'
c.flag 'user_id', desc: 'The ID of the user to set an expiration for.'
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setExpiration(options))
end
end
g.desc 'Set an existing regular user or admin to be a workspace owner.'
g.long_desc %( Set an existing regular user or admin to be a workspace owner. )
g.command 'setOwner' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'Id of the user to promote to owner.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setOwner(options))
end
end
g.desc 'Set an existing guest user, admin user, or owner to be a regular user.'
g.long_desc %( Set an existing guest user, admin user, or owner to be a regular user. )
g.command 'setRegular' do |c|
c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
c.flag 'user_id', desc: 'The ID of the user to designate as a regular user.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.admin_users_setRegular(options))
end
end
end
end
end
end