Class: MagicLinksClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/magic_links_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ MagicLinksClient

Initialize the MagicLinksClient class with an API client instance.

Parameters:

  • connection (LockstepApi)

    The API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/magic_links_client.rb', line 22

def initialize(connection)
    @connection = connection
end

Instance Method Details

Queries Magic Links for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.

Parameters:

  • filter (string)

    The filter for this query. See [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight)

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: User

  • order (string)

    The sort order for the results, in the [Searchlight order syntax](github.com/tspence/csharp-searchlight).

  • page_size (int32)

    The page size for results (default 250, maximum of 500)

  • page_number (int32)

    The page number for results (default 0)



57
58
59
60
61
# File 'lib/lockstep_sdk/clients/magic_links_client.rb', line 57

def query_magic_links(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/useraccounts/magic-links/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @connection.request(:get, path, nil, params)
end

Retrieves the Magic Link specified by this unique identifier, optionally including nested data sets.

Parameters:

  • id (uuid)

    The id of the Magic Link

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: User



32
33
34
35
36
# File 'lib/lockstep_sdk/clients/magic_links_client.rb', line 32

def retrieve_magic_link(id:, include_param:)
    path = "/api/v1/useraccounts/magic-links/#{id}"
    params = {:include => include_param}
    @connection.request(:get, path, nil, params)
end

Revokes the magic link with the specified id so it cannot be used to call the API.

Revocation will be received by all servers within five minutes of revocation. API calls made using this magic link after the revocation will fail. A revoked magic link cannot be un-revoked.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this magic link



44
45
46
47
# File 'lib/lockstep_sdk/clients/magic_links_client.rb', line 44

def revoke_magic_link(id:)
    path = "/api/v1/useraccounts/magic-links/#{id}"
    @connection.request(:delete, path, nil, nil)
end