Class: Seam::Clients::Phones

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ Phones

Returns a new instance of Phones.



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

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

Instance Method Details

#deactivate(device_id:) ⇒ Object



15
16
17
18
19
# File 'lib/seam/routes/clients/phones.rb', line 15

def deactivate(device_id:)
  @client.post("/phones/deactivate", {device_id: device_id}.compact)

  nil
end

#get(device_id:) ⇒ Object



21
22
23
24
25
# File 'lib/seam/routes/clients/phones.rb', line 21

def get(device_id:)
  res = @client.post("/phones/get", {device_id: device_id}.compact)

  Seam::Resources::Phone.load_from_response(res.body["phone"])
end

#list(acs_credential_id: nil, owner_user_identity_id: nil) ⇒ Object



27
28
29
30
31
# File 'lib/seam/routes/clients/phones.rb', line 27

def list(acs_credential_id: nil, owner_user_identity_id: nil)
  res = @client.post("/phones/list", {acs_credential_id: acs_credential_id, owner_user_identity_id: owner_user_identity_id}.compact)

  Seam::Resources::Phone.load_from_response(res.body["phones"])
end

#simulateObject



11
12
13
# File 'lib/seam/routes/clients/phones.rb', line 11

def simulate
  @simulate ||= Seam::Clients::PhonesSimulate.new(client: @client, defaults: @defaults)
end