seam 2.19.0 → 2.21.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +98 -0
  4. data/lib/seam/http_single_workspace.rb +5 -0
  5. data/lib/seam/paginator.rb +106 -0
  6. data/lib/seam/request.rb +2 -0
  7. data/lib/seam/routes/clients/access_codes.rb +8 -2
  8. data/lib/seam/routes/clients/acs_access_groups.rb +6 -6
  9. data/lib/seam/routes/clients/acs_credentials.rb +6 -6
  10. data/lib/seam/routes/clients/acs_encoders.rb +8 -0
  11. data/lib/seam/routes/clients/acs_entrances.rb +4 -4
  12. data/lib/seam/routes/clients/acs_users.rb +16 -16
  13. data/lib/seam/routes/clients/connected_accounts.rb +2 -2
  14. data/lib/seam/routes/clients/devices.rb +2 -2
  15. data/lib/seam/routes/clients/devices_unmanaged.rb +2 -2
  16. data/lib/seam/routes/clients/events.rb +2 -2
  17. data/lib/seam/routes/clients/index.rb +1 -1
  18. data/lib/seam/routes/clients/locks.rb +2 -2
  19. data/lib/seam/routes/clients/noise_sensors.rb +2 -2
  20. data/lib/seam/routes/clients/thermostats.rb +14 -2
  21. data/lib/seam/routes/clients/thermostats_daily_programs.rb +34 -0
  22. data/lib/seam/routes/clients/user_identities.rb +4 -4
  23. data/lib/seam/routes/clients/workspaces.rb +2 -2
  24. data/lib/seam/routes/resources/acs_system.rb +1 -1
  25. data/lib/seam/routes/resources/acs_user.rb +2 -2
  26. data/lib/seam/routes/resources/event.rb +1 -1
  27. data/lib/seam/routes/resources/index.rb +2 -0
  28. data/lib/seam/routes/resources/phone_registration.rb +9 -0
  29. data/lib/seam/routes/resources/phone_session.rb +9 -0
  30. data/lib/seam/routes/resources/thermostat_schedule.rb +1 -1
  31. data/lib/seam/routes/resources/unmanaged_acs_user.rb +2 -2
  32. data/lib/seam/routes/resources/workspace.rb +1 -1
  33. data/lib/seam/routes/routes.rb +0 -4
  34. data/lib/seam/version.rb +1 -1
  35. metadata +6 -3
  36. data/lib/seam/routes/clients/bridges.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 184d967c88174e53b71ed3aa34780ea96f759fb56230ebd63ba559cdb364d69d
4
- data.tar.gz: 14f957da0a9a57506521bb6e065b5a0ecec8f40129caf1db5cd5e8694702ca67
3
+ metadata.gz: 374e9e4af3b3aa5d0bec8bded2917d6180a3b39aa34e3eb594950aab895b7e13
4
+ data.tar.gz: bcd0fd3977ceb2d1c3e381f3233a5924f8de1925151b0466512e80705b6c2c81
5
5
  SHA512:
6
- metadata.gz: 37e4c104a96c30bad0a51c95a7e4b0964d9f73950b95ea99346ff5f72a3046e6b5af5e2a0b5ba1a267d2530f4047dce9d828cc1fc718003b0de8cb76f721d345
7
- data.tar.gz: 8236799a6ab9c33e840099e189133f9ceb318f87e9db5550cdc3787844f4554306a9297e7dd742837d81f83af47c5464353ddf918a3599832cbeda678e62b379
6
+ metadata.gz: d172fd0528e40e39b53b4409c003951f1fd13aaf06ebeb9776f213d0c5b29c5cdaf735e6894219378fc00c2028c6e01d3b6e0a0b8804956ba1f1c760560d8c63
7
+ data.tar.gz: f78ab1716d899c1468fbf4e399cfe903d76edab8e8a5144e66f099fa6b14f10a33036f269af5ff160f5f29ee1199ca77d3318cfa0ba945e7449fd1f7fa8515fb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seam (2.19.0)
4
+ seam (2.21.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-retry (~> 2.2)
7
7
  svix (~> 1.30)
data/README.md CHANGED
@@ -27,6 +27,11 @@ accurate and fully typed.
27
27
  - [API Key](#api-key)
28
28
  - [Personal Access Token](#personal-access-token)
29
29
  - [Action Attempts](#action-attempts)
30
+ - [Pagination](#pagination)
31
+ - [Manually fetch pages with the next_page_cursor](#manually-fetch-pages-with-the-next_page_cursor)
32
+ - [Resume pagination](#resume-pagination)
33
+ - [Iterate over all resources](#iterate-over-all-resources)
34
+ - [Return all resources across all pages as a list](#return-all-resources-across-all-pages-as-a-list)
30
35
  - [Interacting with Multiple Workspaces](#interacting-with-multiple-workspaces)
31
36
  - [Webhooks](#webhooks)
32
37
  - [Advanced Usage](#advanced-usage)
@@ -215,6 +220,99 @@ rescue Seam::ActionAttemptTimeoutError
215
220
  end
216
221
  ```
217
222
 
223
+ ### Pagination
224
+
225
+ Some Seam API endpoints that return lists of resources support pagination.
226
+ Use the `Seam::Paginator` class to fetch and process resources across multiple pages.
227
+
228
+ #### Manually fetch pages with the next_page_cursor
229
+
230
+ ```ruby
231
+ require "seam"
232
+
233
+ seam = Seam.new
234
+
235
+ paginator = seam.create_paginator(seam.connected_accounts.method(:list), {limit: 20})
236
+
237
+ connected_accounts, pagination = paginator.first_page
238
+
239
+ if pagination.has_next_page?
240
+ more_connected_accounts, _ = paginator.next_page(pagination.next_page_cursor)
241
+ end
242
+ ```
243
+
244
+ #### Resume pagination
245
+
246
+ Get the first page on initial load and store the state (e.g., in memory or a file):
247
+
248
+ ```ruby
249
+ require "seam"
250
+ require "json"
251
+
252
+ seam = Seam.new
253
+
254
+ params = {limit: 20}
255
+ paginator = seam.create_paginator(seam.connected_accounts.method(:list), params)
256
+
257
+ connected_accounts, pagination = paginator.first_page
258
+
259
+ # Example: Store state for later use (e.g., in a file or database)
260
+ pagination_state = {
261
+ "params" => params,
262
+ "next_page_cursor" => pagination.next_page_cursor,
263
+ "has_next_page" => pagination.has_next_page?
264
+ }
265
+ File.write("/tmp/seam_connected_accounts_list.json", JSON.dump(pagination_state))
266
+ ```
267
+
268
+ Get the next page at a later time using the stored state:
269
+
270
+ ```ruby
271
+ require "seam"
272
+ require "json"
273
+
274
+ seam = Seam.new
275
+
276
+ # Example: Load state from where it was stored
277
+ pagination_state_json = File.read("/tmp/seam_connected_accounts_list.json")
278
+ pagination_state = JSON.parse(pagination_state_json)
279
+
280
+ if pagination_state["has_next_page"]
281
+ paginator = seam.create_paginator(
282
+ seam.connected_accounts.method(:list), pagination_state["params"]
283
+ )
284
+ more_connected_accounts, _ = paginator.next_page(
285
+ pagination_state["next_page_cursor"]
286
+ )
287
+ end
288
+ ```
289
+
290
+ #### Iterate over all resources
291
+
292
+ ```ruby
293
+ require "seam"
294
+
295
+ seam = Seam.new
296
+
297
+ paginator = seam.create_paginator(seam.connected_accounts.method(:list), {limit: 20})
298
+
299
+ paginator.flatten.each do |account|
300
+ puts account.account_type_display_name
301
+ end
302
+ ```
303
+
304
+ #### Return all resources across all pages as a list
305
+
306
+ ```ruby
307
+ require "seam"
308
+
309
+ seam = Seam.new
310
+
311
+ paginator = seam.create_paginator(seam.connected_accounts.method(:list), {limit: 20})
312
+
313
+ all_connected_accounts = paginator.flatten_to_list
314
+ ```
315
+
218
316
  ### Interacting with Multiple Workspaces
219
317
 
220
318
  Some Seam API endpoints interact with multiple workspaces. The `Seam::Http::SeamMultiWorkspace` client is not bound to a specific workspace and may use those endpoints with a personal access token authentication method.
@@ -7,6 +7,7 @@ require_relative "routes/clients/index"
7
7
  require_relative "routes/routes"
8
8
  require_relative "version"
9
9
  require_relative "deep_hash_accessor"
10
+ require_relative "paginator"
10
11
 
11
12
  module Seam
12
13
  module Http
@@ -32,6 +33,10 @@ module Seam
32
33
  Seam::LTS_VERSION
33
34
  end
34
35
 
36
+ def create_paginator(request, params = {})
37
+ Paginator.new(request, params)
38
+ end
39
+
35
40
  def self.from_api_key(api_key, endpoint: nil, wait_for_action_attempt: false, faraday_options: {}, faraday_retry_options: {})
36
41
  new(api_key: api_key, endpoint: endpoint, wait_for_action_attempt: wait_for_action_attempt,
37
42
  faraday_options: faraday_options, faraday_retry_options: faraday_retry_options)
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faraday"
4
+ require_relative "http"
5
+
6
+ module Seam
7
+ THREAD_CONTEXT_KEY = :seam_pagination_context
8
+ PaginationContext = Struct.new(:pagination)
9
+
10
+ class Paginator
11
+ def initialize(request, params = {})
12
+ raise ArgumentError, "request must be a Method" unless request.is_a?(Method)
13
+ raise ArgumentError, "params must be a Hash" unless params.is_a?(Hash)
14
+
15
+ @request = request
16
+ @params = params.transform_keys(&:to_sym)
17
+ end
18
+
19
+ def first_page
20
+ fetch_page(@params)
21
+ end
22
+
23
+ def next_page(next_page_cursor)
24
+ if next_page_cursor.nil? || next_page_cursor.empty?
25
+ raise ArgumentError,
26
+ "Cannot get the next page with a nil or empty next_page_cursor."
27
+ end
28
+
29
+ fetch_page(@params.merge(page_cursor: next_page_cursor))
30
+ end
31
+
32
+ def flatten_to_list
33
+ all_items = []
34
+ current_items, pagination = first_page
35
+
36
+ all_items.concat(current_items) if current_items
37
+
38
+ while pagination&.has_next_page? && (cursor = pagination.next_page_cursor)
39
+ current_items, pagination = next_page(cursor)
40
+ all_items.concat(current_items) if current_items
41
+ end
42
+
43
+ all_items
44
+ end
45
+
46
+ def flatten
47
+ Enumerator.new do |yielder|
48
+ current_items, pagination = first_page
49
+ current_items&.each { |item| yielder << item }
50
+
51
+ while pagination&.has_next_page? && (cursor = pagination.next_page_cursor)
52
+ current_items, pagination = next_page(cursor)
53
+ current_items&.each { |item| yielder << item }
54
+ end
55
+ end
56
+ end
57
+
58
+ private
59
+
60
+ def fetch_page(params)
61
+ context = PaginationContext.new(nil)
62
+ Thread.current[THREAD_CONTEXT_KEY] = context
63
+
64
+ begin
65
+ res_data = @request.call(**params)
66
+ pagination_result = Pagination.from_hash(context.pagination)
67
+ [res_data, pagination_result]
68
+ ensure
69
+ Thread.current[THREAD_CONTEXT_KEY] = nil
70
+ end
71
+ end
72
+ end
73
+
74
+ Pagination = Struct.new(:has_next_page, :next_page_cursor, :next_page_url, keyword_init: true) do
75
+ def self.from_hash(hash)
76
+ return nil unless hash.is_a?(Hash) && !hash.empty?
77
+
78
+ new(
79
+ has_next_page: hash.fetch("has_next_page", false),
80
+ next_page_cursor: hash.fetch("next_page_cursor", nil),
81
+ next_page_url: hash.fetch("next_page_url", nil)
82
+ )
83
+ end
84
+
85
+ def has_next_page?
86
+ has_next_page == true
87
+ end
88
+ end
89
+
90
+ class PaginationMiddleware < Faraday::Middleware
91
+ def on_complete(env)
92
+ context = Thread.current[THREAD_CONTEXT_KEY]
93
+ return unless context.is_a?(PaginationContext)
94
+
95
+ pagination_hash = extract_pagination(env)
96
+ context.pagination = pagination_hash if pagination_hash
97
+ end
98
+
99
+ private
100
+
101
+ def extract_pagination(env)
102
+ body = env[:body]
103
+ body["pagination"] if body.is_a?(Hash) && body.key?("pagination")
104
+ end
105
+ end
106
+ end
data/lib/seam/request.rb CHANGED
@@ -4,6 +4,7 @@ require "faraday"
4
4
  require "faraday/retry"
5
5
  require_relative "lts_version"
6
6
  require_relative "version"
7
+ require_relative "paginator"
7
8
 
8
9
  module Seam
9
10
  module Http
@@ -25,6 +26,7 @@ module Seam
25
26
 
26
27
  Faraday.new(options) do |builder|
27
28
  builder.request :json
29
+ builder.use Seam::PaginationMiddleware
28
30
  builder.response :json
29
31
  builder.use ResponseMiddleware
30
32
  builder.request :retry, faraday_retry_options
@@ -46,8 +46,8 @@ module Seam
46
46
  Seam::Resources::AccessCode.load_from_response(res.body["access_code"])
47
47
  end
48
48
 
49
- def list(access_code_ids: nil, device_id: nil, user_identifier_key: nil)
50
- res = @client.post("/access_codes/list", {access_code_ids: access_code_ids, device_id: device_id, user_identifier_key: user_identifier_key}.compact)
49
+ def list(access_code_ids: nil, device_id: nil, limit: nil, page_cursor: nil, user_identifier_key: nil)
50
+ res = @client.post("/access_codes/list", {access_code_ids: access_code_ids, device_id: device_id, limit: limit, page_cursor: page_cursor, user_identifier_key: user_identifier_key}.compact)
51
51
 
52
52
  Seam::Resources::AccessCode.load_from_response(res.body["access_codes"])
53
53
  end
@@ -58,6 +58,12 @@ module Seam
58
58
  Seam::Resources::AccessCode.load_from_response(res.body["access_code"])
59
59
  end
60
60
 
61
+ def report_device_constraints(device_id:, max_code_length: nil, min_code_length: nil, supported_code_lengths: nil)
62
+ @client.post("/access_codes/report_device_constraints", {device_id: device_id, max_code_length: max_code_length, min_code_length: min_code_length, supported_code_lengths: supported_code_lengths}.compact)
63
+
64
+ nil
65
+ end
66
+
61
67
  def update(access_code_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, device_id: nil, ends_at: nil, is_external_modification_allowed: nil, is_managed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, sync: nil, type: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil)
62
68
  @client.post("/access_codes/update", {access_code_id: access_code_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, device_id: device_id, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_managed: is_managed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, sync: sync, type: type, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact)
63
69
 
@@ -8,8 +8,8 @@ module Seam
8
8
  @defaults = defaults
9
9
  end
10
10
 
11
- def add_user(acs_access_group_id:, acs_user_id:)
12
- @client.post("/acs/access_groups/add_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
11
+ def add_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
12
+ @client.post("/acs/access_groups/add_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
13
13
 
14
14
  nil
15
15
  end
@@ -20,8 +20,8 @@ module Seam
20
20
  Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_group"])
21
21
  end
22
22
 
23
- def list(acs_system_id: nil, acs_user_id: nil)
24
- res = @client.post("/acs/access_groups/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id}.compact)
23
+ def list(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
24
+ res = @client.post("/acs/access_groups/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
25
25
 
26
26
  Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_groups"])
27
27
  end
@@ -38,8 +38,8 @@ module Seam
38
38
  Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
39
39
  end
40
40
 
41
- def remove_user(acs_access_group_id:, acs_user_id:)
42
- @client.post("/acs/access_groups/remove_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
41
+ def remove_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
42
+ @client.post("/acs/access_groups/remove_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
43
43
 
44
44
  nil
45
45
  end
@@ -8,14 +8,14 @@ module Seam
8
8
  @defaults = defaults
9
9
  end
10
10
 
11
- def assign(acs_credential_id:, acs_user_id:)
12
- @client.post("/acs/credentials/assign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id}.compact)
11
+ def assign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil)
12
+ @client.post("/acs/credentials/assign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
13
13
 
14
14
  nil
15
15
  end
16
16
 
17
- def create(access_method:, acs_user_id:, allowed_acs_entrance_ids: nil, assa_abloy_vostio_metadata: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, salto_space_metadata: nil, starts_at: nil, visionline_metadata: nil)
18
- res = @client.post("/acs/credentials/create", {access_method: access_method, acs_user_id: acs_user_id, allowed_acs_entrance_ids: allowed_acs_entrance_ids, assa_abloy_vostio_metadata: assa_abloy_vostio_metadata, code: code, credential_manager_acs_system_id: credential_manager_acs_system_id, ends_at: ends_at, is_multi_phone_sync_credential: is_multi_phone_sync_credential, salto_space_metadata: salto_space_metadata, starts_at: starts_at, visionline_metadata: visionline_metadata}.compact)
17
+ def create(access_method:, acs_system_id: nil, acs_user_id: nil, allowed_acs_entrance_ids: nil, assa_abloy_vostio_metadata: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, salto_space_metadata: nil, starts_at: nil, user_identity_id: nil, visionline_metadata: nil)
18
+ res = @client.post("/acs/credentials/create", {access_method: access_method, acs_system_id: acs_system_id, acs_user_id: acs_user_id, allowed_acs_entrance_ids: allowed_acs_entrance_ids, assa_abloy_vostio_metadata: assa_abloy_vostio_metadata, code: code, credential_manager_acs_system_id: credential_manager_acs_system_id, ends_at: ends_at, is_multi_phone_sync_credential: is_multi_phone_sync_credential, salto_space_metadata: salto_space_metadata, starts_at: starts_at, user_identity_id: user_identity_id, visionline_metadata: visionline_metadata}.compact)
19
19
 
20
20
  Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"])
21
21
  end
@@ -44,8 +44,8 @@ module Seam
44
44
  Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
45
45
  end
46
46
 
47
- def unassign(acs_credential_id:, acs_user_id:)
48
- @client.post("/acs/credentials/unassign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id}.compact)
47
+ def unassign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil)
48
+ @client.post("/acs/credentials/unassign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
49
49
 
50
50
  nil
51
51
  end
@@ -10,6 +10,14 @@ module Seam
10
10
  @defaults = defaults
11
11
  end
12
12
 
13
+ def encode_access_method(access_method_id:, acs_encoder_id:, wait_for_action_attempt: nil)
14
+ res = @client.post("/acs/encoders/encode_access_method", {access_method_id: access_method_id, acs_encoder_id: acs_encoder_id}.compact)
15
+
16
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
17
+
18
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
19
+ end
20
+
13
21
  def encode_credential(acs_credential_id:, acs_encoder_id:, wait_for_action_attempt: nil)
14
22
  res = @client.post("/acs/encoders/encode_credential", {acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id}.compact)
15
23
 
@@ -14,14 +14,14 @@ module Seam
14
14
  Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrance"])
15
15
  end
16
16
 
17
- def grant_access(acs_entrance_id:, acs_user_id:)
18
- @client.post("/acs/entrances/grant_access", {acs_entrance_id: acs_entrance_id, acs_user_id: acs_user_id}.compact)
17
+ def grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil)
18
+ @client.post("/acs/entrances/grant_access", {acs_entrance_id: acs_entrance_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
19
19
 
20
20
  nil
21
21
  end
22
22
 
23
- def list(acs_credential_id: nil, acs_system_id: nil)
24
- res = @client.post("/acs/entrances/list", {acs_credential_id: acs_credential_id, acs_system_id: acs_system_id}.compact)
23
+ def list(acs_credential_id: nil, acs_system_id: nil, location_id: nil)
24
+ res = @client.post("/acs/entrances/list", {acs_credential_id: acs_credential_id, acs_system_id: acs_system_id, location_id: location_id}.compact)
25
25
 
26
26
  Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
27
27
  end
@@ -20,14 +20,14 @@ module Seam
20
20
  Seam::Resources::AcsUser.load_from_response(res.body["acs_user"])
21
21
  end
22
22
 
23
- def delete(acs_user_id:)
24
- @client.post("/acs/users/delete", {acs_user_id: acs_user_id}.compact)
23
+ def delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
24
+ @client.post("/acs/users/delete", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
25
25
 
26
26
  nil
27
27
  end
28
28
 
29
- def get(acs_user_id:)
30
- res = @client.post("/acs/users/get", {acs_user_id: acs_user_id}.compact)
29
+ def get(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
30
+ res = @client.post("/acs/users/get", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
31
31
 
32
32
  Seam::Resources::AcsUser.load_from_response(res.body["acs_user"])
33
33
  end
@@ -38,38 +38,38 @@ module Seam
38
38
  Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
39
39
  end
40
40
 
41
- def list_accessible_entrances(acs_user_id:)
42
- res = @client.post("/acs/users/list_accessible_entrances", {acs_user_id: acs_user_id}.compact)
41
+ def list_accessible_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
42
+ res = @client.post("/acs/users/list_accessible_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
43
43
 
44
44
  Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
45
45
  end
46
46
 
47
- def remove_from_access_group(acs_access_group_id:, acs_user_id:)
48
- @client.post("/acs/users/remove_from_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
47
+ def remove_from_access_group(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
48
+ @client.post("/acs/users/remove_from_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
49
49
 
50
50
  nil
51
51
  end
52
52
 
53
- def revoke_access_to_all_entrances(acs_user_id:)
54
- @client.post("/acs/users/revoke_access_to_all_entrances", {acs_user_id: acs_user_id}.compact)
53
+ def revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
54
+ @client.post("/acs/users/revoke_access_to_all_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
55
55
 
56
56
  nil
57
57
  end
58
58
 
59
- def suspend(acs_user_id:)
60
- @client.post("/acs/users/suspend", {acs_user_id: acs_user_id}.compact)
59
+ def suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
60
+ @client.post("/acs/users/suspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
61
61
 
62
62
  nil
63
63
  end
64
64
 
65
- def unsuspend(acs_user_id:)
66
- @client.post("/acs/users/unsuspend", {acs_user_id: acs_user_id}.compact)
65
+ def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
66
+ @client.post("/acs/users/unsuspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
67
67
 
68
68
  nil
69
69
  end
70
70
 
71
- def update(acs_user_id:, access_schedule: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil)
72
- @client.post("/acs/users/update", {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)
71
+ def update(access_schedule: nil, acs_system_id: nil, acs_user_id: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil, user_identity_id: nil)
72
+ @client.post("/acs/users/update", {access_schedule: access_schedule, acs_system_id: acs_system_id, acs_user_id: acs_user_id, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number, user_identity_id: user_identity_id}.compact)
73
73
 
74
74
  nil
75
75
  end
@@ -20,8 +20,8 @@ module Seam
20
20
  Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_account"])
21
21
  end
22
22
 
23
- def list(custom_metadata_has: nil, limit: nil, page_cursor: nil, user_identifier_key: nil)
24
- res = @client.post("/connected_accounts/list", {custom_metadata_has: custom_metadata_has, limit: limit, page_cursor: page_cursor, user_identifier_key: user_identifier_key}.compact)
23
+ def list(custom_metadata_has: nil, customer_ids: nil, limit: nil, page_cursor: nil, user_identifier_key: nil)
24
+ res = @client.post("/connected_accounts/list", {custom_metadata_has: custom_metadata_has, customer_ids: customer_ids, limit: limit, page_cursor: page_cursor, user_identifier_key: user_identifier_key}.compact)
25
25
 
26
26
  Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_accounts"])
27
27
  end
@@ -22,8 +22,8 @@ module Seam
22
22
  Seam::Resources::Device.load_from_response(res.body["device"])
23
23
  end
24
24
 
25
- 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_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, unstable_location_id: nil, user_identifier_key: nil)
26
- 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, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
25
+ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_ids: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, unstable_location_id: nil, user_identifier_key: nil)
26
+ 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_ids: customer_ids, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
27
27
 
28
28
  Seam::Resources::Device.load_from_response(res.body["devices"])
29
29
  end
@@ -14,8 +14,8 @@ module Seam
14
14
  Seam::Resources::UnmanagedDevice.load_from_response(res.body["device"])
15
15
  end
16
16
 
17
- 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_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, unstable_location_id: nil, user_identifier_key: nil)
18
- 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, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
17
+ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_ids: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, unstable_location_id: nil, user_identifier_key: nil)
18
+ 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_ids: customer_ids, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
19
19
 
20
20
  Seam::Resources::UnmanagedDevice.load_from_response(res.body["devices"])
21
21
  end
@@ -14,8 +14,8 @@ module Seam
14
14
  Seam::Resources::SeamEvent.load_from_response(res.body["event"])
15
15
  end
16
16
 
17
- def list(access_code_id: nil, access_code_ids: nil, acs_system_id: nil, acs_system_ids: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, unstable_offset: nil)
18
- res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, unstable_offset: unstable_offset}.compact)
17
+ def list(access_code_id: nil, access_code_ids: nil, acs_system_id: nil, acs_system_ids: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_ids: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, unstable_offset: nil)
18
+ res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_ids: customer_ids, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, unstable_offset: unstable_offset}.compact)
19
19
 
20
20
  Seam::Resources::SeamEvent.load_from_response(res.body["events"])
21
21
  end
@@ -12,7 +12,6 @@ require_relative "acs_entrances"
12
12
  require_relative "acs_systems"
13
13
  require_relative "acs_users"
14
14
  require_relative "action_attempts"
15
- require_relative "bridges"
16
15
  require_relative "client_sessions"
17
16
  require_relative "connect_webviews"
18
17
  require_relative "connected_accounts"
@@ -28,6 +27,7 @@ require_relative "noise_sensors_simulate"
28
27
  require_relative "phones"
29
28
  require_relative "phones_simulate"
30
29
  require_relative "thermostats"
30
+ require_relative "thermostats_daily_programs"
31
31
  require_relative "thermostats_schedules"
32
32
  require_relative "thermostats_simulate"
33
33
  require_relative "user_identities"
@@ -16,8 +16,8 @@ module Seam
16
16
  Seam::Resources::Device.load_from_response(res.body["device"])
17
17
  end
18
18
 
19
- 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_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, unstable_location_id: nil, user_identifier_key: nil)
20
- 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, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
19
+ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_ids: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, unstable_location_id: nil, user_identifier_key: nil)
20
+ 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_ids: customer_ids, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
21
21
 
22
22
  Seam::Resources::Device.load_from_response(res.body["devices"])
23
23
  end
@@ -16,8 +16,8 @@ module Seam
16
16
  @simulate ||= Seam::Clients::NoiseSensorsSimulate.new(client: @client, defaults: @defaults)
17
17
  end
18
18
 
19
- 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_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, unstable_location_id: nil, user_identifier_key: nil)
20
- 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, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
19
+ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_ids: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, unstable_location_id: nil, user_identifier_key: nil)
20
+ 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_ids: customer_ids, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
21
21
 
22
22
  Seam::Resources::Device.load_from_response(res.body["devices"])
23
23
  end
@@ -10,6 +10,10 @@ module Seam
10
10
  @defaults = defaults
11
11
  end
12
12
 
13
+ def daily_programs
14
+ @daily_programs ||= Seam::Clients::ThermostatsDailyPrograms.new(client: @client, defaults: @defaults)
15
+ end
16
+
13
17
  def schedules
14
18
  @schedules ||= Seam::Clients::ThermostatsSchedules.new(client: @client, defaults: @defaults)
15
19
  end
@@ -62,8 +66,8 @@ module Seam
62
66
  Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
63
67
  end
64
68
 
65
- 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_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, unstable_location_id: nil, user_identifier_key: nil)
66
- res = @client.post("/thermostats/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, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
69
+ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_ids: nil, device_ids: nil, device_type: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, page_cursor: nil, unstable_location_id: nil, user_identifier_key: nil)
70
+ res = @client.post("/thermostats/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_ids: customer_ids, device_ids: device_ids, device_type: device_type, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
67
71
 
68
72
  Seam::Resources::Device.load_from_response(res.body["devices"])
69
73
  end
@@ -109,6 +113,14 @@ module Seam
109
113
 
110
114
  nil
111
115
  end
116
+
117
+ def update_weekly_program(device_id:, friday_program_id: nil, monday_program_id: nil, saturday_program_id: nil, sunday_program_id: nil, thursday_program_id: nil, tuesday_program_id: nil, wednesday_program_id: nil, wait_for_action_attempt: nil)
118
+ res = @client.post("/thermostats/update_weekly_program", {device_id: device_id, friday_program_id: friday_program_id, monday_program_id: monday_program_id, saturday_program_id: saturday_program_id, sunday_program_id: sunday_program_id, thursday_program_id: thursday_program_id, tuesday_program_id: tuesday_program_id, wednesday_program_id: wednesday_program_id}.compact)
119
+
120
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
121
+
122
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
123
+ end
112
124
  end
113
125
  end
114
126
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "seam/helpers/action_attempt"
4
+
5
+ module Seam
6
+ module Clients
7
+ class ThermostatsDailyPrograms
8
+ def initialize(client:, defaults:)
9
+ @client = client
10
+ @defaults = defaults
11
+ end
12
+
13
+ def create(device_id:, name:, periods:)
14
+ @client.post("/thermostats/daily_programs/create", {device_id: device_id, name: name, periods: periods}.compact)
15
+
16
+ nil
17
+ end
18
+
19
+ def delete(thermostat_daily_program_id:)
20
+ @client.post("/thermostats/daily_programs/delete", {thermostat_daily_program_id: thermostat_daily_program_id}.compact)
21
+
22
+ nil
23
+ end
24
+
25
+ def update(name:, periods:, thermostat_daily_program_id:, wait_for_action_attempt: nil)
26
+ res = @client.post("/thermostats/daily_programs/update", {name: name, periods: periods, thermostat_daily_program_id: thermostat_daily_program_id}.compact)
27
+
28
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
29
+
30
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -18,8 +18,8 @@ module Seam
18
18
  nil
19
19
  end
20
20
 
21
- def create(email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
22
- res = @client.post("/user_identities/create", {email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact)
21
+ def create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
22
+ res = @client.post("/user_identities/create", {acs_system_ids: acs_system_ids, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact)
23
23
 
24
24
  Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"])
25
25
  end
@@ -30,8 +30,8 @@ module Seam
30
30
  nil
31
31
  end
32
32
 
33
- def generate_instant_key(user_identity_id:)
34
- res = @client.post("/user_identities/generate_instant_key", {user_identity_id: user_identity_id}.compact)
33
+ def generate_instant_key(user_identity_id:, max_use_count: nil)
34
+ res = @client.post("/user_identities/generate_instant_key", {user_identity_id: user_identity_id, max_use_count: max_use_count}.compact)
35
35
 
36
36
  Seam::Resources::InstantKey.load_from_response(res.body["instant_key"])
37
37
  end
@@ -10,8 +10,8 @@ module Seam
10
10
  @defaults = defaults
11
11
  end
12
12
 
13
- def create(name:, company_name: nil, connect_partner_name: nil, is_sandbox: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil)
14
- res = @client.post("/workspaces/create", {name: name, company_name: company_name, connect_partner_name: connect_partner_name, is_sandbox: is_sandbox, webview_logo_shape: webview_logo_shape, webview_primary_button_color: webview_primary_button_color, webview_primary_button_text_color: webview_primary_button_text_color, webview_success_message: webview_success_message}.compact)
13
+ def create(name:, company_name: nil, connect_partner_name: nil, connect_webview_customization: nil, is_sandbox: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil)
14
+ res = @client.post("/workspaces/create", {name: name, company_name: company_name, connect_partner_name: connect_partner_name, connect_webview_customization: connect_webview_customization, is_sandbox: is_sandbox, webview_logo_shape: webview_logo_shape, webview_primary_button_color: webview_primary_button_color, webview_primary_button_text_color: webview_primary_button_text_color, webview_success_message: webview_success_message}.compact)
15
15
 
16
16
  Seam::Resources::Workspace.load_from_response(res.body["workspace"])
17
17
  end
@@ -3,7 +3,7 @@
3
3
  module Seam
4
4
  module Resources
5
5
  class AcsSystem < BaseResource
6
- attr_accessor :acs_access_group_count, :acs_system_id, :acs_user_count, :can_add_acs_users_to_acs_access_groups, :can_automate_enrollment, :can_create_acs_access_groups, :can_remove_acs_users_from_acs_access_groups, :connected_account_id, :connected_account_ids, :default_credential_manager_acs_system_id, :external_type, :external_type_display_name, :image_alt_text, :image_url, :is_credential_manager, :location, :name, :system_type, :system_type_display_name, :visionline_metadata, :workspace_id
6
+ attr_accessor :acs_access_group_count, :acs_system_id, :acs_user_count, :connected_account_id, :connected_account_ids, :default_credential_manager_acs_system_id, :external_type, :external_type_display_name, :image_alt_text, :image_url, :is_credential_manager, :location, :name, :system_type, :system_type_display_name, :visionline_metadata, :workspace_id
7
7
 
8
8
  date_accessor :created_at
9
9
 
@@ -3,9 +3,9 @@
3
3
  module Seam
4
4
  module Resources
5
5
  class AcsUser < BaseResource
6
- attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_latest_desired_state_synced_with_provider, :is_managed, :is_suspended, :pending_mutations, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id
6
+ attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :connected_account_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_managed, :is_suspended, :pending_mutations, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id
7
7
 
8
- date_accessor :created_at, :latest_desired_state_synced_with_provider_at
8
+ date_accessor :created_at, :last_successful_sync_at
9
9
 
10
10
  include Seam::Resources::ResourceErrorsSupport
11
11
  include Seam::Resources::ResourceWarningsSupport
@@ -3,7 +3,7 @@
3
3
  module Seam
4
4
  module Resources
5
5
  class SeamEvent < BaseResource
6
- attr_accessor :access_code_id, :connected_account_id, :device_id, :event_id, :event_type, :workspace_id, :code, :backup_access_code_id, :acs_system_id, :acs_credential_id, :acs_user_id, :acs_encoder_id, :acs_access_group_id, :acs_entrance_id, :client_session_id, :connect_webview_id, :action_attempt_id, :action_type, :status, :error_code, :battery_level, :battery_status, :minut_metadata, :noise_level_decibels, :noise_level_nrs, :noise_threshold_id, :noise_threshold_name, :noiseaware_metadata, :method, :climate_preset_key, :is_fallback_climate_preset, :thermostat_schedule_id, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :lower_limit_celsius, :lower_limit_fahrenheit, :temperature_celsius, :temperature_fahrenheit, :upper_limit_celsius, :upper_limit_fahrenheit, :desired_temperature_celsius, :desired_temperature_fahrenheit, :device_name, :enrollment_automation_id
6
+ attr_accessor :access_code_id, :connected_account_id, :device_id, :event_id, :event_type, :workspace_id, :code, :backup_access_code_id, :access_grant_id, :acs_entrance_id, :access_method_id, :acs_system_id, :acs_credential_id, :acs_user_id, :acs_encoder_id, :acs_access_group_id, :client_session_id, :connect_webview_id, :action_attempt_id, :action_type, :status, :error_code, :battery_level, :battery_status, :minut_metadata, :noise_level_decibels, :noise_level_nrs, :noise_threshold_id, :noise_threshold_name, :noiseaware_metadata, :method, :climate_preset_key, :is_fallback_climate_preset, :thermostat_schedule_id, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :lower_limit_celsius, :lower_limit_fahrenheit, :temperature_celsius, :temperature_fahrenheit, :upper_limit_celsius, :upper_limit_fahrenheit, :desired_temperature_celsius, :desired_temperature_fahrenheit, :device_name, :enrollment_automation_id
7
7
 
8
8
  date_accessor :created_at, :occurred_at
9
9
  end
@@ -27,6 +27,8 @@ require_relative "network"
27
27
  require_relative "noise_threshold"
28
28
  require_relative "pagination"
29
29
  require_relative "phone"
30
+ require_relative "phone_registration"
31
+ require_relative "phone_session"
30
32
  require_relative "thermostat_schedule"
31
33
  require_relative "unmanaged_access_code"
32
34
  require_relative "unmanaged_acs_access_group"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Resources
5
+ class PhoneRegistration < BaseResource
6
+ attr_accessor :is_being_activated, :phone_registration_id, :provider_name, :provider_state
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Resources
5
+ class PhoneSession < BaseResource
6
+ attr_accessor :provider_sessions
7
+ end
8
+ end
9
+ end
@@ -3,7 +3,7 @@
3
3
  module Seam
4
4
  module Resources
5
5
  class ThermostatSchedule < BaseResource
6
- attr_accessor :climate_preset_key, :device_id, :max_override_period_minutes, :name, :thermostat_schedule_id, :unstable_is_override_allowed
6
+ attr_accessor :climate_preset_key, :device_id, :is_override_allowed, :max_override_period_minutes, :name, :thermostat_schedule_id, :workspace_id
7
7
 
8
8
  date_accessor :created_at, :ends_at, :starts_at
9
9
 
@@ -3,9 +3,9 @@
3
3
  module Seam
4
4
  module Resources
5
5
  class UnmanagedAcsUser < BaseResource
6
- attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_latest_desired_state_synced_with_provider, :is_managed, :is_suspended, :pending_mutations, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id
6
+ attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :connected_account_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_managed, :is_suspended, :pending_mutations, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id
7
7
 
8
- date_accessor :created_at, :latest_desired_state_synced_with_provider_at
8
+ date_accessor :created_at, :last_successful_sync_at
9
9
 
10
10
  include Seam::Resources::ResourceErrorsSupport
11
11
  include Seam::Resources::ResourceWarningsSupport
@@ -3,7 +3,7 @@
3
3
  module Seam
4
4
  module Resources
5
5
  class Workspace < BaseResource
6
- attr_accessor :company_name, :connect_partner_name, :is_sandbox, :is_suspended, :name, :workspace_id
6
+ attr_accessor :company_name, :connect_partner_name, :connect_webview_customization, :is_sandbox, :is_suspended, :name, :workspace_id
7
7
  end
8
8
  end
9
9
  end
@@ -14,10 +14,6 @@ module Seam
14
14
  @action_attempts ||= Seam::Clients::ActionAttempts.new(client: @client, defaults: @defaults)
15
15
  end
16
16
 
17
- def bridges
18
- @bridges ||= Seam::Clients::Bridges.new(client: @client, defaults: @defaults)
19
- end
20
-
21
17
  def client_sessions
22
18
  @client_sessions ||= Seam::Clients::ClientSessions.new(client: @client, defaults: @defaults)
23
19
  end
data/lib/seam/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seam
4
- VERSION = "2.19.0"
4
+ VERSION = "2.21.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seam
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.0
4
+ version: 2.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seam Labs, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-15 00:00:00.000000000 Z
11
+ date: 2025-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -200,6 +200,7 @@ files:
200
200
  - lib/seam/http_single_workspace.rb
201
201
  - lib/seam/lts_version.rb
202
202
  - lib/seam/options.rb
203
+ - lib/seam/paginator.rb
203
204
  - lib/seam/parse_options.rb
204
205
  - lib/seam/request.rb
205
206
  - lib/seam/routes/clients/access_codes.rb
@@ -214,7 +215,6 @@ files:
214
215
  - lib/seam/routes/clients/acs_systems.rb
215
216
  - lib/seam/routes/clients/acs_users.rb
216
217
  - lib/seam/routes/clients/action_attempts.rb
217
- - lib/seam/routes/clients/bridges.rb
218
218
  - lib/seam/routes/clients/client_sessions.rb
219
219
  - lib/seam/routes/clients/connect_webviews.rb
220
220
  - lib/seam/routes/clients/connected_accounts.rb
@@ -231,6 +231,7 @@ files:
231
231
  - lib/seam/routes/clients/phones.rb
232
232
  - lib/seam/routes/clients/phones_simulate.rb
233
233
  - lib/seam/routes/clients/thermostats.rb
234
+ - lib/seam/routes/clients/thermostats_daily_programs.rb
234
235
  - lib/seam/routes/clients/thermostats_schedules.rb
235
236
  - lib/seam/routes/clients/thermostats_simulate.rb
236
237
  - lib/seam/routes/clients/user_identities.rb
@@ -260,6 +261,8 @@ files:
260
261
  - lib/seam/routes/resources/noise_threshold.rb
261
262
  - lib/seam/routes/resources/pagination.rb
262
263
  - lib/seam/routes/resources/phone.rb
264
+ - lib/seam/routes/resources/phone_registration.rb
265
+ - lib/seam/routes/resources/phone_session.rb
263
266
  - lib/seam/routes/resources/resource_error.rb
264
267
  - lib/seam/routes/resources/resource_errors_support.rb
265
268
  - lib/seam/routes/resources/resource_warning.rb
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Seam
4
- module Clients
5
- class Bridges
6
- def initialize(client:, defaults:)
7
- @client = client
8
- @defaults = defaults
9
- end
10
-
11
- def get(bridge_id:)
12
- @client.post("/bridges/get", {bridge_id: bridge_id}.compact)
13
-
14
- nil
15
- end
16
-
17
- def list
18
- @client.post("/bridges/list")
19
-
20
- nil
21
- end
22
- end
23
- end
24
- end