slack-ruby/slack-ruby-client

View on GitHub
lib/slack/web/api/endpoints/apps_activities.rb

Summary

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

module Slack
  module Web
    module Api
      module Endpoints
        module AppsActivities
          #
          # Get logs for a specified app
          #
          # @option options [Object] :app_id
          #   The id of the app to get activities from.
          # @option options [string] :component_id
          #   The component id of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows.
          # @option options [string] :component_type
          #   The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables').
          # @option options [string] :cursor
          #   Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail.
          # @option options [integer] :limit
          #   The maximum number of items to return.
          # @option options [string] :log_event_type
          #   The event type of log events to be returned.
          # @option options [integer] :max_date_created
          #   The latest timestamp of the log to retrieve (epoch microseconds).
          # @option options [integer] :min_date_created
          #   The earliest timestamp of the log to retrieve (epoch microseconds).
          # @option options [string] :min_log_level
          #   The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal').
          # @option options [enum] :sort_direction
          #   The direction you want the data sorted by (always by timestamp).
          # @option options [string] :source
          #   The source of log events to be returned. Acceptable values are ('slack', 'developer').
          # @option options [string] :team_id
          #   The team who owns this log.
          # @option options [string] :trace_id
          #   The trace id of log events to be returned.
          # @see https://api.slack.com/methods/apps.activities.list
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.activities/apps.activities.list.json
          def apps_activities_list(options = {})
            raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
            if block_given?
              Pagination::Cursor.new(self, :apps_activities_list, options).each do |page|
                yield page
              end
            else
              post('apps.activities.list', options)
            end
          end
        end
      end
    end
  end
end