seam 2.0.0a1 → 2.0.0.prerelease.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +34 -2
  3. data/README.md +4 -1
  4. data/Rakefile +1 -1
  5. data/lib/seam/client.rb +129 -0
  6. data/lib/seam/clients/access_codes.rb +95 -0
  7. data/lib/seam/clients/access_codes_simulate.rb +17 -0
  8. data/lib/seam/clients/access_codes_unmanaged.rb +57 -0
  9. data/lib/seam/clients/acs.rb +35 -0
  10. data/lib/seam/clients/acs_access_groups.rb +57 -0
  11. data/lib/seam/clients/acs_credential_pools.rb +17 -0
  12. data/lib/seam/clients/acs_credential_provisioning_automations.rb +17 -0
  13. data/lib/seam/clients/acs_credentials.rb +77 -0
  14. data/lib/seam/clients/acs_entrances.rb +47 -0
  15. data/lib/seam/clients/acs_systems.rb +27 -0
  16. data/lib/seam/clients/acs_users.rb +117 -0
  17. data/lib/seam/clients/action_attempts.rb +30 -0
  18. data/lib/seam/clients/base_client.rb +21 -0
  19. data/lib/seam/clients/client_sessions.rb +77 -0
  20. data/lib/seam/clients/connect_webviews.rb +47 -0
  21. data/lib/seam/clients/connected_accounts.rb +47 -0
  22. data/lib/seam/clients/devices.rb +65 -0
  23. data/lib/seam/clients/devices_simulate.rb +17 -0
  24. data/lib/seam/clients/devices_unmanaged.rb +37 -0
  25. data/lib/seam/clients/events.rb +27 -0
  26. data/lib/seam/clients/locks.rb +53 -0
  27. data/lib/seam/clients/networks.rb +27 -0
  28. data/lib/seam/clients/noise_sensors.rb +15 -0
  29. data/lib/seam/clients/noise_sensors_noise_thresholds.rb +57 -0
  30. data/lib/seam/clients/noise_sensors_simulate.rb +17 -0
  31. data/lib/seam/clients/phones.rb +31 -0
  32. data/lib/seam/clients/phones_simulate.rb +17 -0
  33. data/lib/seam/clients/thermostats.rb +106 -0
  34. data/lib/seam/clients/thermostats_climate_setting_schedules.rb +57 -0
  35. data/lib/seam/clients/user_identities.rb +131 -0
  36. data/lib/seam/clients/user_identities_enrollment_automations.rb +47 -0
  37. data/lib/seam/clients/webhooks.rb +57 -0
  38. data/lib/seam/clients/workspaces.rb +50 -0
  39. data/lib/seam/logger.rb +12 -0
  40. data/lib/seam/lts_version.rb +5 -0
  41. data/lib/seam/request.rb +73 -0
  42. data/lib/seam/resources/access_code.rb +12 -0
  43. data/lib/seam/resources/acs_access_group.rb +9 -0
  44. data/lib/seam/resources/acs_credential.rb +12 -0
  45. data/lib/seam/resources/acs_credential_pool.rb +9 -0
  46. data/lib/seam/resources/acs_credential_provisioning_automation.rb +9 -0
  47. data/lib/seam/resources/acs_entrance.rb +9 -0
  48. data/lib/seam/resources/acs_system.rb +9 -0
  49. data/lib/seam/resources/acs_user.rb +9 -0
  50. data/lib/seam/resources/action_attempt.rb +46 -0
  51. data/lib/seam/resources/base_resource.rb +58 -0
  52. data/lib/seam/resources/client_session.rb +9 -0
  53. data/lib/seam/resources/climate_setting_schedule.rb +11 -0
  54. data/lib/seam/resources/connect_webview.rb +9 -0
  55. data/lib/seam/resources/connected_account.rb +12 -0
  56. data/lib/seam/resources/device.rb +12 -0
  57. data/lib/seam/resources/device_provider.rb +7 -0
  58. data/lib/seam/resources/enrollment_automation.rb +9 -0
  59. data/lib/seam/resources/event.rb +9 -0
  60. data/lib/seam/resources/network.rb +9 -0
  61. data/lib/seam/resources/noise_threshold.rb +7 -0
  62. data/lib/seam/resources/phone.rb +12 -0
  63. data/lib/seam/resources/resource_error.rb +9 -0
  64. data/lib/seam/resources/resource_errors_support.rb +9 -0
  65. data/lib/seam/resources/resource_warning.rb +9 -0
  66. data/lib/seam/resources/resource_warnings_support.rb +9 -0
  67. data/lib/seam/resources/service_health.rb +7 -0
  68. data/lib/seam/resources/unmanaged_access_code.rb +12 -0
  69. data/lib/seam/resources/unmanaged_device.rb +12 -0
  70. data/lib/seam/resources/user_identity.rb +9 -0
  71. data/lib/seam/resources/webhook.rb +7 -0
  72. data/lib/seam/resources/workspace.rb +7 -0
  73. data/lib/seam/version.rb +1 -1
  74. data/lib/seam.rb +68 -2
  75. metadata +98 -3
  76. data/lib/seam/todo.rb +0 -9
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AcsSystems < BaseClient
6
+ def get(acs_system_id:)
7
+ request_seam_object(
8
+ :post,
9
+ "/acs/systems/get",
10
+ Seam::AcsSystem,
11
+ "acs_system",
12
+ body: {acs_system_id: acs_system_id}.compact
13
+ )
14
+ end
15
+
16
+ def list(connected_account_id: nil)
17
+ request_seam_object(
18
+ :post,
19
+ "/acs/systems/list",
20
+ Seam::AcsSystem,
21
+ "acs_systems",
22
+ body: {connected_account_id: connected_account_id}.compact
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,117 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AcsUsers < BaseClient
6
+ def add_to_access_group(acs_access_group_id:, acs_user_id:)
7
+ request_seam(
8
+ :post,
9
+ "/acs/users/add_to_access_group",
10
+ body: {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact
11
+ )
12
+
13
+ nil
14
+ end
15
+
16
+ def create(acs_system_id:, access_schedule: nil, acs_access_group_ids: nil, email: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_id: nil)
17
+ request_seam_object(
18
+ :post,
19
+ "/acs/users/create",
20
+ Seam::AcsUser,
21
+ "acs_user",
22
+ body: {acs_system_id: acs_system_id, access_schedule: access_schedule, acs_access_group_ids: acs_access_group_ids, email: email, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_id: user_identity_id}.compact
23
+ )
24
+ end
25
+
26
+ def delete(acs_user_id:)
27
+ request_seam(
28
+ :post,
29
+ "/acs/users/delete",
30
+ body: {acs_user_id: acs_user_id}.compact
31
+ )
32
+
33
+ nil
34
+ end
35
+
36
+ def get(acs_user_id:)
37
+ request_seam_object(
38
+ :post,
39
+ "/acs/users/get",
40
+ Seam::AcsUser,
41
+ "acs_user",
42
+ body: {acs_user_id: acs_user_id}.compact
43
+ )
44
+ end
45
+
46
+ def list(acs_system_id: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil)
47
+ request_seam_object(
48
+ :post,
49
+ "/acs/users/list",
50
+ Seam::AcsUser,
51
+ "acs_users",
52
+ body: {acs_system_id: acs_system_id, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact
53
+ )
54
+ end
55
+
56
+ def list_accessible_entrances(acs_user_id:)
57
+ request_seam_object(
58
+ :post,
59
+ "/acs/users/list_accessible_entrances",
60
+ Seam::AcsEntrance,
61
+ "acs_entrances",
62
+ body: {acs_user_id: acs_user_id}.compact
63
+ )
64
+ end
65
+
66
+ def remove_from_access_group(acs_access_group_id:, acs_user_id:)
67
+ request_seam(
68
+ :post,
69
+ "/acs/users/remove_from_access_group",
70
+ body: {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact
71
+ )
72
+
73
+ nil
74
+ end
75
+
76
+ def revoke_access_to_all_entrances(acs_user_id:)
77
+ request_seam(
78
+ :post,
79
+ "/acs/users/revoke_access_to_all_entrances",
80
+ body: {acs_user_id: acs_user_id}.compact
81
+ )
82
+
83
+ nil
84
+ end
85
+
86
+ def suspend(acs_user_id:)
87
+ request_seam(
88
+ :post,
89
+ "/acs/users/suspend",
90
+ body: {acs_user_id: acs_user_id}.compact
91
+ )
92
+
93
+ nil
94
+ end
95
+
96
+ def unsuspend(acs_user_id:)
97
+ request_seam(
98
+ :post,
99
+ "/acs/users/unsuspend",
100
+ body: {acs_user_id: acs_user_id}.compact
101
+ )
102
+
103
+ nil
104
+ end
105
+
106
+ def update(acs_user_id:, access_schedule: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil)
107
+ request_seam(
108
+ :post,
109
+ "/acs/users/update",
110
+ body: {acs_user_id: acs_user_id, access_schedule: access_schedule, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number}.compact
111
+ )
112
+
113
+ nil
114
+ end
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class ActionAttempts < BaseClient
6
+ def get(action_attempt_id:, wait_for_action_attempt: nil)
7
+ action_attempt = request_seam_object(
8
+ :post,
9
+ "/action_attempts/get",
10
+ Seam::ActionAttempt,
11
+ "action_attempt",
12
+ body: {action_attempt_id: action_attempt_id}.compact
13
+ )
14
+
15
+ action_attempt.decide_and_wait(wait_for_action_attempt)
16
+ action_attempt
17
+ end
18
+
19
+ def list(action_attempt_ids:)
20
+ request_seam_object(
21
+ :post,
22
+ "/action_attempts/list",
23
+ Seam::ActionAttempt,
24
+ "action_attempts",
25
+ body: {action_attempt_ids: action_attempt_ids}.compact
26
+ )
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class BaseClient
6
+ attr_accessor :client
7
+
8
+ def initialize(client)
9
+ @client = client
10
+ end
11
+
12
+ def request_seam_object(*attrs)
13
+ client.request_seam_object(*attrs)
14
+ end
15
+
16
+ def request_seam(*attrs)
17
+ client.request_seam(*attrs)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class ClientSessions < BaseClient
6
+ def create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_ids: nil)
7
+ request_seam_object(
8
+ :post,
9
+ "/client_sessions/create",
10
+ Seam::ClientSession,
11
+ "client_session",
12
+ body: {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_ids: user_identity_ids}.compact
13
+ )
14
+ end
15
+
16
+ def delete(client_session_id:)
17
+ request_seam(
18
+ :post,
19
+ "/client_sessions/delete",
20
+ body: {client_session_id: client_session_id}.compact
21
+ )
22
+
23
+ nil
24
+ end
25
+
26
+ def get(client_session_id: nil, user_identifier_key: nil)
27
+ request_seam_object(
28
+ :post,
29
+ "/client_sessions/get",
30
+ Seam::ClientSession,
31
+ "client_session",
32
+ body: {client_session_id: client_session_id, user_identifier_key: user_identifier_key}.compact
33
+ )
34
+ end
35
+
36
+ def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_ids: nil)
37
+ request_seam_object(
38
+ :post,
39
+ "/client_sessions/get_or_create",
40
+ Seam::ClientSession,
41
+ "client_session",
42
+ body: {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_ids: user_identity_ids}.compact
43
+ )
44
+ end
45
+
46
+ def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_ids: nil)
47
+ request_seam(
48
+ :post,
49
+ "/client_sessions/grant_access",
50
+ body: {client_session_id: client_session_id, connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, user_identifier_key: user_identifier_key, user_identity_ids: user_identity_ids}.compact
51
+ )
52
+
53
+ nil
54
+ end
55
+
56
+ def list(client_session_id: nil, connect_webview_id: nil, user_identifier_key: nil, user_identity_id: nil, without_user_identifier_key: nil)
57
+ request_seam_object(
58
+ :post,
59
+ "/client_sessions/list",
60
+ Seam::ClientSession,
61
+ "client_sessions",
62
+ body: {client_session_id: client_session_id, connect_webview_id: connect_webview_id, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, without_user_identifier_key: without_user_identifier_key}.compact
63
+ )
64
+ end
65
+
66
+ def revoke(client_session_id:)
67
+ request_seam(
68
+ :post,
69
+ "/client_sessions/revoke",
70
+ body: {client_session_id: client_session_id}.compact
71
+ )
72
+
73
+ nil
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class ConnectWebviews < BaseClient
6
+ def create(accepted_providers: nil, automatically_manage_new_devices: nil, custom_metadata: nil, custom_redirect_failure_url: nil, custom_redirect_url: nil, device_selection_mode: nil, provider_category: nil, wait_for_device_creation: nil)
7
+ request_seam_object(
8
+ :post,
9
+ "/connect_webviews/create",
10
+ Seam::ConnectWebview,
11
+ "connect_webview",
12
+ body: {accepted_providers: accepted_providers, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata, custom_redirect_failure_url: custom_redirect_failure_url, custom_redirect_url: custom_redirect_url, device_selection_mode: device_selection_mode, provider_category: provider_category, wait_for_device_creation: wait_for_device_creation}.compact
13
+ )
14
+ end
15
+
16
+ def delete(connect_webview_id:)
17
+ request_seam(
18
+ :post,
19
+ "/connect_webviews/delete",
20
+ body: {connect_webview_id: connect_webview_id}.compact
21
+ )
22
+
23
+ nil
24
+ end
25
+
26
+ def get(connect_webview_id:)
27
+ request_seam_object(
28
+ :post,
29
+ "/connect_webviews/get",
30
+ Seam::ConnectWebview,
31
+ "connect_webview",
32
+ body: {connect_webview_id: connect_webview_id}.compact
33
+ )
34
+ end
35
+
36
+ def list(custom_metadata_has: nil, user_identifier_key: nil)
37
+ request_seam_object(
38
+ :post,
39
+ "/connect_webviews/list",
40
+ Seam::ConnectWebview,
41
+ "connect_webviews",
42
+ body: {custom_metadata_has: custom_metadata_has, user_identifier_key: user_identifier_key}.compact
43
+ )
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class ConnectedAccounts < BaseClient
6
+ def delete(connected_account_id:, sync: nil)
7
+ request_seam(
8
+ :post,
9
+ "/connected_accounts/delete",
10
+ body: {connected_account_id: connected_account_id, sync: sync}.compact
11
+ )
12
+
13
+ nil
14
+ end
15
+
16
+ def get(connected_account_id: nil, email: nil)
17
+ request_seam_object(
18
+ :post,
19
+ "/connected_accounts/get",
20
+ Seam::ConnectedAccount,
21
+ "connected_account",
22
+ body: {connected_account_id: connected_account_id, email: email}.compact
23
+ )
24
+ end
25
+
26
+ def list(custom_metadata_has: nil)
27
+ request_seam_object(
28
+ :post,
29
+ "/connected_accounts/list",
30
+ Seam::ConnectedAccount,
31
+ "connected_accounts",
32
+ body: {custom_metadata_has: custom_metadata_has}.compact
33
+ )
34
+ end
35
+
36
+ def update(connected_account_id:, automatically_manage_new_devices: nil, custom_metadata: nil)
37
+ request_seam_object(
38
+ :post,
39
+ "/connected_accounts/update",
40
+ Seam::ConnectedAccount,
41
+ "connected_account",
42
+ body: {connected_account_id: connected_account_id, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata}.compact
43
+ )
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,65 @@
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
@@ -0,0 +1,17 @@
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
@@ -0,0 +1,37 @@
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
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,53 @@
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
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,15 @@
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
@@ -0,0 +1,57 @@
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