Class: Seam::Clients::Phones
- Inherits:
-
Object
- Object
- Seam::Clients::Phones
- Defined in:
- lib/seam/routes/phones.rb
Instance Method Summary collapse
-
#deactivate(device_id:) ⇒ nil
Deactivates a phone, which is useful, for example, if a user has lost their phone.
-
#get(device_id:) ⇒ Seam::Resources::Phone
Returns a specified phone.
-
#initialize(client:, defaults:) ⇒ Phones
constructor
A new instance of Phones.
-
#list(acs_credential_id: nil, owner_user_identity_id: nil) ⇒ Seam::Resources::Phone
Returns a list of all phones.
- #simulate ⇒ Object
Constructor Details
#initialize(client:, defaults:) ⇒ Phones
Returns a new instance of Phones.
6 7 8 9 |
# File 'lib/seam/routes/phones.rb', line 6 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#deactivate(device_id:) ⇒ nil
Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see App User Lost Phone Process.
18 19 20 21 22 |
# File 'lib/seam/routes/phones.rb', line 18 def deactivate(device_id:) @client.post("/phones/deactivate", {device_id: device_id}.compact) nil end |
#get(device_id:) ⇒ Seam::Resources::Phone
Returns a specified phone.
27 28 29 30 31 |
# File 'lib/seam/routes/phones.rb', line 27 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) ⇒ Seam::Resources::Phone
Returns a list of all phones. To filter the list of returned phones by a specific owner user identity or credential, include the owner_user_identity_id or acs_credential_id, respectively, in the request body.
37 38 39 40 41 |
# File 'lib/seam/routes/phones.rb', line 37 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 |
#simulate ⇒ Object
11 12 13 |
# File 'lib/seam/routes/phones.rb', line 11 def simulate @simulate ||= Seam::Clients::PhonesSimulate.new(client: @client, defaults: @defaults) end |