Module: Auth0::Api::V1::Logs

Included in:
Auth0::Api::V1
Defined in:
lib/auth0/api/v1/logs.rb

Overview

Instance Method Summary collapse

Instance Method Details

#log(id) ⇒ Object


21
22
23
24
# File 'lib/auth0/api/v1/logs.rb', line 21

def log(id)
  path = "/api/logs/#{id}"
  get(path)
end

#logs(options = {}) ⇒ Object Also known as: search_logs


7
8
9
10
11
12
13
14
15
16
# File 'lib/auth0/api/v1/logs.rb', line 7

def logs(options = {})
  acceptable_params = i(take from search_criteria page per_page sort fields exclude_fields)
  options.reject! do |key, value|
    next unless key.nil? || value.nil? || !acceptable_params.include?(key.to_sym)
    warn "#{key} is not in acceptable params list: #{acceptable_params}"
    true
  end
  path = "/api/logs?#{URI.encode_www_form(options)}"
  get(path)
end

#user_logs(user_id, page = 0, per_page = 50) ⇒ Object


27
28
29
30
# File 'lib/auth0/api/v1/logs.rb', line 27

def user_logs(user_id, page = 0, per_page = 50)
  path = "/api/users/#{user_id}/logs?page=#{page}&per_page=#{per_page}"
  get(path)
end