dblock/slack-ruby-client

View on GitHub
bin/commands/team.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 'Team methods.'
      command 'team' do |g|
        g.desc 'Gets the access logs for the current team.'
        g.long_desc %( Gets the access logs for the current team. )
        g.command 'accessLogs' do |c|
          c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).'
          c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
          c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. If specified, result is returned using a cursor-based approach instead of a classic one."
          c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.team_accessLogs(options))
          end
        end

        g.desc 'Gets billable users information for the current team.'
        g.long_desc %( Gets billable users information for the current team. )
        g.command 'billableInfo' do |c|
          c.flag 'cursor', desc: 'Set cursor to next_cursor returned by previous call, to indicate from where you want to list next page of users list. Default value fetches the first page.'
          c.flag 'limit', desc: 'The maximum number of items to return.'
          c.flag 'team_id', desc: 'encoded team id to get the billable information from, required if org token is used.'
          c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.team_billableInfo(options))
          end
        end

        g.desc 'Gets information about the current team.'
        g.long_desc %( Gets information about the current team. )
        g.command 'info' do |c|
          c.flag 'domain', desc: 'Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.'
          c.flag 'team', desc: 'Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.team_info(options))
          end
        end

        g.desc 'Gets the integration logs for the current team.'
        g.long_desc %( Gets the integration logs for the current team. )
        g.command 'integrationLogs' do |c|
          c.flag 'app_id', desc: 'Filter logs to this Slack app. Defaults to all logs.'
          c.flag 'change_type', desc: 'Filter logs with this change type. Defaults to all logs.'
          c.flag 'service_id', desc: 'Filter logs to this service. Defaults to all logs.'
          c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
          c.flag 'user', desc: "Filter logs generated by this user's actions. Defaults to all logs."
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.team_integrationLogs(options))
          end
        end
      end
    end
  end
end