slack-ruby/slack-ruby-client

View on GitHub
bin/commands/admin_apps.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 'AdminApps methods.'
      command 'admin_apps' do |g|
        g.desc 'Approve an app for installation on a workspace.'
        g.long_desc %( Approve an app for installation on a workspace. )
        g.command 'approve' do |c|
          c.flag 'app_id', desc: 'The id of the app to approve.'
          c.flag 'enterprise_id', desc: 'The ID of the enterprise to approve the app on.'
          c.flag 'request_id', desc: 'The id of the request to approve.'
          c.flag 'team_id', desc: 'The ID of the workspace to approve the app on.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_apps_approve(options))
          end
        end

        g.desc 'Clear an app resolution'
        g.long_desc %( Clear an app resolution )
        g.command 'clearResolution' do |c|
          c.flag 'app_id', desc: 'The id of the app whose resolution you want to clear/undo.'
          c.flag 'enterprise_id', desc: 'The enterprise to clear the app resolution from.'
          c.flag 'team_id', desc: 'The workspace to clear the app resolution from.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_apps_clearResolution(options))
          end
        end

        g.desc 'Restrict an app for installation on a workspace.'
        g.long_desc %( Restrict an app for installation on a workspace. )
        g.command 'restrict' do |c|
          c.flag 'app_id', desc: 'The id of the app to restrict.'
          c.flag 'enterprise_id', desc: 'The ID of the enterprise to approve the app on.'
          c.flag 'request_id', desc: 'The id of the request to restrict.'
          c.flag 'team_id', desc: 'The ID of the workspace to approve the app on.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_apps_restrict(options))
          end
        end

        g.desc 'Uninstall an app from one or many workspaces, or an entire enterprise organization.'
        g.long_desc %( Uninstall an app from one or many workspaces, or an entire enterprise organization. )
        g.command 'uninstall' do |c|
          c.flag 'app_id', desc: 'The ID of the app to uninstall.'
          c.flag 'enterprise_id', desc: 'The enterprise to completely uninstall the application from (across all workspaces). With an org-level token, this or team_ids is required.'
          c.flag 'team_ids', desc: 'IDs of the teams to uninstall from (max 100). With an org-level token, this or enterprise_id is required.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.admin_apps_uninstall(options))
          end
        end
      end
    end
  end
end