seam 2.0.0a2 → 2.0.0b0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +54 -51
  3. data/README.md +323 -3
  4. data/Rakefile +4 -1
  5. data/lib/seam/auth.rb +118 -0
  6. data/lib/seam/base_resource.rb +63 -0
  7. data/lib/seam/deep_hash_accessor.rb +37 -0
  8. data/lib/seam/default_endpoint.rb +5 -0
  9. data/lib/seam/helpers/action_attempt.rb +45 -0
  10. data/lib/seam/http.rb +52 -0
  11. data/lib/seam/http_multi_workspace.rb +62 -0
  12. data/lib/seam/http_single_workspace.rb +42 -0
  13. data/lib/seam/options.rb +64 -0
  14. data/lib/seam/parse_options.rb +23 -0
  15. data/lib/seam/request.rb +82 -51
  16. data/lib/seam/routes/clients/access_codes.rb +74 -0
  17. data/lib/seam/routes/clients/access_codes_simulate.rb +18 -0
  18. data/lib/seam/routes/clients/access_codes_unmanaged.rb +42 -0
  19. data/lib/seam/routes/clients/acs.rb +44 -0
  20. data/lib/seam/routes/clients/acs_access_groups.rb +48 -0
  21. data/lib/seam/routes/clients/acs_access_groups_unmanaged.rb +24 -0
  22. data/lib/seam/routes/clients/acs_credential_pools.rb +18 -0
  23. data/lib/seam/routes/clients/acs_credential_provisioning_automations.rb +18 -0
  24. data/lib/seam/routes/clients/acs_credentials.rb +60 -0
  25. data/lib/seam/routes/clients/acs_credentials_unmanaged.rb +24 -0
  26. data/lib/seam/routes/clients/acs_encoders.rb +36 -0
  27. data/lib/seam/routes/clients/acs_entrances.rb +36 -0
  28. data/lib/seam/routes/clients/acs_systems.rb +30 -0
  29. data/lib/seam/routes/clients/acs_users.rb +78 -0
  30. data/lib/seam/routes/clients/acs_users_unmanaged.rb +24 -0
  31. data/lib/seam/routes/clients/action_attempts.rb +28 -0
  32. data/lib/seam/routes/clients/client_sessions.rb +54 -0
  33. data/lib/seam/routes/clients/connect_webviews.rb +36 -0
  34. data/lib/seam/routes/clients/connected_accounts.rb +36 -0
  35. data/lib/seam/routes/clients/devices.rb +50 -0
  36. data/lib/seam/routes/clients/devices_simulate.rb +30 -0
  37. data/lib/seam/routes/clients/devices_unmanaged.rb +30 -0
  38. data/lib/seam/routes/clients/events.rb +24 -0
  39. data/lib/seam/routes/clients/index.rb +38 -0
  40. data/lib/seam/routes/clients/locks.rb +42 -0
  41. data/lib/seam/routes/clients/networks.rb +24 -0
  42. data/lib/seam/routes/clients/noise_sensors.rb +26 -0
  43. data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +42 -0
  44. data/lib/seam/routes/clients/noise_sensors_simulate.rb +18 -0
  45. data/lib/seam/routes/clients/phones.rb +28 -0
  46. data/lib/seam/routes/clients/phones_simulate.rb +18 -0
  47. data/lib/seam/routes/clients/thermostats.rb +108 -0
  48. data/lib/seam/routes/clients/thermostats_schedules.rb +42 -0
  49. data/lib/seam/routes/clients/user_identities.rb +88 -0
  50. data/lib/seam/routes/clients/user_identities_enrollment_automations.rb +36 -0
  51. data/lib/seam/routes/clients/webhooks.rb +42 -0
  52. data/lib/seam/routes/clients/workspaces.rb +40 -0
  53. data/lib/seam/routes/resources/access_code.rb +14 -0
  54. data/lib/seam/routes/resources/acs_access_group.rb +11 -0
  55. data/lib/seam/routes/resources/acs_credential.rb +14 -0
  56. data/lib/seam/routes/resources/acs_credential_pool.rb +11 -0
  57. data/lib/seam/routes/resources/acs_credential_provisioning_automation.rb +11 -0
  58. data/lib/seam/routes/resources/acs_entrance.rb +13 -0
  59. data/lib/seam/routes/resources/acs_system.rb +14 -0
  60. data/lib/seam/routes/resources/acs_user.rb +14 -0
  61. data/lib/seam/routes/resources/action_attempt.rb +9 -0
  62. data/lib/seam/routes/resources/client_session.rb +11 -0
  63. data/lib/seam/routes/resources/connect_webview.rb +11 -0
  64. data/lib/seam/routes/resources/connected_account.rb +14 -0
  65. data/lib/seam/routes/resources/device.rb +14 -0
  66. data/lib/seam/routes/resources/device_provider.rb +9 -0
  67. data/lib/seam/routes/resources/enrollment_automation.rb +11 -0
  68. data/lib/seam/routes/resources/event.rb +11 -0
  69. data/lib/seam/routes/resources/index.rb +33 -0
  70. data/lib/seam/routes/resources/network.rb +11 -0
  71. data/lib/seam/routes/resources/noise_threshold.rb +9 -0
  72. data/lib/seam/routes/resources/phone.rb +14 -0
  73. data/lib/seam/routes/resources/resource_error.rb +11 -0
  74. data/lib/seam/routes/resources/resource_errors_support.rb +11 -0
  75. data/lib/seam/routes/resources/resource_warning.rb +11 -0
  76. data/lib/seam/routes/resources/resource_warnings_support.rb +11 -0
  77. data/lib/seam/routes/resources/service_health.rb +9 -0
  78. data/lib/seam/routes/resources/thermostat_schedule.rb +13 -0
  79. data/lib/seam/routes/resources/unmanaged_access_code.rb +14 -0
  80. data/lib/seam/routes/resources/unmanaged_device.rb +14 -0
  81. data/lib/seam/routes/resources/user_identity.rb +11 -0
  82. data/lib/seam/routes/resources/webhook.rb +9 -0
  83. data/lib/seam/routes/resources/workspace.rb +9 -0
  84. data/lib/seam/routes/routes.rb +94 -0
  85. data/lib/seam/token.rb +53 -0
  86. data/lib/seam/version.rb +1 -1
  87. data/lib/seam/wait_for_action_attempt.rb +32 -0
  88. data/lib/seam/webhook.rb +22 -0
  89. data/lib/seam.rb +19 -68
  90. metadata +115 -70
  91. data/lib/seam/client.rb +0 -129
  92. data/lib/seam/clients/access_codes.rb +0 -95
  93. data/lib/seam/clients/access_codes_simulate.rb +0 -17
  94. data/lib/seam/clients/access_codes_unmanaged.rb +0 -57
  95. data/lib/seam/clients/acs.rb +0 -35
  96. data/lib/seam/clients/acs_access_groups.rb +0 -57
  97. data/lib/seam/clients/acs_credential_pools.rb +0 -17
  98. data/lib/seam/clients/acs_credential_provisioning_automations.rb +0 -17
  99. data/lib/seam/clients/acs_credentials.rb +0 -77
  100. data/lib/seam/clients/acs_entrances.rb +0 -47
  101. data/lib/seam/clients/acs_systems.rb +0 -27
  102. data/lib/seam/clients/acs_users.rb +0 -117
  103. data/lib/seam/clients/action_attempts.rb +0 -30
  104. data/lib/seam/clients/base_client.rb +0 -21
  105. data/lib/seam/clients/client_sessions.rb +0 -77
  106. data/lib/seam/clients/connect_webviews.rb +0 -47
  107. data/lib/seam/clients/connected_accounts.rb +0 -47
  108. data/lib/seam/clients/devices.rb +0 -65
  109. data/lib/seam/clients/devices_simulate.rb +0 -17
  110. data/lib/seam/clients/devices_unmanaged.rb +0 -37
  111. data/lib/seam/clients/events.rb +0 -27
  112. data/lib/seam/clients/locks.rb +0 -53
  113. data/lib/seam/clients/networks.rb +0 -27
  114. data/lib/seam/clients/noise_sensors.rb +0 -15
  115. data/lib/seam/clients/noise_sensors_noise_thresholds.rb +0 -57
  116. data/lib/seam/clients/noise_sensors_simulate.rb +0 -17
  117. data/lib/seam/clients/phones.rb +0 -31
  118. data/lib/seam/clients/phones_simulate.rb +0 -17
  119. data/lib/seam/clients/thermostats.rb +0 -106
  120. data/lib/seam/clients/thermostats_climate_setting_schedules.rb +0 -57
  121. data/lib/seam/clients/user_identities.rb +0 -131
  122. data/lib/seam/clients/user_identities_enrollment_automations.rb +0 -47
  123. data/lib/seam/clients/webhooks.rb +0 -57
  124. data/lib/seam/clients/workspaces.rb +0 -50
  125. data/lib/seam/resources/access_code.rb +0 -12
  126. data/lib/seam/resources/acs_access_group.rb +0 -9
  127. data/lib/seam/resources/acs_credential.rb +0 -12
  128. data/lib/seam/resources/acs_credential_pool.rb +0 -9
  129. data/lib/seam/resources/acs_credential_provisioning_automation.rb +0 -9
  130. data/lib/seam/resources/acs_entrance.rb +0 -9
  131. data/lib/seam/resources/acs_system.rb +0 -9
  132. data/lib/seam/resources/acs_user.rb +0 -9
  133. data/lib/seam/resources/action_attempt.rb +0 -46
  134. data/lib/seam/resources/base_resource.rb +0 -58
  135. data/lib/seam/resources/client_session.rb +0 -9
  136. data/lib/seam/resources/climate_setting_schedule.rb +0 -11
  137. data/lib/seam/resources/connect_webview.rb +0 -9
  138. data/lib/seam/resources/connected_account.rb +0 -12
  139. data/lib/seam/resources/device.rb +0 -12
  140. data/lib/seam/resources/device_provider.rb +0 -7
  141. data/lib/seam/resources/enrollment_automation.rb +0 -9
  142. data/lib/seam/resources/event.rb +0 -9
  143. data/lib/seam/resources/network.rb +0 -9
  144. data/lib/seam/resources/noise_threshold.rb +0 -7
  145. data/lib/seam/resources/phone.rb +0 -12
  146. data/lib/seam/resources/resource_error.rb +0 -9
  147. data/lib/seam/resources/resource_errors_support.rb +0 -9
  148. data/lib/seam/resources/resource_warning.rb +0 -9
  149. data/lib/seam/resources/resource_warnings_support.rb +0 -9
  150. data/lib/seam/resources/service_health.rb +0 -7
  151. data/lib/seam/resources/unmanaged_access_code.rb +0 -12
  152. data/lib/seam/resources/unmanaged_device.rb +0 -12
  153. data/lib/seam/resources/user_identity.rb +0 -9
  154. data/lib/seam/resources/webhook.rb +0 -7
  155. data/lib/seam/resources/workspace.rb +0 -7
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Devices < BaseClient
6
- def simulate
7
- @simulate ||= Seam::Clients::DevicesSimulate.new(self)
8
- end
9
-
10
- def unmanaged
11
- @unmanaged ||= Seam::Clients::DevicesUnmanaged.new(self)
12
- end
13
-
14
- def delete(device_id:)
15
- request_seam(
16
- :post,
17
- "/devices/delete",
18
- body: {device_id: device_id}.compact
19
- )
20
-
21
- nil
22
- end
23
-
24
- def get(device_id: nil, name: nil)
25
- request_seam_object(
26
- :post,
27
- "/devices/get",
28
- Seam::Device,
29
- "device",
30
- body: {device_id: device_id, name: name}.compact
31
- )
32
- end
33
-
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)
35
- request_seam_object(
36
- :post,
37
- "/devices/list",
38
- Seam::Device,
39
- "devices",
40
- body: {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, 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
41
- )
42
- end
43
-
44
- def list_device_providers(provider_category: nil)
45
- request_seam_object(
46
- :post,
47
- "/devices/list_device_providers",
48
- Seam::DeviceProvider,
49
- "device_providers",
50
- body: {provider_category: provider_category}.compact
51
- )
52
- end
53
-
54
- def update(device_id:, custom_metadata: nil, is_managed: nil, name: nil, properties: nil)
55
- request_seam(
56
- :post,
57
- "/devices/update",
58
- body: {device_id: device_id, custom_metadata: custom_metadata, is_managed: is_managed, name: name, properties: properties}.compact
59
- )
60
-
61
- nil
62
- end
63
- end
64
- end
65
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class DevicesSimulate < BaseClient
6
- def remove(device_id:)
7
- request_seam(
8
- :post,
9
- "/devices/simulate/remove",
10
- body: {device_id: device_id}.compact
11
- )
12
-
13
- nil
14
- end
15
- end
16
- end
17
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class DevicesUnmanaged < BaseClient
6
- def get(device_id: nil, name: nil)
7
- request_seam_object(
8
- :post,
9
- "/devices/unmanaged/get",
10
- Seam::UnmanagedDevice,
11
- "device",
12
- body: {device_id: device_id, name: name}.compact
13
- )
14
- end
15
-
16
- 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)
17
- request_seam_object(
18
- :post,
19
- "/devices/unmanaged/list",
20
- Seam::UnmanagedDevice,
21
- "devices",
22
- body: {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, 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
23
- )
24
- end
25
-
26
- def update(device_id:, is_managed:)
27
- request_seam(
28
- :post,
29
- "/devices/unmanaged/update",
30
- body: {device_id: device_id, is_managed: is_managed}.compact
31
- )
32
-
33
- nil
34
- end
35
- end
36
- end
37
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Events < BaseClient
6
- def get(device_id: nil, event_id: nil, event_type: nil)
7
- request_seam_object(
8
- :post,
9
- "/events/get",
10
- Seam::Event,
11
- "event",
12
- body: {device_id: device_id, event_id: event_id, event_type: event_type}.compact
13
- )
14
- end
15
-
16
- def list(access_code_id: nil, access_code_ids: nil, between: nil, connected_account_id: nil, device_id: nil, device_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil)
17
- request_seam_object(
18
- :post,
19
- "/events/list",
20
- Seam::Event,
21
- "events",
22
- body: {access_code_id: access_code_id, access_code_ids: access_code_ids, between: between, connected_account_id: connected_account_id, device_id: device_id, device_ids: device_ids, event_type: event_type, event_types: event_types, limit: limit, since: since}.compact
23
- )
24
- end
25
- end
26
- end
27
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Locks < BaseClient
6
- def get(device_id: nil, name: nil)
7
- request_seam_object(
8
- :post,
9
- "/locks/get",
10
- Seam::Device,
11
- "device",
12
- body: {device_id: device_id, name: name}.compact
13
- )
14
- end
15
-
16
- 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)
17
- request_seam_object(
18
- :post,
19
- "/locks/list",
20
- Seam::Device,
21
- "devices",
22
- body: {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, 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
23
- )
24
- end
25
-
26
- def lock_door(device_id:, sync: nil, wait_for_action_attempt: nil)
27
- action_attempt = request_seam_object(
28
- :post,
29
- "/locks/lock_door",
30
- Seam::ActionAttempt,
31
- "action_attempt",
32
- body: {device_id: device_id, sync: sync}.compact
33
- )
34
-
35
- action_attempt.decide_and_wait(wait_for_action_attempt)
36
- action_attempt
37
- end
38
-
39
- def unlock_door(device_id:, sync: nil, wait_for_action_attempt: nil)
40
- action_attempt = request_seam_object(
41
- :post,
42
- "/locks/unlock_door",
43
- Seam::ActionAttempt,
44
- "action_attempt",
45
- body: {device_id: device_id, sync: sync}.compact
46
- )
47
-
48
- action_attempt.decide_and_wait(wait_for_action_attempt)
49
- action_attempt
50
- end
51
- end
52
- end
53
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Networks < BaseClient
6
- def get(network_id:)
7
- request_seam_object(
8
- :post,
9
- "/networks/get",
10
- Seam::Network,
11
- "network",
12
- body: {network_id: network_id}.compact
13
- )
14
- end
15
-
16
- def list
17
- request_seam_object(
18
- :post,
19
- "/networks/list",
20
- Seam::Network,
21
- "networks",
22
- body: {}.compact
23
- )
24
- end
25
- end
26
- end
27
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class NoiseSensors < BaseClient
6
- def noise_thresholds
7
- @noise_thresholds ||= Seam::Clients::NoiseSensorsNoiseThresholds.new(self)
8
- end
9
-
10
- def simulate
11
- @simulate ||= Seam::Clients::NoiseSensorsSimulate.new(self)
12
- end
13
- end
14
- end
15
- end
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class NoiseSensorsNoiseThresholds < BaseClient
6
- def create(device_id:, ends_daily_at:, starts_daily_at:, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil, sync: nil)
7
- request_seam_object(
8
- :post,
9
- "/noise_sensors/noise_thresholds/create",
10
- Seam::NoiseThreshold,
11
- "noise_threshold",
12
- body: {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, sync: sync}.compact
13
- )
14
- end
15
-
16
- def delete(device_id:, noise_threshold_id:, sync: nil)
17
- request_seam(
18
- :post,
19
- "/noise_sensors/noise_thresholds/delete",
20
- body: {device_id: device_id, noise_threshold_id: noise_threshold_id, sync: sync}.compact
21
- )
22
-
23
- nil
24
- end
25
-
26
- def get(noise_threshold_id:)
27
- request_seam_object(
28
- :post,
29
- "/noise_sensors/noise_thresholds/get",
30
- Seam::NoiseThreshold,
31
- "noise_threshold",
32
- body: {noise_threshold_id: noise_threshold_id}.compact
33
- )
34
- end
35
-
36
- def list(device_id:, is_programmed: nil)
37
- request_seam_object(
38
- :post,
39
- "/noise_sensors/noise_thresholds/list",
40
- Seam::NoiseThreshold,
41
- "noise_thresholds",
42
- body: {device_id: device_id, is_programmed: is_programmed}.compact
43
- )
44
- end
45
-
46
- 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, sync: nil)
47
- request_seam(
48
- :post,
49
- "/noise_sensors/noise_thresholds/update",
50
- body: {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, sync: sync}.compact
51
- )
52
-
53
- nil
54
- end
55
- end
56
- end
57
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class NoiseSensorsSimulate < BaseClient
6
- def trigger_noise_threshold(device_id:)
7
- request_seam(
8
- :post,
9
- "/noise_sensors/simulate/trigger_noise_threshold",
10
- body: {device_id: device_id}.compact
11
- )
12
-
13
- nil
14
- end
15
- end
16
- end
17
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Phones < BaseClient
6
- def simulate
7
- @simulate ||= Seam::Clients::PhonesSimulate.new(self)
8
- end
9
-
10
- def deactivate(device_id:)
11
- request_seam(
12
- :post,
13
- "/phones/deactivate",
14
- body: {device_id: device_id}.compact
15
- )
16
-
17
- nil
18
- end
19
-
20
- def list(owner_user_identity_id: nil)
21
- request_seam_object(
22
- :post,
23
- "/phones/list",
24
- Seam::Phone,
25
- "phones",
26
- body: {owner_user_identity_id: owner_user_identity_id}.compact
27
- )
28
- end
29
- end
30
- end
31
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class PhonesSimulate < BaseClient
6
- def create_sandbox_phone(user_identity_id:, assa_abloy_metadata: nil, custom_sdk_installation_id: nil, phone_metadata: nil)
7
- request_seam_object(
8
- :post,
9
- "/phones/simulate/create_sandbox_phone",
10
- Seam::Phone,
11
- "phone",
12
- body: {user_identity_id: user_identity_id, assa_abloy_metadata: assa_abloy_metadata, custom_sdk_installation_id: custom_sdk_installation_id, phone_metadata: phone_metadata}.compact
13
- )
14
- end
15
- end
16
- end
17
- end
@@ -1,106 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Thermostats < BaseClient
6
- def climate_setting_schedules
7
- @climate_setting_schedules ||= Seam::Clients::ThermostatsClimateSettingSchedules.new(self)
8
- end
9
-
10
- def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, sync: nil, wait_for_action_attempt: nil)
11
- action_attempt = request_seam_object(
12
- :post,
13
- "/thermostats/cool",
14
- Seam::ActionAttempt,
15
- "action_attempt",
16
- body: {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, sync: sync}.compact
17
- )
18
-
19
- action_attempt.decide_and_wait(wait_for_action_attempt)
20
- action_attempt
21
- end
22
-
23
- def get(device_id: nil, name: nil)
24
- request_seam_object(
25
- :post,
26
- "/thermostats/get",
27
- Seam::Device,
28
- "thermostat",
29
- body: {device_id: device_id, name: name}.compact
30
- )
31
- end
32
-
33
- def heat(device_id:, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, sync: nil, wait_for_action_attempt: nil)
34
- action_attempt = request_seam_object(
35
- :post,
36
- "/thermostats/heat",
37
- Seam::ActionAttempt,
38
- "action_attempt",
39
- body: {device_id: device_id, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, sync: sync}.compact
40
- )
41
-
42
- action_attempt.decide_and_wait(wait_for_action_attempt)
43
- action_attempt
44
- end
45
-
46
- def heat_cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, sync: nil, wait_for_action_attempt: nil)
47
- action_attempt = request_seam_object(
48
- :post,
49
- "/thermostats/heat_cool",
50
- Seam::ActionAttempt,
51
- "action_attempt",
52
- body: {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, sync: sync}.compact
53
- )
54
-
55
- action_attempt.decide_and_wait(wait_for_action_attempt)
56
- action_attempt
57
- end
58
-
59
- 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)
60
- request_seam_object(
61
- :post,
62
- "/thermostats/list",
63
- Seam::Device,
64
- "thermostats",
65
- body: {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, 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
66
- )
67
- end
68
-
69
- def off(device_id:, sync: nil, wait_for_action_attempt: nil)
70
- action_attempt = request_seam_object(
71
- :post,
72
- "/thermostats/off",
73
- Seam::ActionAttempt,
74
- "action_attempt",
75
- body: {device_id: device_id, sync: sync}.compact
76
- )
77
-
78
- action_attempt.decide_and_wait(wait_for_action_attempt)
79
- action_attempt
80
- end
81
-
82
- def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, sync: nil, wait_for_action_attempt: nil)
83
- action_attempt = request_seam_object(
84
- :post,
85
- "/thermostats/set_fan_mode",
86
- Seam::ActionAttempt,
87
- "action_attempt",
88
- body: {device_id: device_id, fan_mode: fan_mode, fan_mode_setting: fan_mode_setting, sync: sync}.compact
89
- )
90
-
91
- action_attempt.decide_and_wait(wait_for_action_attempt)
92
- action_attempt
93
- end
94
-
95
- def update(default_climate_setting:, device_id:)
96
- request_seam(
97
- :post,
98
- "/thermostats/update",
99
- body: {default_climate_setting: default_climate_setting, device_id: device_id}.compact
100
- )
101
-
102
- nil
103
- end
104
- end
105
- end
106
- end
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class ThermostatsClimateSettingSchedules < BaseClient
6
- def create(device_id:, schedule_ends_at:, schedule_starts_at:, automatic_cooling_enabled: nil, automatic_heating_enabled: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil, schedule_type: nil)
7
- request_seam_object(
8
- :post,
9
- "/thermostats/climate_setting_schedules/create",
10
- Seam::ClimateSettingSchedule,
11
- "climate_setting_schedule",
12
- body: {device_id: device_id, schedule_ends_at: schedule_ends_at, schedule_starts_at: schedule_starts_at, automatic_cooling_enabled: automatic_cooling_enabled, automatic_heating_enabled: automatic_heating_enabled, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, hvac_mode_setting: hvac_mode_setting, manual_override_allowed: manual_override_allowed, name: name, schedule_type: schedule_type}.compact
13
- )
14
- end
15
-
16
- def delete(climate_setting_schedule_id:)
17
- request_seam(
18
- :post,
19
- "/thermostats/climate_setting_schedules/delete",
20
- body: {climate_setting_schedule_id: climate_setting_schedule_id}.compact
21
- )
22
-
23
- nil
24
- end
25
-
26
- def get(climate_setting_schedule_id: nil, device_id: nil)
27
- request_seam_object(
28
- :post,
29
- "/thermostats/climate_setting_schedules/get",
30
- Seam::ClimateSettingSchedule,
31
- "climate_setting_schedule",
32
- body: {climate_setting_schedule_id: climate_setting_schedule_id, device_id: device_id}.compact
33
- )
34
- end
35
-
36
- def list(device_id:, user_identifier_key: nil)
37
- request_seam_object(
38
- :post,
39
- "/thermostats/climate_setting_schedules/list",
40
- Seam::ClimateSettingSchedule,
41
- "climate_setting_schedules",
42
- body: {device_id: device_id, user_identifier_key: user_identifier_key}.compact
43
- )
44
- end
45
-
46
- def update(climate_setting_schedule_id:, automatic_cooling_enabled: nil, automatic_heating_enabled: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil, schedule_ends_at: nil, schedule_starts_at: nil, schedule_type: nil)
47
- request_seam(
48
- :post,
49
- "/thermostats/climate_setting_schedules/update",
50
- body: {climate_setting_schedule_id: climate_setting_schedule_id, automatic_cooling_enabled: automatic_cooling_enabled, automatic_heating_enabled: automatic_heating_enabled, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, hvac_mode_setting: hvac_mode_setting, manual_override_allowed: manual_override_allowed, name: name, schedule_ends_at: schedule_ends_at, schedule_starts_at: schedule_starts_at, schedule_type: schedule_type}.compact
51
- )
52
-
53
- nil
54
- end
55
- end
56
- end
57
- end
@@ -1,131 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class UserIdentities < BaseClient
6
- def enrollment_automations
7
- @enrollment_automations ||= Seam::Clients::UserIdentitiesEnrollmentAutomations.new(self)
8
- end
9
-
10
- def add_acs_user(acs_user_id:, user_identity_id:)
11
- request_seam(
12
- :post,
13
- "/user_identities/add_acs_user",
14
- body: {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact
15
- )
16
-
17
- nil
18
- end
19
-
20
- def create(email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
21
- request_seam_object(
22
- :post,
23
- "/user_identities/create",
24
- Seam::UserIdentity,
25
- "user_identity",
26
- body: {email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact
27
- )
28
- end
29
-
30
- def delete(user_identity_id:)
31
- request_seam(
32
- :post,
33
- "/user_identities/delete",
34
- body: {user_identity_id: user_identity_id}.compact
35
- )
36
-
37
- nil
38
- end
39
-
40
- def get(user_identity_id: nil, user_identity_key: nil)
41
- request_seam_object(
42
- :post,
43
- "/user_identities/get",
44
- Seam::UserIdentity,
45
- "user_identity",
46
- body: {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact
47
- )
48
- end
49
-
50
- def grant_access_to_device(device_id:, user_identity_id:)
51
- request_seam(
52
- :post,
53
- "/user_identities/grant_access_to_device",
54
- body: {device_id: device_id, user_identity_id: user_identity_id}.compact
55
- )
56
-
57
- nil
58
- end
59
-
60
- def list(credential_manager_acs_system_id: nil)
61
- request_seam_object(
62
- :post,
63
- "/user_identities/list",
64
- Seam::UserIdentity,
65
- "user_identities",
66
- body: {credential_manager_acs_system_id: credential_manager_acs_system_id}.compact
67
- )
68
- end
69
-
70
- def list_accessible_devices(user_identity_id:)
71
- request_seam_object(
72
- :post,
73
- "/user_identities/list_accessible_devices",
74
- Seam::Device,
75
- "devices",
76
- body: {user_identity_id: user_identity_id}.compact
77
- )
78
- end
79
-
80
- def list_acs_systems(user_identity_id:)
81
- request_seam_object(
82
- :post,
83
- "/user_identities/list_acs_systems",
84
- Seam::AcsSystem,
85
- "acs_systems",
86
- body: {user_identity_id: user_identity_id}.compact
87
- )
88
- end
89
-
90
- def list_acs_users(user_identity_id:)
91
- request_seam_object(
92
- :post,
93
- "/user_identities/list_acs_users",
94
- Seam::AcsUser,
95
- "acs_users",
96
- body: {user_identity_id: user_identity_id}.compact
97
- )
98
- end
99
-
100
- def remove_acs_user(acs_user_id:, user_identity_id:)
101
- request_seam(
102
- :post,
103
- "/user_identities/remove_acs_user",
104
- body: {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact
105
- )
106
-
107
- nil
108
- end
109
-
110
- def revoke_access_to_device(device_id:, user_identity_id:)
111
- request_seam(
112
- :post,
113
- "/user_identities/revoke_access_to_device",
114
- body: {device_id: device_id, user_identity_id: user_identity_id}.compact
115
- )
116
-
117
- nil
118
- end
119
-
120
- def update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
121
- request_seam(
122
- :post,
123
- "/user_identities/update",
124
- body: {user_identity_id: user_identity_id, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact
125
- )
126
-
127
- nil
128
- end
129
- end
130
- end
131
- end