|
| 1 | +# frozen_string_literal: true |
| 2 | +# This file was auto-generated by lib/tasks/web.rake |
| 3 | + |
| 4 | +desc 'AdminUsers methods.' |
| 5 | +command 'admin_users' do |g| |
| 6 | + g.desc 'Add an Enterprise user to a workspace.' |
| 7 | + g.long_desc %( Add an Enterprise user to a workspace. ) |
| 8 | + g.command 'assign' do |c| |
| 9 | + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' |
| 10 | + c.flag 'user_id', desc: 'The ID of the user to add to the workspace.' |
| 11 | + c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.' |
| 12 | + c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.' |
| 13 | + c.action do |_global_options, options, _args| |
| 14 | + puts JSON.dump($client.admin_users_assign(options)) |
| 15 | + end |
| 16 | + end |
| 17 | + |
| 18 | + g.desc 'Invite a user to a workspace.' |
| 19 | + g.long_desc %( Invite a user to a workspace. ) |
| 20 | + g.command 'invite' do |c| |
| 21 | + c.flag 'channel_ids', desc: 'A comma-separated list of channel_ids for this user to join. At least one channel is required.' |
| 22 | + c.flag 'email', desc: 'The email address of the person to invite.' |
| 23 | + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' |
| 24 | + c.flag 'custom_message', desc: 'An optional message to send to the user in the invite email.' |
| 25 | + 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.' |
| 26 | + c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).' |
| 27 | + c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).' |
| 28 | + c.flag 'real_name', desc: 'Full name of the user.' |
| 29 | + c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. (default: false).' |
| 30 | + c.action do |_global_options, options, _args| |
| 31 | + puts JSON.dump($client.admin_users_invite(options)) |
| 32 | + end |
| 33 | + end |
| 34 | + |
| 35 | + g.desc 'Remove a user from a workspace.' |
| 36 | + g.long_desc %( Remove a user from a workspace. ) |
| 37 | + g.command 'remove' do |c| |
| 38 | + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' |
| 39 | + c.flag 'user_id', desc: 'The ID of the user to remove.' |
| 40 | + c.action do |_global_options, options, _args| |
| 41 | + puts JSON.dump($client.admin_users_remove(options)) |
| 42 | + end |
| 43 | + end |
| 44 | + |
| 45 | + g.desc 'Set an existing guest, regular user, or owner to be an admin user.' |
| 46 | + g.long_desc %( Set an existing guest, regular user, or owner to be an admin user. ) |
| 47 | + g.command 'setAdmin' do |c| |
| 48 | + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' |
| 49 | + c.flag 'user_id', desc: 'The ID of the user to designate as an admin.' |
| 50 | + c.action do |_global_options, options, _args| |
| 51 | + puts JSON.dump($client.admin_users_setAdmin(options)) |
| 52 | + end |
| 53 | + end |
| 54 | + |
| 55 | + g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.' |
| 56 | + g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. ) |
| 57 | + g.command 'setOwner' do |c| |
| 58 | + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' |
| 59 | + c.flag 'user_id', desc: 'Id of the user to promote to owner.' |
| 60 | + c.action do |_global_options, options, _args| |
| 61 | + puts JSON.dump($client.admin_users_setOwner(options)) |
| 62 | + end |
| 63 | + end |
| 64 | + |
| 65 | + g.desc 'Set an existing guest user, admin user, or owner to be a regular user.' |
| 66 | + g.long_desc %( Set an existing guest user, admin user, or owner to be a regular user. ) |
| 67 | + g.command 'setRegular' do |c| |
| 68 | + c.flag 'team_id', desc: 'The ID (T1234) of the workspace.' |
| 69 | + c.flag 'user_id', desc: 'The ID of the user to designate as a regular user.' |
| 70 | + c.action do |_global_options, options, _args| |
| 71 | + puts JSON.dump($client.admin_users_setRegular(options)) |
| 72 | + end |
| 73 | + end |
| 74 | +end |
0 commit comments