Class: Seam::Clients::Devices

Inherits:
BaseClient show all
Defined in:
lib/seam/clients/devices.rb

Instance Attribute Summary

Attributes inherited from BaseClient

#client

Instance Method Summary collapse

Methods inherited from BaseClient

#initialize, #request_seam, #request_seam_object

Constructor Details

This class inherits a constructor from Seam::Clients::BaseClient

Instance Method Details

#delete(device_id:) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/seam/clients/devices.rb', line 14

def delete(device_id:)
  request_seam(
    :post,
    "/devices/delete",
    body: {device_id: device_id}.compact
  )

  nil
end

#get(device_id: nil, name: nil) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/seam/clients/devices.rb', line 24

def get(device_id: nil, name: nil)
  request_seam_object(
    :post,
    "/devices/get",
    Seam::Device,
    "device",
    body: {device_id: device_id, name: name}.compact
  )
end

#list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, device_ids: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, user_identifier_key: nil) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/seam/clients/devices.rb', line 34

def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, device_ids: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, user_identifier_key: nil)
  request_seam_object(
    :post,
    "/devices/list",
    Seam::Device,
    "devices",
    body: {connect_webview_id: connect_webview_id, connected_account_id: , connected_account_ids: , created_before: created_before, custom_metadata_has: , device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact
  )
end

#list_device_providers(provider_category: nil) ⇒ Object



44
45
46
47
48
49
50
51
52
# File 'lib/seam/clients/devices.rb', line 44

def list_device_providers(provider_category: nil)
  request_seam_object(
    :post,
    "/devices/list_device_providers",
    Seam::DeviceProvider,
    "device_providers",
    body: {provider_category: provider_category}.compact
  )
end

#simulateObject



6
7
8
# File 'lib/seam/clients/devices.rb', line 6

def simulate
  @simulate ||= Seam::Clients::DevicesSimulate.new(self)
end

#unmanagedObject



10
11
12
# File 'lib/seam/clients/devices.rb', line 10

def unmanaged
  @unmanaged ||= Seam::Clients::DevicesUnmanaged.new(self)
end

#update(device_id:, custom_metadata: nil, is_managed: nil, name: nil, properties: nil) ⇒ Object



54
55
56
57
58
59
60
61
62
# File 'lib/seam/clients/devices.rb', line 54

def update(device_id:, custom_metadata: nil, is_managed: nil, name: nil, properties: nil)
  request_seam(
    :post,
    "/devices/update",
    body: {device_id: device_id, custom_metadata: , is_managed: is_managed, name: name, properties: properties}.compact
  )

  nil
end