seam 2.131.0 → 2.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/seam/http_multi_workspace.rb +2 -2
  4. data/lib/seam/http_single_workspace.rb +2 -2
  5. data/lib/seam/resources/access_code.rb +67 -0
  6. data/lib/seam/resources/access_grant.rb +51 -0
  7. data/lib/seam/resources/access_method.rb +46 -0
  8. data/lib/seam/resources/acs_access_group.rb +45 -0
  9. data/lib/seam/resources/acs_credential.rb +73 -0
  10. data/lib/seam/resources/acs_encoder.rb +37 -0
  11. data/lib/seam/resources/acs_entrance.rb +61 -0
  12. data/lib/seam/resources/acs_system.rb +54 -0
  13. data/lib/seam/resources/acs_user.rb +63 -0
  14. data/lib/seam/resources/action_attempt.rb +18 -0
  15. data/lib/seam/resources/batch.rb +134 -0
  16. data/lib/seam/resources/client_session.rb +44 -0
  17. data/lib/seam/resources/connect_webview.rb +59 -0
  18. data/lib/seam/resources/connected_account.rb +46 -0
  19. data/lib/seam/resources/customer_portal.rb +25 -0
  20. data/lib/seam/resources/device.rb +83 -0
  21. data/lib/seam/resources/device_provider.rb +56 -0
  22. data/lib/seam/resources/event.rb +193 -0
  23. data/lib/seam/{routes/resources → resources}/index.rb +3 -0
  24. data/lib/seam/resources/instant_key.rb +31 -0
  25. data/lib/seam/resources/noise_threshold.rb +23 -0
  26. data/lib/seam/resources/pagination.rb +15 -0
  27. data/lib/seam/resources/phone.rb +29 -0
  28. data/lib/seam/resources/space.rb +32 -0
  29. data/lib/seam/resources/thermostat_daily_program.rb +22 -0
  30. data/lib/seam/resources/thermostat_schedule.rb +34 -0
  31. data/lib/seam/resources/unmanaged_access_code.rb +53 -0
  32. data/lib/seam/resources/unmanaged_access_grant.rb +43 -0
  33. data/lib/seam/resources/unmanaged_access_method.rb +40 -0
  34. data/lib/seam/resources/unmanaged_device.rb +73 -0
  35. data/lib/seam/resources/unmanaged_user_identity.rb +29 -0
  36. data/lib/seam/resources/user_identity.rb +31 -0
  37. data/lib/seam/resources/webhook.rb +17 -0
  38. data/lib/seam/resources/workspace.rb +28 -0
  39. data/lib/seam/routes/access_codes.rb +227 -0
  40. data/lib/seam/routes/access_codes_simulate.rb +23 -0
  41. data/lib/seam/routes/access_codes_unmanaged.rb +76 -0
  42. data/lib/seam/routes/access_grants.rb +117 -0
  43. data/lib/seam/routes/access_grants_unmanaged.rb +50 -0
  44. data/lib/seam/routes/access_methods.rb +101 -0
  45. data/lib/seam/routes/access_methods_unmanaged.rb +33 -0
  46. data/lib/seam/routes/acs_access_groups.rb +82 -0
  47. data/lib/seam/routes/acs_credentials.rb +109 -0
  48. data/lib/seam/routes/{clients/acs_encoders.rb → acs_encoders.rb} +25 -0
  49. data/lib/seam/routes/acs_encoders_simulate.rb +55 -0
  50. data/lib/seam/routes/acs_entrances.rb +76 -0
  51. data/lib/seam/routes/acs_systems.rb +56 -0
  52. data/lib/seam/routes/acs_users.rb +150 -0
  53. data/lib/seam/routes/{clients/action_attempts.rb → action_attempts.rb} +9 -0
  54. data/lib/seam/routes/client_sessions.rb +102 -0
  55. data/lib/seam/routes/connect_webviews.rb +72 -0
  56. data/lib/seam/routes/connected_accounts.rb +77 -0
  57. data/lib/seam/routes/{clients/connected_accounts_simulate.rb → connected_accounts_simulate.rb} +3 -0
  58. data/lib/seam/routes/customers.rb +87 -0
  59. data/lib/seam/routes/devices.rb +95 -0
  60. data/lib/seam/routes/devices_simulate.rb +76 -0
  61. data/lib/seam/routes/devices_unmanaged.rb +66 -0
  62. data/lib/seam/routes/events.rb +59 -0
  63. data/lib/seam/routes/{clients/instant_keys.rb → instant_keys.rb} +10 -0
  64. data/lib/seam/routes/locks.rb +89 -0
  65. data/lib/seam/routes/{clients/locks_simulate.rb → locks_simulate.rb} +7 -0
  66. data/lib/seam/routes/noise_sensors.rb +45 -0
  67. data/lib/seam/routes/noise_sensors_noise_thresholds.rb +69 -0
  68. data/lib/seam/routes/noise_sensors_simulate.rb +21 -0
  69. data/lib/seam/routes/phones.rb +44 -0
  70. data/lib/seam/routes/phones_simulate.rb +24 -0
  71. data/lib/seam/routes/spaces.rb +145 -0
  72. data/lib/seam/routes/thermostats.rb +238 -0
  73. data/lib/seam/routes/{clients/thermostats_daily_programs.rb → thermostats_daily_programs.rb} +13 -0
  74. data/lib/seam/routes/thermostats_schedules.rb +70 -0
  75. data/lib/seam/routes/thermostats_simulate.rb +37 -0
  76. data/lib/seam/routes/user_identities.rb +167 -0
  77. data/lib/seam/routes/user_identities_unmanaged.rb +46 -0
  78. data/lib/seam/routes/{clients/webhooks.rb → webhooks.rb} +16 -0
  79. data/lib/seam/routes/workspaces.rb +77 -0
  80. data/lib/seam/version.rb +1 -1
  81. data/lib/seam/webhook.rb +1 -1
  82. metadata +83 -80
  83. data/lib/seam/routes/clients/access_codes.rb +0 -80
  84. data/lib/seam/routes/clients/access_codes_simulate.rb +0 -18
  85. data/lib/seam/routes/clients/access_codes_unmanaged.rb +0 -42
  86. data/lib/seam/routes/clients/access_grants.rb +0 -58
  87. data/lib/seam/routes/clients/access_grants_unmanaged.rb +0 -30
  88. data/lib/seam/routes/clients/access_methods.rb +0 -66
  89. data/lib/seam/routes/clients/access_methods_unmanaged.rb +0 -24
  90. data/lib/seam/routes/clients/acs_access_groups.rb +0 -54
  91. data/lib/seam/routes/clients/acs_credentials.rb +0 -60
  92. data/lib/seam/routes/clients/acs_encoders_simulate.rb +0 -36
  93. data/lib/seam/routes/clients/acs_entrances.rb +0 -46
  94. data/lib/seam/routes/clients/acs_systems.rb +0 -36
  95. data/lib/seam/routes/clients/acs_users.rb +0 -78
  96. data/lib/seam/routes/clients/client_sessions.rb +0 -54
  97. data/lib/seam/routes/clients/connect_webviews.rb +0 -36
  98. data/lib/seam/routes/clients/connected_accounts.rb +0 -46
  99. data/lib/seam/routes/clients/customers.rb +0 -30
  100. data/lib/seam/routes/clients/devices.rb +0 -50
  101. data/lib/seam/routes/clients/devices_simulate.rb +0 -48
  102. data/lib/seam/routes/clients/devices_unmanaged.rb +0 -30
  103. data/lib/seam/routes/clients/events.rb +0 -24
  104. data/lib/seam/routes/clients/locks.rb +0 -54
  105. data/lib/seam/routes/clients/noise_sensors.rb +0 -26
  106. data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +0 -42
  107. data/lib/seam/routes/clients/noise_sensors_simulate.rb +0 -18
  108. data/lib/seam/routes/clients/phones.rb +0 -34
  109. data/lib/seam/routes/clients/phones_simulate.rb +0 -18
  110. data/lib/seam/routes/clients/spaces.rb +0 -84
  111. data/lib/seam/routes/clients/thermostats.rb +0 -126
  112. data/lib/seam/routes/clients/thermostats_schedules.rb +0 -42
  113. data/lib/seam/routes/clients/thermostats_simulate.rb +0 -24
  114. data/lib/seam/routes/clients/user_identities.rb +0 -100
  115. data/lib/seam/routes/clients/user_identities_unmanaged.rb +0 -30
  116. data/lib/seam/routes/clients/workspaces.rb +0 -46
  117. data/lib/seam/routes/resources/access_code.rb +0 -14
  118. data/lib/seam/routes/resources/access_grant.rb +0 -14
  119. data/lib/seam/routes/resources/access_method.rb +0 -14
  120. data/lib/seam/routes/resources/acs_access_group.rb +0 -14
  121. data/lib/seam/routes/resources/acs_credential.rb +0 -14
  122. data/lib/seam/routes/resources/acs_encoder.rb +0 -13
  123. data/lib/seam/routes/resources/acs_entrance.rb +0 -14
  124. data/lib/seam/routes/resources/acs_system.rb +0 -14
  125. data/lib/seam/routes/resources/acs_user.rb +0 -14
  126. data/lib/seam/routes/resources/action_attempt.rb +0 -9
  127. data/lib/seam/routes/resources/batch.rb +0 -9
  128. data/lib/seam/routes/resources/client_session.rb +0 -11
  129. data/lib/seam/routes/resources/connect_webview.rb +0 -11
  130. data/lib/seam/routes/resources/connected_account.rb +0 -14
  131. data/lib/seam/routes/resources/customer_portal.rb +0 -11
  132. data/lib/seam/routes/resources/device.rb +0 -14
  133. data/lib/seam/routes/resources/device_provider.rb +0 -9
  134. data/lib/seam/routes/resources/event.rb +0 -11
  135. data/lib/seam/routes/resources/instant_key.rb +0 -11
  136. data/lib/seam/routes/resources/noise_threshold.rb +0 -9
  137. data/lib/seam/routes/resources/pagination.rb +0 -9
  138. data/lib/seam/routes/resources/phone.rb +0 -14
  139. data/lib/seam/routes/resources/space.rb +0 -11
  140. data/lib/seam/routes/resources/thermostat_daily_program.rb +0 -11
  141. data/lib/seam/routes/resources/thermostat_schedule.rb +0 -13
  142. data/lib/seam/routes/resources/unmanaged_access_code.rb +0 -14
  143. data/lib/seam/routes/resources/unmanaged_device.rb +0 -14
  144. data/lib/seam/routes/resources/user_identity.rb +0 -14
  145. data/lib/seam/routes/resources/webhook.rb +0 -9
  146. data/lib/seam/routes/resources/workspace.rb +0 -9
  147. /data/lib/seam/{routes/resources → resources}/resource_error.rb +0 -0
  148. /data/lib/seam/{routes/resources → resources}/resource_errors_support.rb +0 -0
  149. /data/lib/seam/{routes/resources → resources}/resource_warning.rb +0 -0
  150. /data/lib/seam/{routes/resources → resources}/resource_warnings_support.rb +0 -0
  151. /data/lib/seam/routes/{clients/acs.rb → acs.rb} +0 -0
  152. /data/lib/seam/routes/{clients/index.rb → index.rb} +0 -0
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class Devices
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ def simulate
12
+ @simulate ||= Seam::Clients::DevicesSimulate.new(client: @client, defaults: @defaults)
13
+ end
14
+
15
+ def unmanaged
16
+ @unmanaged ||= Seam::Clients::DevicesUnmanaged.new(client: @client, defaults: @defaults)
17
+ end
18
+
19
+ # Returns a specified [device](https://docs.seam.co/core-concepts/devices).
20
+ #
21
+ # You must specify either `device_id` or `name`.
22
+ # @param device_id ID of the device that you want to get.
23
+ # @param name Name of the device that you want to get.
24
+ # @return [Seam::Resources::Device] OK
25
+ def get(device_id: nil, name: nil)
26
+ res = @client.post("/devices/get", {device_id: device_id, name: name}.compact)
27
+
28
+ Seam::Resources::Device.load_from_response(res.body["device"])
29
+ end
30
+
31
+ # Returns a list of all [devices](https://docs.seam.co/core-concepts/devices).
32
+ # @param connect_webview_id ID of the Connect Webview for which you want to list devices.
33
+ # @param connected_account_id ID of the connected account for which you want to list devices.
34
+ # @param connected_account_ids Array of IDs of the connected accounts for which you want to list devices.
35
+ # @param created_before Timestamp by which to limit returned devices. Returns devices created before this timestamp.
36
+ # @param custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices.
37
+ # @param customer_key Customer key for which you want to list devices.
38
+ # @param device_ids Array of device IDs for which you want to list devices.
39
+ # @param device_type Device type for which you want to list devices.
40
+ # @param device_types Array of device types for which you want to list devices.
41
+ # @param limit Numerical limit on the number of devices to return.
42
+ # @param manufacturer Manufacturer for which you want to list devices.
43
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
44
+ # @param search String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`.
45
+ # @param space_id ID of the space for which you want to list devices.
46
+ # @param unstable_location_id
47
+ # @deprecated unstable_location_id: Use `space_id`.
48
+ # @param user_identifier_key Your own internal user ID for the user for which you want to list devices.
49
+ # @return [Seam::Resources::Device] OK
50
+ 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, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
51
+ res = @client.post("/devices/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, 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)
52
+
53
+ Seam::Resources::Device.load_from_response(res.body["devices"])
54
+ end
55
+
56
+ # Returns a list of all device providers.
57
+ #
58
+ # The information that this endpoint returns for each provider includes a set of [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags), such as `device_provider.can_remotely_unlock`. If at least one supported device from a provider has a specific capability, the corresponding capability flag is `true`.
59
+ #
60
+ # When you create a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews), you can customize the providers—that is, the brands—that it displays. In the `/connect_webviews/create` request, include the desired set of device provider keys in the `accepted_providers` parameter. See also [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews).
61
+ # @param provider_category Category for which you want to list providers.
62
+ # @return [Seam::Resources::DeviceProvider] OK
63
+ def list_device_providers(provider_category: nil)
64
+ res = @client.post("/devices/list_device_providers", {provider_category: provider_category}.compact)
65
+
66
+ Seam::Resources::DeviceProvider.load_from_response(res.body["device_providers"])
67
+ end
68
+
69
+ # Updates provider-specific metadata for devices.
70
+ # @param devices Array of devices with provider metadata to update
71
+ # @return [nil] OK
72
+ def report_provider_metadata(devices:)
73
+ @client.post("/devices/report_provider_metadata", {devices: devices}.compact)
74
+
75
+ nil
76
+ end
77
+
78
+ # Updates a specified [device](https://docs.seam.co/core-concepts/devices).
79
+ #
80
+ # You can add or change [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for a device, change the device's name, or [convert a managed device to unmanaged](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices).
81
+ # @param device_id ID of the device that you want to update.
82
+ # @param backup_access_code_pool_enabled Indicates whether the device's [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) is enabled. Set to `false` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use.
83
+ # @param custom_metadata Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. [Adding custom metadata to a device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter devices by the desired metadata](https://docs.seam.co/core-concepts/devices/filtering-devices-by-custom-metadata).
84
+ # @param is_managed Indicates whether the device is managed. To unmanage a device, set `is_managed` to `false`.
85
+ # @param name Name for the device.
86
+ # @param properties
87
+ # @return [nil] OK
88
+ def update(device_id:, backup_access_code_pool_enabled: nil, custom_metadata: nil, is_managed: nil, name: nil, properties: nil)
89
+ @client.post("/devices/update", {device_id: device_id, backup_access_code_pool_enabled: backup_access_code_pool_enabled, custom_metadata: custom_metadata, is_managed: is_managed, name: name, properties: properties}.compact)
90
+
91
+ nil
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class DevicesSimulate
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal).
12
+ # @param device_id ID of the device that you want to simulate connecting to Seam.
13
+ # @return [nil] OK
14
+ def connect(device_id:)
15
+ @client.post("/devices/simulate/connect", {device_id: device_id}.compact)
16
+
17
+ nil
18
+ end
19
+
20
+ # Simulates bringing the Wi‑Fi hub (bridge) back online for a device.
21
+ # Only applicable for sandbox workspaces and currently
22
+ # implemented for August and TTLock locks.
23
+ # This will clear the `hub_disconnected` error on the device.
24
+ # @param device_id ID of the device whose hub you want to reconnect.
25
+ # @return [nil] OK
26
+ def connect_to_hub(device_id:)
27
+ @client.post("/devices/simulate/connect_to_hub", {device_id: device_id}.compact)
28
+
29
+ nil
30
+ end
31
+
32
+ # Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal).
33
+ # @param device_id ID of the device that you want to simulate disconnecting from Seam.
34
+ # @return [nil] OK
35
+ def disconnect(device_id:)
36
+ @client.post("/devices/simulate/disconnect", {device_id: device_id}.compact)
37
+
38
+ nil
39
+ end
40
+
41
+ # Simulates taking the Wi‑Fi hub (bridge) offline for a device.
42
+ # Only applicable for sandbox workspaces and currently
43
+ # implemented for August, TTLock, and IglooHome devices.
44
+ # This will set the `hub_disconnected` error on the device, or mark the
45
+ # IglooHome bridge offline in sandbox.
46
+ # @param device_id ID of the device whose hub you want to disconnect.
47
+ # @return [nil] OK
48
+ def disconnect_from_hub(device_id:)
49
+ @client.post("/devices/simulate/disconnect_from_hub", {device_id: device_id}.compact)
50
+
51
+ nil
52
+ end
53
+
54
+ # Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only).
55
+ # Send `is_expired: true` to simulate an expired subscription, or `false` to simulate an active subscription.
56
+ # The actual device error is created/cleared by the poller after this state change.
57
+ # @param device_id
58
+ # @param is_expired
59
+ # @return [nil] OK
60
+ def paid_subscription(device_id:, is_expired:)
61
+ @client.post("/devices/simulate/paid_subscription", {device_id: device_id, is_expired: is_expired}.compact)
62
+
63
+ nil
64
+ end
65
+
66
+ # Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal).
67
+ # @param device_id ID of the device that you want to simulate removing from Seam.
68
+ # @return [nil] OK
69
+ def remove(device_id:)
70
+ @client.post("/devices/simulate/remove", {device_id: device_id}.compact)
71
+
72
+ nil
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class DevicesUnmanaged
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices).
12
+ #
13
+ # An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed).
14
+ #
15
+ # You must specify either `device_id` or `name`.
16
+ # @param device_id ID of the unmanaged device that you want to get.
17
+ # @param name Name of the unmanaged device that you want to get.
18
+ # @return [Seam::Resources::UnmanagedDevice] OK
19
+ def get(device_id: nil, name: nil)
20
+ res = @client.post("/devices/unmanaged/get", {device_id: device_id, name: name}.compact)
21
+
22
+ Seam::Resources::UnmanagedDevice.load_from_response(res.body["device"])
23
+ end
24
+
25
+ # Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices).
26
+ #
27
+ # An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed).
28
+ # @param connect_webview_id ID of the Connect Webview for which you want to list devices.
29
+ # @param connected_account_id ID of the connected account for which you want to list devices.
30
+ # @param connected_account_ids Array of IDs of the connected accounts for which you want to list devices.
31
+ # @param created_before Timestamp by which to limit returned devices. Returns devices created before this timestamp.
32
+ # @param custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices.
33
+ # @param customer_key Customer key for which you want to list devices.
34
+ # @param device_ids Array of device IDs for which you want to list devices.
35
+ # @param device_type Device type for which you want to list devices.
36
+ # @param device_types Array of device types for which you want to list devices.
37
+ # @param limit Numerical limit on the number of devices to return.
38
+ # @param manufacturer Manufacturer for which you want to list devices.
39
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
40
+ # @param search String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`.
41
+ # @param space_id ID of the space for which you want to list devices.
42
+ # @param unstable_location_id
43
+ # @deprecated unstable_location_id: Use `space_id`.
44
+ # @param user_identifier_key Your own internal user ID for the user for which you want to list devices.
45
+ # @return [Seam::Resources::UnmanagedDevice] OK
46
+ 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, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
47
+ res = @client.post("/devices/unmanaged/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, 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)
48
+
49
+ Seam::Resources::UnmanagedDevice.load_from_response(res.body["devices"])
50
+ end
51
+
52
+ # Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`.
53
+ #
54
+ # An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed).
55
+ # @param device_id ID of the unmanaged device that you want to update.
56
+ # @param custom_metadata Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs.
57
+ # @param is_managed Indicates whether the device is managed. Set this parameter to `true` to convert an unmanaged device to managed.
58
+ # @return [nil] OK
59
+ def update(device_id:, custom_metadata: nil, is_managed: nil)
60
+ @client.post("/devices/unmanaged/update", {device_id: device_id, custom_metadata: custom_metadata, is_managed: is_managed}.compact)
61
+
62
+ nil
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class Events
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to retrieve an event that already took place.
12
+ # @param event_id Unique identifier for the event that you want to get.
13
+ # @param device_id Unique identifier for the device that triggered the event that you want to get.
14
+ # @param event_type Type of the event that you want to get.
15
+ # @return [Seam::Resources::SeamEvent] OK
16
+ def get(event_id: nil, device_id: nil, event_type: nil)
17
+ res = @client.post("/events/get", {event_id: event_id, device_id: device_id, event_type: event_type}.compact)
18
+
19
+ Seam::Resources::SeamEvent.load_from_response(res.body["event"])
20
+ end
21
+
22
+ # Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), but it enables you to filter or see events that already took place.
23
+ # @param access_code_id ID of the access code for which you want to list events.
24
+ # @param access_code_ids IDs of the access codes for which you want to list events.
25
+ # @param access_grant_id ID of the access grant for which you want to list events.
26
+ # @param access_grant_ids IDs of the access grants for which you want to list events.
27
+ # @param access_method_id ID of the access method for which you want to list events.
28
+ # @param access_method_ids IDs of the access methods for which you want to list events.
29
+ # @param acs_access_group_id ID of the ACS access group for which you want to list events.
30
+ # @param acs_credential_id ID of the ACS credential for which you want to list events.
31
+ # @param acs_encoder_id ID of the ACS encoder for which you want to list events.
32
+ # @param acs_entrance_id ID of the ACS entrance for which you want to list events.
33
+ # @param acs_system_id ID of the access system for which you want to list events.
34
+ # @param acs_system_ids IDs of the access systems for which you want to list events.
35
+ # @param acs_user_id ID of the ACS user for which you want to list events.
36
+ # @param between Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include `since` or `between`.
37
+ # @param connect_webview_id ID of the Connect Webview for which you want to list events.
38
+ # @param connected_account_id ID of the connected account for which you want to list events.
39
+ # @param customer_key Customer key for which you want to list events.
40
+ # @param device_id ID of the device for which you want to list events.
41
+ # @param device_ids IDs of the devices for which you want to list events.
42
+ # @param event_ids IDs of the events that you want to list.
43
+ # @param event_type Type of the events that you want to list.
44
+ # @param event_types Types of the events that you want to list.
45
+ # @param limit Numerical limit on the number of events to return.
46
+ # @param since Timestamp to indicate the beginning generation time for the events that you want to list. You must include `since` or `between`.
47
+ # @param space_id ID of the space for which you want to list events.
48
+ # @param space_ids IDs of the spaces for which you want to list events.
49
+ # @param unstable_offset Offset for the events that you want to list.
50
+ # @param user_identity_id ID of the user identity for which you want to list events.
51
+ # @return [Seam::Resources::SeamEvent] OK
52
+ def list(access_code_id: nil, access_code_ids: nil, access_grant_id: nil, access_grant_ids: nil, access_method_id: nil, access_method_ids: nil, acs_access_group_id: nil, acs_credential_id: nil, acs_encoder_id: nil, acs_entrance_id: nil, acs_system_id: nil, acs_system_ids: nil, acs_user_id: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, space_id: nil, space_ids: nil, unstable_offset: nil, user_identity_id: nil)
53
+ res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_ids: access_grant_ids, access_method_id: access_method_id, access_method_ids: access_method_ids, acs_access_group_id: acs_access_group_id, acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_user_id: acs_user_id, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, space_id: space_id, space_ids: space_ids, unstable_offset: unstable_offset, user_identity_id: user_identity_id}.compact)
54
+
55
+ Seam::Resources::SeamEvent.load_from_response(res.body["events"])
56
+ end
57
+ end
58
+ end
59
+ end
@@ -8,18 +8,28 @@ module Seam
8
8
  @defaults = defaults
9
9
  end
10
10
 
11
+ # Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys).
12
+ # @param instant_key_id ID of the Instant Key that you want to delete.
13
+ # @return [nil] OK
11
14
  def delete(instant_key_id:)
12
15
  @client.post("/instant_keys/delete", {instant_key_id: instant_key_id}.compact)
13
16
 
14
17
  nil
15
18
  end
16
19
 
20
+ # Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys).
21
+ # @param instant_key_id ID of the instant key to get.
22
+ # @param instant_key_url URL of the instant key to get.
23
+ # @return [Seam::Resources::InstantKey] OK
17
24
  def get(instant_key_id: nil, instant_key_url: nil)
18
25
  res = @client.post("/instant_keys/get", {instant_key_id: instant_key_id, instant_key_url: instant_key_url}.compact)
19
26
 
20
27
  Seam::Resources::InstantKey.load_from_response(res.body["instant_key"])
21
28
  end
22
29
 
30
+ # Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys).
31
+ # @param user_identity_id ID of the user identity by which you want to filter the list of Instant Keys.
32
+ # @return [Seam::Resources::InstantKey] OK
23
33
  def list(user_identity_id: nil)
24
34
  res = @client.post("/instant_keys/list", {user_identity_id: user_identity_id}.compact)
25
35
 
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "seam/helpers/action_attempt"
4
+
5
+ module Seam
6
+ module Clients
7
+ class Locks
8
+ def initialize(client:, defaults:)
9
+ @client = client
10
+ @defaults = defaults
11
+ end
12
+
13
+ def simulate
14
+ @simulate ||= Seam::Clients::LocksSimulate.new(client: @client, defaults: @defaults)
15
+ end
16
+
17
+ # Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks).
18
+ # @param auto_lock_enabled Whether to enable or disable auto-lock.
19
+ # @param device_id ID of the lock for which you want to configure the auto-lock.
20
+ # @param auto_lock_delay_seconds Delay in seconds before the lock automatically locks. Required when enabling auto-lock. Must be between 1 and 60.
21
+ # @return [Seam::Resources::ActionAttempt] OK
22
+ def configure_auto_lock(auto_lock_enabled:, device_id:, auto_lock_delay_seconds: nil, wait_for_action_attempt: nil)
23
+ res = @client.post("/locks/configure_auto_lock", {auto_lock_enabled: auto_lock_enabled, device_id: device_id, auto_lock_delay_seconds: auto_lock_delay_seconds}.compact)
24
+
25
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
26
+
27
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
28
+ end
29
+
30
+ # Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks).
31
+ # @param device_id ID of the lock that you want to get.
32
+ # @param name Name of the lock that you want to get.
33
+ # @return [Seam::Resources::Device] OK
34
+ # @deprecated Use `/devices/get` instead.
35
+ def get(device_id: nil, name: nil)
36
+ res = @client.post("/locks/get", {device_id: device_id, name: name}.compact)
37
+
38
+ Seam::Resources::Device.load_from_response(res.body["device"])
39
+ end
40
+
41
+ # Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-locks).
42
+ # @param connect_webview_id ID of the Connect Webview for which you want to list devices.
43
+ # @param connected_account_id ID of the connected account for which you want to list devices.
44
+ # @param connected_account_ids Array of IDs of the connected accounts for which you want to list devices.
45
+ # @param created_before Timestamp by which to limit returned devices. Returns devices created before this timestamp.
46
+ # @param custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices.
47
+ # @param customer_key Customer key for which you want to list devices.
48
+ # @param device_ids Array of device IDs for which you want to list devices.
49
+ # @param device_type Device type of the locks that you want to list.
50
+ # @param device_types Device types of the locks that you want to list.
51
+ # @param limit Numerical limit on the number of devices to return.
52
+ # @param manufacturer Manufacturer of the locks that you want to list.
53
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
54
+ # @param search String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`.
55
+ # @param space_id ID of the space for which you want to list devices.
56
+ # @param unstable_location_id
57
+ # @deprecated unstable_location_id: Use `space_id`.
58
+ # @param user_identifier_key Your own internal user ID for the user for which you want to list devices.
59
+ # @return [Seam::Resources::Device] OK
60
+ 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, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
61
+ res = @client.post("/locks/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, 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)
62
+
63
+ Seam::Resources::Device.load_from_response(res.body["devices"])
64
+ end
65
+
66
+ # Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock).
67
+ # @param device_id ID of the lock that you want to lock.
68
+ # @return [Seam::Resources::ActionAttempt] OK
69
+ def lock_door(device_id:, wait_for_action_attempt: nil)
70
+ res = @client.post("/locks/lock_door", {device_id: device_id}.compact)
71
+
72
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
73
+
74
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
75
+ end
76
+
77
+ # Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock).
78
+ # @param device_id ID of the lock that you want to unlock.
79
+ # @return [Seam::Resources::ActionAttempt] OK
80
+ def unlock_door(device_id:, wait_for_action_attempt: nil)
81
+ res = @client.post("/locks/unlock_door", {device_id: device_id}.compact)
82
+
83
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
84
+
85
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
86
+ end
87
+ end
88
+ end
89
+ end
@@ -10,6 +10,10 @@ module Seam
10
10
  @defaults = defaults
11
11
  end
12
12
 
13
+ # Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
14
+ # @param code Code that you want to simulate entering on a keypad.
15
+ # @param device_id ID of the device for which you want to simulate a keypad code entry.
16
+ # @return [Seam::Resources::ActionAttempt] OK
13
17
  def keypad_code_entry(code:, device_id:, wait_for_action_attempt: nil)
14
18
  res = @client.post("/locks/simulate/keypad_code_entry", {code: code, device_id: device_id}.compact)
15
19
 
@@ -18,6 +22,9 @@ module Seam
18
22
  Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
19
23
  end
20
24
 
25
+ # Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
26
+ # @param device_id ID of the device for which you want to simulate a manual lock action using a keypad.
27
+ # @return [Seam::Resources::ActionAttempt] OK
21
28
  def manual_lock_via_keypad(device_id:, wait_for_action_attempt: nil)
22
29
  res = @client.post("/locks/simulate/manual_lock_via_keypad", {device_id: device_id}.compact)
23
30
 
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class NoiseSensors
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ def noise_thresholds
12
+ @noise_thresholds ||= Seam::Clients::NoiseSensorsNoiseThresholds.new(client: @client, defaults: @defaults)
13
+ end
14
+
15
+ def simulate
16
+ @simulate ||= Seam::Clients::NoiseSensorsSimulate.new(client: @client, defaults: @defaults)
17
+ end
18
+
19
+ # Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/noise-sensors).
20
+ # @param connect_webview_id ID of the Connect Webview for which you want to list devices.
21
+ # @param connected_account_id ID of the connected account for which you want to list devices.
22
+ # @param connected_account_ids Array of IDs of the connected accounts for which you want to list devices.
23
+ # @param created_before Timestamp by which to limit returned devices. Returns devices created before this timestamp.
24
+ # @param custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices.
25
+ # @param customer_key Customer key for which you want to list devices.
26
+ # @param device_ids Array of device IDs for which you want to list devices.
27
+ # @param device_type Device type of the noise sensors that you want to list.
28
+ # @param device_types Device types of the noise sensors that you want to list.
29
+ # @param limit Numerical limit on the number of devices to return.
30
+ # @param manufacturer Manufacturers of the noise sensors that you want to list.
31
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
32
+ # @param search String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`.
33
+ # @param space_id ID of the space for which you want to list devices.
34
+ # @param unstable_location_id
35
+ # @deprecated unstable_location_id: Use `space_id`.
36
+ # @param user_identifier_key Your own internal user ID for the user for which you want to list devices.
37
+ # @return [Seam::Resources::Device] OK
38
+ 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, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
39
+ res = @client.post("/noise_sensors/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, 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)
40
+
41
+ Seam::Resources::Device.load_from_response(res.body["devices"])
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class NoiseSensorsNoiseThresholds
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them.
12
+ # @param device_id ID of the device for which you want to create a noise threshold.
13
+ # @param ends_daily_at Time at which the new noise threshold should become inactive daily.
14
+ # @param starts_daily_at Time at which the new noise threshold should become active daily.
15
+ # @param name Name of the new noise threshold.
16
+ # @param noise_threshold_decibels Noise level in decibels for the new noise threshold.
17
+ # @param noise_threshold_nrs Noise level in Noiseaware Noise Risk Score (NRS) for the new noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors).
18
+ # @return [Seam::Resources::NoiseThreshold] OK
19
+ def create(device_id:, ends_daily_at:, starts_daily_at:, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil)
20
+ res = @client.post("/noise_sensors/noise_thresholds/create", {device_id: device_id, ends_daily_at: ends_daily_at, starts_daily_at: starts_daily_at, name: name, noise_threshold_decibels: noise_threshold_decibels, noise_threshold_nrs: noise_threshold_nrs}.compact)
21
+
22
+ Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_threshold"])
23
+ end
24
+
25
+ # Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors).
26
+ # @param device_id ID of the device that contains the noise threshold that you want to delete.
27
+ # @param noise_threshold_id ID of the noise threshold that you want to delete.
28
+ # @return [nil] OK
29
+ def delete(device_id:, noise_threshold_id:)
30
+ @client.post("/noise_sensors/noise_thresholds/delete", {device_id: device_id, noise_threshold_id: noise_threshold_id}.compact)
31
+
32
+ nil
33
+ end
34
+
35
+ # Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors).
36
+ # @param noise_threshold_id ID of the noise threshold that you want to get.
37
+ # @return [Seam::Resources::NoiseThreshold] OK
38
+ def get(noise_threshold_id:)
39
+ res = @client.post("/noise_sensors/noise_thresholds/get", {noise_threshold_id: noise_threshold_id}.compact)
40
+
41
+ Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_threshold"])
42
+ end
43
+
44
+ # Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors).
45
+ # @param device_id ID of the device for which you want to list noise thresholds.
46
+ # @return [Seam::Resources::NoiseThreshold] OK
47
+ def list(device_id:)
48
+ res = @client.post("/noise_sensors/noise_thresholds/list", {device_id: device_id}.compact)
49
+
50
+ Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_thresholds"])
51
+ end
52
+
53
+ # Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors).
54
+ # @param device_id ID of the device that contains the noise threshold that you want to update.
55
+ # @param noise_threshold_id ID of the noise threshold that you want to update.
56
+ # @param ends_daily_at Time at which the noise threshold should become inactive daily.
57
+ # @param name Name of the noise threshold that you want to update.
58
+ # @param noise_threshold_decibels Noise level in decibels for the noise threshold.
59
+ # @param noise_threshold_nrs Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors).
60
+ # @param starts_daily_at Time at which the noise threshold should become active daily.
61
+ # @return [nil] OK
62
+ def update(device_id:, noise_threshold_id:, ends_daily_at: nil, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil, starts_daily_at: nil)
63
+ @client.post("/noise_sensors/noise_thresholds/update", {device_id: device_id, noise_threshold_id: noise_threshold_id, ends_daily_at: ends_daily_at, name: name, noise_threshold_decibels: noise_threshold_decibels, noise_threshold_nrs: noise_threshold_nrs, starts_daily_at: starts_daily_at}.compact)
64
+
65
+ nil
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class NoiseSensorsSimulate
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
12
+ # @param device_id ID of the device for which you want to simulate the triggering of a noise threshold.
13
+ # @return [nil] OK
14
+ def trigger_noise_threshold(device_id:)
15
+ @client.post("/noise_sensors/simulate/trigger_noise_threshold", {device_id: device_id}.compact)
16
+
17
+ nil
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class Phones
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ def simulate
12
+ @simulate ||= Seam::Clients::PhonesSimulate.new(client: @client, defaults: @defaults)
13
+ end
14
+
15
+ # Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process).
16
+ # @param device_id Device ID of the phone that you want to deactivate.
17
+ # @return [nil] OK
18
+ def deactivate(device_id:)
19
+ @client.post("/phones/deactivate", {device_id: device_id}.compact)
20
+
21
+ nil
22
+ end
23
+
24
+ # Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity).
25
+ # @param device_id Device ID of the phone that you want to get.
26
+ # @return [Seam::Resources::Phone] OK
27
+ def get(device_id:)
28
+ res = @client.post("/phones/get", {device_id: device_id}.compact)
29
+
30
+ Seam::Resources::Phone.load_from_response(res.body["phone"])
31
+ end
32
+
33
+ # Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). 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.
34
+ # @param acs_credential_id ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) by which you want to filter the list of returned phones.
35
+ # @param owner_user_identity_id ID of the user identity that represents the owner by which you want to filter the list of returned phones.
36
+ # @return [Seam::Resources::Phone] OK
37
+ def list(acs_credential_id: nil, owner_user_identity_id: nil)
38
+ res = @client.post("/phones/list", {acs_credential_id: acs_credential_id, owner_user_identity_id: owner_user_identity_id}.compact)
39
+
40
+ Seam::Resources::Phone.load_from_response(res.body["phones"])
41
+ end
42
+ end
43
+ end
44
+ end