Class: Seam::Clients::Devices

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ Devices

Returns a new instance of Devices.



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

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

Instance Method Details

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



19
20
21
22
23
# File 'lib/seam/routes/clients/devices.rb', line 19

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

  Seam::Resources::Device.load_from_response(res.body["device"])
end

#list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) ⇒ Object



25
26
27
28
29
# File 'lib/seam/routes/clients/devices.rb', line 25

def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
  res = @client.post("/devices/list", {connect_webview_id: connect_webview_id, connected_account_id: , connected_account_ids: , created_before: created_before, custom_metadata_has: , customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)

  Seam::Resources::Device.load_from_response(res.body["devices"])
end

#list_device_providers(provider_category: nil) ⇒ Object



31
32
33
34
35
# File 'lib/seam/routes/clients/devices.rb', line 31

def list_device_providers(provider_category: nil)
  res = @client.post("/devices/list_device_providers", {provider_category: provider_category}.compact)

  Seam::Resources::DeviceProvider.load_from_response(res.body["device_providers"])
end

#simulateObject



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

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

#unmanagedObject



15
16
17
# File 'lib/seam/routes/clients/devices.rb', line 15

def unmanaged
  @unmanaged ||= Seam::Clients::DevicesUnmanaged.new(client: @client, defaults: @defaults)
end

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



37
38
39
40
41
# File 'lib/seam/routes/clients/devices.rb', line 37

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

  nil
end