Module: Auth0::Api::V1::Rules

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

Overview

Instance Method Summary collapse

Instance Method Details

#create_rule(name, script, order = nil, status = true) ⇒ Object


15
16
17
18
19
20
21
22
23
24
# File 'lib/auth0/api/v1/rules.rb', line 15

def create_rule(name, script, order = nil, status = true)
  path = '/api/rules'
  request_params = {
    name: name,
    status: status,
    script: script,
    order: order
  }
  post(path, request_params)
end

#delete_rule(name) ⇒ Object


38
39
40
41
# File 'lib/auth0/api/v1/rules.rb', line 38

def delete_rule(name)
  path = "/api/rules/#{name}"
  delete(path)
end

#rulesObject Also known as: get_rules


7
8
9
10
# File 'lib/auth0/api/v1/rules.rb', line 7

def rules
  path = '/api/rules'
  get(path)
end

#update_rule(name, script, order = nil, status = true) ⇒ Object


27
28
29
30
31
32
33
34
35
# File 'lib/auth0/api/v1/rules.rb', line 27

def update_rule(name, script, order = nil, status = true)
  path = "/api/rules/#{name}"
  request_params = {
    status: status,
    script: script,
    order: order
  }
  put(path, request_params)
end