dblock/slack-ruby-client

View on GitHub
bin/commands/admin_usergroups.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
  module Cli
    class App
      desc 'AdminUsergroups methods.'
      command 'admin_usergroups' do |g|
        g.desc 'Add up to one hundred default channels to an IDP group.'
        g.long_desc %( Add up to one hundred default channels to an IDP group. )
        g.command 'addChannels' do |c|
          c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.'
          c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.'
          c.flag 'team_id', desc: 'The workspace to add default channels in.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_usergroups_addChannels(options))
          end
        end

        g.desc 'Associate one or more default workspaces with an organization-wide IDP group.'
        g.long_desc %( Associate one or more default workspaces with an organization-wide IDP group. )
        g.command 'addTeams' do |c|
          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.'
          c.flag 'usergroup_id', desc: 'An encoded usergroup (IDP Group) ID.'
          c.flag 'auto_provision', desc: 'When true, this method automatically creates new workspace accounts for the IDP group members.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_usergroups_addTeams(options))
          end
        end

        g.desc 'List the channels linked to an org-level IDP group (user group).'
        g.long_desc %( List the channels linked to an org-level IDP group (user group). )
        g.command 'listChannels' do |c|
          c.flag 'usergroup_id', desc: 'ID of the IDP group to list default channels for.'
          c.flag 'include_num_members', desc: 'Flag to include or exclude the count of members per channel.'
          c.flag 'team_id', desc: 'ID of the the workspace.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_usergroups_listChannels(options))
          end
        end

        g.desc 'Remove one or more default channels from an org-level IDP group (user group).'
        g.long_desc %( Remove one or more default channels from an org-level IDP group (user group). )
        g.command 'removeChannels' do |c|
          c.flag 'channel_ids', desc: 'Comma-separated string of channel IDs.'
          c.flag 'usergroup_id', desc: 'ID of the IDP Group.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_usergroups_removeChannels(options))
          end
        end
      end
    end
  end
end