Sha256: 9b993d5312936e376cf1a1aa998da437fa7bfefe029ad2ac28426f3a383efb47

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

module Auth0
  module Api
    module V1
      # https://auth0.com/docs/api#rules
      module Rules
        # https://auth0.com/docs/api#!#get--api-rules
        def rules
          path = "/api/rules"
          get(path)
        end

        alias :get_rules :rules

        # https://auth0.com/docs/api#!#post--api-rules
        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

        # https://auth0.com/docs/api#!#put--api-rules--rule-name-
        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

        # https://auth0.com/docs/api#!#delete--api-rules--rule-name-
        def delete_rule(name)
          path = "/api/rules/#{name}"
          delete(path)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
auth0-3.3.0 lib/auth0/api/v1/rules.rb
auth0-3.2.0 lib/auth0/api/v1/rules.rb
auth0-3.1.2 lib/auth0/api/v1/rules.rb
auth0-3.1.1 lib/auth0/api/v1/rules.rb
auth0-3.1.0 lib/auth0/api/v1/rules.rb
auth0-3.0.0 lib/auth0/api/v1/rules.rb
auth0-ruby-0.10 lib/auth0/api/v1/rules.rb
auth0-ruby-0.9.1 lib/auth0/api/v1/rules.rb
auth0-ruby-0.9 lib/auth0/api/v1/rules.rb