|
3 | 3 |
|
4 | 4 | desc 'AdminConversations methods.' |
5 | 5 | command 'admin_conversations' do |g| |
6 | | - g.desc 'Set the workspaces in an Enterprise grid org that connect to a channel.' |
7 | | - g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a channel. ) |
| 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.action do |_global_options, options, _args| |
| 20 | + puts JSON.dump($client.admin_conversations_convertToPrivate(options)) |
| 21 | + end |
| 22 | + end |
| 23 | + |
| 24 | + g.desc 'Create a public or private channel-based conversation.' |
| 25 | + g.long_desc %( Create a public or private channel-based conversation. ) |
| 26 | + g.command 'create' do |c| |
| 27 | + c.flag 'is_private', desc: 'When true, creates a private channel instead of a public channel.' |
| 28 | + c.flag 'name', desc: 'Name of the public or private channel to create.' |
| 29 | + c.flag 'description', desc: 'Description of the public or private channel to create.' |
| 30 | + 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.' |
| 31 | + c.flag 'team_id', desc: 'The workspace to create the channel in. Note: this argument is required unless you set org_wide=true.' |
| 32 | + c.action do |_global_options, options, _args| |
| 33 | + puts JSON.dump($client.admin_conversations_create(options)) |
| 34 | + end |
| 35 | + end |
| 36 | + |
| 37 | + g.desc 'Delete a public or private channel.' |
| 38 | + g.long_desc %( Delete a public or private channel. ) |
| 39 | + g.command 'delete' do |c| |
| 40 | + c.flag 'channel_id', desc: 'The channel to delete.' |
| 41 | + c.action do |_global_options, options, _args| |
| 42 | + puts JSON.dump($client.admin_conversations_delete(options)) |
| 43 | + end |
| 44 | + end |
| 45 | + |
| 46 | + g.desc 'Disconnect a connected channel from one or more workspaces.' |
| 47 | + g.long_desc %( Disconnect a connected channel from one or more workspaces. ) |
| 48 | + g.command 'disconnectShared' do |c| |
| 49 | + c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.' |
| 50 | + c.flag 'leaving_team_ids', desc: 'The team to be removed from the channel. Currently only a single team id can be specified.' |
| 51 | + c.action do |_global_options, options, _args| |
| 52 | + puts JSON.dump($client.admin_conversations_disconnectShared(options)) |
| 53 | + end |
| 54 | + end |
| 55 | + |
| 56 | + g.desc 'Get conversation preferences for a public or private channel.' |
| 57 | + g.long_desc %( Get conversation preferences for a public or private channel. ) |
| 58 | + g.command 'getConversationPrefs' do |c| |
| 59 | + c.flag 'channel_id', desc: 'The channel to get preferences for.' |
| 60 | + c.action do |_global_options, options, _args| |
| 61 | + puts JSON.dump($client.admin_conversations_getConversationPrefs(options)) |
| 62 | + end |
| 63 | + end |
| 64 | + |
| 65 | + g.desc 'Get all the workspaces a given public or private channel is connected to within this Enterprise org.' |
| 66 | + g.long_desc %( Get all the workspaces a given public or private channel is connected to within this Enterprise org. ) |
| 67 | + g.command 'getTeams' do |c| |
| 68 | + c.flag 'channel_id', desc: 'The channel to determine connected workspaces within the organization for.' |
| 69 | + c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' |
| 70 | + c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.' |
| 71 | + c.action do |_global_options, options, _args| |
| 72 | + puts JSON.dump($client.admin_conversations_getTeams(options)) |
| 73 | + end |
| 74 | + end |
| 75 | + |
| 76 | + g.desc 'Invite a user to a public or private channel.' |
| 77 | + g.long_desc %( Invite a user to a public or private channel. ) |
| 78 | + g.command 'invite' do |c| |
| 79 | + c.flag 'channel_id', desc: 'The channel that the users will be invited to.' |
| 80 | + c.flag 'user_ids', desc: 'The users to invite.' |
| 81 | + c.action do |_global_options, options, _args| |
| 82 | + puts JSON.dump($client.admin_conversations_invite(options)) |
| 83 | + end |
| 84 | + end |
| 85 | + |
| 86 | + g.desc 'Rename a public or private channel.' |
| 87 | + g.long_desc %( Rename a public or private channel. ) |
| 88 | + g.command 'rename' do |c| |
| 89 | + c.flag 'channel_id', desc: 'The channel to rename.' |
| 90 | + c.flag 'name', desc: '.' |
| 91 | + c.action do |_global_options, options, _args| |
| 92 | + puts JSON.dump($client.admin_conversations_rename(options)) |
| 93 | + end |
| 94 | + end |
| 95 | + |
| 96 | + g.desc 'Search for public or private channels in an Enterprise organization.' |
| 97 | + g.long_desc %( Search for public or private channels in an Enterprise organization. ) |
| 98 | + g.command 'search' do |c| |
| 99 | + c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' |
| 100 | + c.flag 'limit', desc: 'Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.' |
| 101 | + c.flag 'query', desc: 'Name of the the channel to query by.' |
| 102 | + 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.' |
| 103 | + 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.' |
| 104 | + 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).' |
| 105 | + c.flag 'team_ids', desc: 'Comma separated string of team IDs, signifying the workspaces to search through.' |
| 106 | + c.action do |_global_options, options, _args| |
| 107 | + puts JSON.dump($client.admin_conversations_search(options)) |
| 108 | + end |
| 109 | + end |
| 110 | + |
| 111 | + g.desc 'Set the posting permissions for a public or private channel.' |
| 112 | + g.long_desc %( Set the posting permissions for a public or private channel. ) |
| 113 | + g.command 'setConversationPrefs' do |c| |
| 114 | + c.flag 'channel_id', desc: 'The channel to set the prefs for.' |
| 115 | + c.flag 'prefs', desc: 'The prefs for this channel in a stringified JSON format.' |
| 116 | + c.action do |_global_options, options, _args| |
| 117 | + puts JSON.dump($client.admin_conversations_setConversationPrefs(options)) |
| 118 | + end |
| 119 | + end |
| 120 | + |
| 121 | + g.desc 'Set the workspaces in an Enterprise grid org that connect to a public or private channel.' |
| 122 | + g.long_desc %( Set the workspaces in an Enterprise grid org that connect to a public or private channel. ) |
8 | 123 | g.command 'setTeams' do |c| |
9 | 124 | c.flag 'channel_id', desc: 'The encoded channel_id to add or remove to workspaces.' |
10 | 125 | c.flag 'org_channel', desc: 'True if channel has to be converted to an org channel.' |
|
14 | 129 | puts JSON.dump($client.admin_conversations_setTeams(options)) |
15 | 130 | end |
16 | 131 | end |
| 132 | + |
| 133 | + g.desc 'Unarchive a public or private channel.' |
| 134 | + g.long_desc %( Unarchive a public or private channel. ) |
| 135 | + g.command 'unarchive' do |c| |
| 136 | + c.flag 'channel_id', desc: 'The channel to unarchive.' |
| 137 | + c.action do |_global_options, options, _args| |
| 138 | + puts JSON.dump($client.admin_conversations_unarchive(options)) |
| 139 | + end |
| 140 | + end |
17 | 141 | end |
0 commit comments