Module: Auth0::Api::V2::Connections

Included in:
Auth0::Api::V2
Defined in:
lib/auth0/api/v2/connections.rb

Instance Method Summary collapse

Instance Method Details

#connection(connection_id, fields: nil, include_fields: true) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/auth0/api/v2/connections.rb', line 22

def connection(connection_id, fields: nil, include_fields: true)
  path = "/api/v2/connections/" + connection_id.to_s
  request_params = {
    fields:         fields,
    include_fields: include_fields
  }
  get(path, request_params)
end

#connections(strategy: nil, fields: nil, include_fields: true) ⇒ Object Also known as: get_connections



5
6
7
8
9
10
11
12
13
# File 'lib/auth0/api/v2/connections.rb', line 5

def connections(strategy: nil, fields: nil, include_fields: true)
  request_params = {
    strategy: strategy,
    fields: fields,
    include_fields: include_fields
  }
  path = "/api/v2/connections"
  get(path, request_params)
end

#create_connection(body) ⇒ Object



16
17
18
19
20
# File 'lib/auth0/api/v2/connections.rb', line 16

def create_connection(body)
  path = "/api/v2/connections"
  request_params = body
  post(path, request_params )
end

#delete_connection(connection_id) ⇒ Object



31
32
33
34
35
# File 'lib/auth0/api/v2/connections.rb', line 31

def delete_connection(connection_id)
  raise Auth0::MissingConnectionId, "you must specify a connection id" if connection_id.to_s.empty?
  path = "/api/v2/connections/#{connection_id}"
  delete(path)
end

#update_connection(connection_id, body) ⇒ Object



37
38
39
40
41
# File 'lib/auth0/api/v2/connections.rb', line 37

def update_connection(connection_id, body)
  raise Auth0::MissingConnectionId, "you must specify a connection id" if connection_id.to_s.empty?
  path = "/api/v2/connections/" + connection_id.to_s
  patch(path, body)
end