Sha256: 1f5f60da4a490bdb7d76b25ca07f8ce8611c87374339020442b12234cba5f444

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

module Auth0
  module Api
    module V2
      module Connections
        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
        alias :get_connections :connections

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

        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

        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

        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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auth0-3.6.1 lib/auth0/api/v2/connections.rb
auth0-3.6.0 lib/auth0/api/v2/connections.rb