Class: Seam::Clients::InstantKeys

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/instant_keys.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ InstantKeys

Returns a new instance of InstantKeys.



6
7
8
9
# File 'lib/seam/routes/instant_keys.rb', line 6

def initialize(client:, defaults:)
  @client = client
  @defaults = defaults
end

Instance Method Details

#delete(instant_key_id:) ⇒ nil

Deletes a specified Instant Key.

Parameters:

  • instant_key_id

    ID of the Instant Key that you want to delete.

Returns:

  • (nil)

    OK



14
15
16
17
18
# File 'lib/seam/routes/instant_keys.rb', line 14

def delete(instant_key_id:)
  @client.post("/instant_keys/delete", {instant_key_id: instant_key_id}.compact)

  nil
end

#get(instant_key_id: nil, instant_key_url: nil) ⇒ Seam::Resources::InstantKey

Gets an instant key.

Parameters:

  • instant_key_id (defaults to: nil)

    ID of the instant key to get.

  • instant_key_url (defaults to: nil)

    URL of the instant key to get.

Returns:



24
25
26
27
28
# File 'lib/seam/routes/instant_keys.rb', line 24

def get(instant_key_id: nil, instant_key_url: nil)
  res = @client.post("/instant_keys/get", {instant_key_id: instant_key_id, instant_key_url: instant_key_url}.compact)

  Seam::Resources::InstantKey.load_from_response(res.body["instant_key"])
end

#list(user_identity_id: nil) ⇒ Seam::Resources::InstantKey

Returns a list of all instant keys.

Parameters:

  • user_identity_id (defaults to: nil)

    ID of the user identity by which you want to filter the list of Instant Keys.

Returns:



33
34
35
36
37
# File 'lib/seam/routes/instant_keys.rb', line 33

def list(user_identity_id: nil)
  res = @client.post("/instant_keys/list", {user_identity_id: user_identity_id}.compact)

  Seam::Resources::InstantKey.load_from_response(res.body["instant_keys"])
end