Class: Seam::Clients::InstantKeys

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/clients/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/clients/instant_keys.rb', line 6

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

Instance Method Details

#delete(instant_key_id:) ⇒ Object



11
12
13
14
15
# File 'lib/seam/routes/clients/instant_keys.rb', line 11

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) ⇒ Object



17
18
19
20
21
# File 'lib/seam/routes/clients/instant_keys.rb', line 17

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) ⇒ Object



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

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