Module: Auth0::Api::V1::Connections

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

Overview

Instance Method Summary collapse

Instance Method Details

#connection(connection_name) ⇒ Object Also known as: get_connection


13
14
15
16
# File 'lib/auth0/api/v1/connections.rb', line 13

def connection(connection_name)
  path = "/api/connections/#{connection_name}"
  get(path)
end

#connectionsObject Also known as: get_connections


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

def connections
  get('/api/connections')
end

#create_connection(connection_name, strategy, tenant_domain, domain_aliases = nil) ⇒ Object


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

def create_connection(connection_name, strategy, tenant_domain, domain_aliases = nil)
  path = '/api/connections'
  request_params = {
    name: connection_name,
    strategy: strategy,
    options: {
      tenant_domain: tenant_domain,
      domain_aliases: domain_aliases
    }
  }
  post(path, request_params)
end

#delete_connection(connection_name) ⇒ Object


20
21
22
23
# File 'lib/auth0/api/v1/connections.rb', line 20

def delete_connection(connection_name)
  path = "/api/connections/#{connection_name}"
  delete(path)
end

#update_connection(connection_name, tenant_domain, status = true) ⇒ Object


40
41
42
43
44
45
46
47
48
49
# File 'lib/auth0/api/v1/connections.rb', line 40

def update_connection(connection_name, tenant_domain, status = true)
  path = "/api/connections/#{connection_name}"
  request_params = {
    status: status,
    options: {
      tenant_domain: tenant_domain
    }
  }
  put(path, request_params)
end