slack-ruby/slack-ruby-client

View on GitHub
bin/commands/workflows_triggers_permissions.rb

Summary

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

module Slack
  module Cli
    class App
      desc 'WorkflowsTriggersPermissions methods.'
      command 'workflows_triggers_permissions' do |g|
        g.desc 'Allows users to run a trigger that has its permission type set to named_entities'
        g.long_desc %( Allows users to run a trigger that has its permission type set to named_entities )
        g.command 'add' do |c|
          c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
          c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
          c.flag 'org_ids', desc: 'List of encoded organization IDs.'
          c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
          c.flag 'user_ids', desc: 'List of encoded user IDs.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.workflows_triggers_permissions_add(options))
          end
        end

        g.desc 'Returns the permission type of a trigger and if applicable, includes the entities that have been granted access'
        g.long_desc %( Returns the permission type of a trigger and if applicable, includes the entities that have been granted access )
        g.command 'list' do |c|
          c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.workflows_triggers_permissions_list(options))
          end
        end

        g.desc "Revoke an entity's access to a trigger that has its permission type set to named_entities"
        g.long_desc %( Revoke an entity's access to a trigger that has its permission type set to named_entities )
        g.command 'remove' do |c|
          c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
          c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
          c.flag 'org_ids', desc: 'List of encoded organization IDs.'
          c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
          c.flag 'user_ids', desc: 'List of encoded user IDs.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.workflows_triggers_permissions_remove(options))
          end
        end

        g.desc 'Set the permission type for who can run a trigger'
        g.long_desc %( Set the permission type for who can run a trigger )
        g.command 'set' do |c|
          c.flag 'permission_type', desc: 'The type of permission that defines who can run a trigger.'
          c.flag 'trigger_id', desc: 'Encoded ID of the trigger.'
          c.flag 'channel_ids', desc: 'List of encoded channel IDs.'
          c.flag 'org_ids', desc: 'List of encoded organization IDs.'
          c.flag 'team_ids', desc: 'List of encoded workspace IDs.'
          c.flag 'user_ids', desc: 'List of encoded user IDs.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.workflows_triggers_permissions_set(options))
          end
        end
      end
    end
  end
end