seam 2.131.0 → 2.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/seam/http_multi_workspace.rb +2 -2
  4. data/lib/seam/http_single_workspace.rb +2 -2
  5. data/lib/seam/resources/access_code.rb +67 -0
  6. data/lib/seam/resources/access_grant.rb +51 -0
  7. data/lib/seam/resources/access_method.rb +46 -0
  8. data/lib/seam/resources/acs_access_group.rb +45 -0
  9. data/lib/seam/resources/acs_credential.rb +73 -0
  10. data/lib/seam/resources/acs_encoder.rb +37 -0
  11. data/lib/seam/resources/acs_entrance.rb +61 -0
  12. data/lib/seam/resources/acs_system.rb +54 -0
  13. data/lib/seam/resources/acs_user.rb +63 -0
  14. data/lib/seam/resources/action_attempt.rb +18 -0
  15. data/lib/seam/resources/batch.rb +134 -0
  16. data/lib/seam/resources/client_session.rb +44 -0
  17. data/lib/seam/resources/connect_webview.rb +59 -0
  18. data/lib/seam/resources/connected_account.rb +46 -0
  19. data/lib/seam/resources/customer_portal.rb +25 -0
  20. data/lib/seam/resources/device.rb +83 -0
  21. data/lib/seam/resources/device_provider.rb +56 -0
  22. data/lib/seam/resources/event.rb +193 -0
  23. data/lib/seam/{routes/resources → resources}/index.rb +3 -0
  24. data/lib/seam/resources/instant_key.rb +31 -0
  25. data/lib/seam/resources/noise_threshold.rb +23 -0
  26. data/lib/seam/resources/pagination.rb +15 -0
  27. data/lib/seam/resources/phone.rb +29 -0
  28. data/lib/seam/resources/space.rb +32 -0
  29. data/lib/seam/resources/thermostat_daily_program.rb +22 -0
  30. data/lib/seam/resources/thermostat_schedule.rb +34 -0
  31. data/lib/seam/resources/unmanaged_access_code.rb +53 -0
  32. data/lib/seam/resources/unmanaged_access_grant.rb +43 -0
  33. data/lib/seam/resources/unmanaged_access_method.rb +40 -0
  34. data/lib/seam/resources/unmanaged_device.rb +73 -0
  35. data/lib/seam/resources/unmanaged_user_identity.rb +29 -0
  36. data/lib/seam/resources/user_identity.rb +31 -0
  37. data/lib/seam/resources/webhook.rb +17 -0
  38. data/lib/seam/resources/workspace.rb +28 -0
  39. data/lib/seam/routes/access_codes.rb +227 -0
  40. data/lib/seam/routes/access_codes_simulate.rb +23 -0
  41. data/lib/seam/routes/access_codes_unmanaged.rb +76 -0
  42. data/lib/seam/routes/access_grants.rb +117 -0
  43. data/lib/seam/routes/access_grants_unmanaged.rb +50 -0
  44. data/lib/seam/routes/access_methods.rb +101 -0
  45. data/lib/seam/routes/access_methods_unmanaged.rb +33 -0
  46. data/lib/seam/routes/acs_access_groups.rb +82 -0
  47. data/lib/seam/routes/acs_credentials.rb +109 -0
  48. data/lib/seam/routes/{clients/acs_encoders.rb → acs_encoders.rb} +25 -0
  49. data/lib/seam/routes/acs_encoders_simulate.rb +55 -0
  50. data/lib/seam/routes/acs_entrances.rb +76 -0
  51. data/lib/seam/routes/acs_systems.rb +56 -0
  52. data/lib/seam/routes/acs_users.rb +150 -0
  53. data/lib/seam/routes/{clients/action_attempts.rb → action_attempts.rb} +9 -0
  54. data/lib/seam/routes/client_sessions.rb +102 -0
  55. data/lib/seam/routes/connect_webviews.rb +72 -0
  56. data/lib/seam/routes/connected_accounts.rb +77 -0
  57. data/lib/seam/routes/{clients/connected_accounts_simulate.rb → connected_accounts_simulate.rb} +3 -0
  58. data/lib/seam/routes/customers.rb +87 -0
  59. data/lib/seam/routes/devices.rb +95 -0
  60. data/lib/seam/routes/devices_simulate.rb +76 -0
  61. data/lib/seam/routes/devices_unmanaged.rb +66 -0
  62. data/lib/seam/routes/events.rb +59 -0
  63. data/lib/seam/routes/{clients/instant_keys.rb → instant_keys.rb} +10 -0
  64. data/lib/seam/routes/locks.rb +89 -0
  65. data/lib/seam/routes/{clients/locks_simulate.rb → locks_simulate.rb} +7 -0
  66. data/lib/seam/routes/noise_sensors.rb +45 -0
  67. data/lib/seam/routes/noise_sensors_noise_thresholds.rb +69 -0
  68. data/lib/seam/routes/noise_sensors_simulate.rb +21 -0
  69. data/lib/seam/routes/phones.rb +44 -0
  70. data/lib/seam/routes/phones_simulate.rb +24 -0
  71. data/lib/seam/routes/spaces.rb +145 -0
  72. data/lib/seam/routes/thermostats.rb +238 -0
  73. data/lib/seam/routes/{clients/thermostats_daily_programs.rb → thermostats_daily_programs.rb} +13 -0
  74. data/lib/seam/routes/thermostats_schedules.rb +70 -0
  75. data/lib/seam/routes/thermostats_simulate.rb +37 -0
  76. data/lib/seam/routes/user_identities.rb +167 -0
  77. data/lib/seam/routes/user_identities_unmanaged.rb +46 -0
  78. data/lib/seam/routes/{clients/webhooks.rb → webhooks.rb} +16 -0
  79. data/lib/seam/routes/workspaces.rb +77 -0
  80. data/lib/seam/version.rb +1 -1
  81. data/lib/seam/webhook.rb +1 -1
  82. metadata +83 -80
  83. data/lib/seam/routes/clients/access_codes.rb +0 -80
  84. data/lib/seam/routes/clients/access_codes_simulate.rb +0 -18
  85. data/lib/seam/routes/clients/access_codes_unmanaged.rb +0 -42
  86. data/lib/seam/routes/clients/access_grants.rb +0 -58
  87. data/lib/seam/routes/clients/access_grants_unmanaged.rb +0 -30
  88. data/lib/seam/routes/clients/access_methods.rb +0 -66
  89. data/lib/seam/routes/clients/access_methods_unmanaged.rb +0 -24
  90. data/lib/seam/routes/clients/acs_access_groups.rb +0 -54
  91. data/lib/seam/routes/clients/acs_credentials.rb +0 -60
  92. data/lib/seam/routes/clients/acs_encoders_simulate.rb +0 -36
  93. data/lib/seam/routes/clients/acs_entrances.rb +0 -46
  94. data/lib/seam/routes/clients/acs_systems.rb +0 -36
  95. data/lib/seam/routes/clients/acs_users.rb +0 -78
  96. data/lib/seam/routes/clients/client_sessions.rb +0 -54
  97. data/lib/seam/routes/clients/connect_webviews.rb +0 -36
  98. data/lib/seam/routes/clients/connected_accounts.rb +0 -46
  99. data/lib/seam/routes/clients/customers.rb +0 -30
  100. data/lib/seam/routes/clients/devices.rb +0 -50
  101. data/lib/seam/routes/clients/devices_simulate.rb +0 -48
  102. data/lib/seam/routes/clients/devices_unmanaged.rb +0 -30
  103. data/lib/seam/routes/clients/events.rb +0 -24
  104. data/lib/seam/routes/clients/locks.rb +0 -54
  105. data/lib/seam/routes/clients/noise_sensors.rb +0 -26
  106. data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +0 -42
  107. data/lib/seam/routes/clients/noise_sensors_simulate.rb +0 -18
  108. data/lib/seam/routes/clients/phones.rb +0 -34
  109. data/lib/seam/routes/clients/phones_simulate.rb +0 -18
  110. data/lib/seam/routes/clients/spaces.rb +0 -84
  111. data/lib/seam/routes/clients/thermostats.rb +0 -126
  112. data/lib/seam/routes/clients/thermostats_schedules.rb +0 -42
  113. data/lib/seam/routes/clients/thermostats_simulate.rb +0 -24
  114. data/lib/seam/routes/clients/user_identities.rb +0 -100
  115. data/lib/seam/routes/clients/user_identities_unmanaged.rb +0 -30
  116. data/lib/seam/routes/clients/workspaces.rb +0 -46
  117. data/lib/seam/routes/resources/access_code.rb +0 -14
  118. data/lib/seam/routes/resources/access_grant.rb +0 -14
  119. data/lib/seam/routes/resources/access_method.rb +0 -14
  120. data/lib/seam/routes/resources/acs_access_group.rb +0 -14
  121. data/lib/seam/routes/resources/acs_credential.rb +0 -14
  122. data/lib/seam/routes/resources/acs_encoder.rb +0 -13
  123. data/lib/seam/routes/resources/acs_entrance.rb +0 -14
  124. data/lib/seam/routes/resources/acs_system.rb +0 -14
  125. data/lib/seam/routes/resources/acs_user.rb +0 -14
  126. data/lib/seam/routes/resources/action_attempt.rb +0 -9
  127. data/lib/seam/routes/resources/batch.rb +0 -9
  128. data/lib/seam/routes/resources/client_session.rb +0 -11
  129. data/lib/seam/routes/resources/connect_webview.rb +0 -11
  130. data/lib/seam/routes/resources/connected_account.rb +0 -14
  131. data/lib/seam/routes/resources/customer_portal.rb +0 -11
  132. data/lib/seam/routes/resources/device.rb +0 -14
  133. data/lib/seam/routes/resources/device_provider.rb +0 -9
  134. data/lib/seam/routes/resources/event.rb +0 -11
  135. data/lib/seam/routes/resources/instant_key.rb +0 -11
  136. data/lib/seam/routes/resources/noise_threshold.rb +0 -9
  137. data/lib/seam/routes/resources/pagination.rb +0 -9
  138. data/lib/seam/routes/resources/phone.rb +0 -14
  139. data/lib/seam/routes/resources/space.rb +0 -11
  140. data/lib/seam/routes/resources/thermostat_daily_program.rb +0 -11
  141. data/lib/seam/routes/resources/thermostat_schedule.rb +0 -13
  142. data/lib/seam/routes/resources/unmanaged_access_code.rb +0 -14
  143. data/lib/seam/routes/resources/unmanaged_device.rb +0 -14
  144. data/lib/seam/routes/resources/user_identity.rb +0 -14
  145. data/lib/seam/routes/resources/webhook.rb +0 -9
  146. data/lib/seam/routes/resources/workspace.rb +0 -9
  147. /data/lib/seam/{routes/resources → resources}/resource_error.rb +0 -0
  148. /data/lib/seam/{routes/resources → resources}/resource_errors_support.rb +0 -0
  149. /data/lib/seam/{routes/resources → resources}/resource_warning.rb +0 -0
  150. /data/lib/seam/{routes/resources → resources}/resource_warnings_support.rb +0 -0
  151. /data/lib/seam/routes/{clients/acs.rb → acs.rb} +0 -0
  152. /data/lib/seam/routes/{clients/index.rb → index.rb} +0 -0
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "seam/helpers/action_attempt"
4
+
5
+ module Seam
6
+ module Clients
7
+ class AccessMethods
8
+ def initialize(client:, defaults:)
9
+ @client = client
10
+ @defaults = defaults
11
+ end
12
+
13
+ def unmanaged
14
+ @unmanaged ||= Seam::Clients::AccessMethodsUnmanaged.new(client: @client, defaults: @defaults)
15
+ end
16
+
17
+ # Assigns a pre-registered card credential, identified by `card_number`, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method.
18
+ # @param access_method_id ID of the `access_method` to assign the credential to.
19
+ # @param card_number Card number of the credential to assign.
20
+ # @return [Seam::Resources::ActionAttempt] OK
21
+ def assign_card(access_method_id:, card_number:, wait_for_action_attempt: nil)
22
+ res = @client.post("/access_methods/assign_card", {access_method_id: access_method_id, card_number: card_number}.compact)
23
+
24
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
25
+
26
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
27
+ end
28
+
29
+ # Deletes an access method.
30
+ # @param access_method_id ID of access method to delete.
31
+ # @param access_grant_id ID of access grant whose access methods should be deleted.
32
+ # @param reservation_key Reservation key of the access grant whose access methods should be deleted.
33
+ # @return [nil] OK
34
+ def delete(access_method_id: nil, access_grant_id: nil, reservation_key: nil)
35
+ @client.post("/access_methods/delete", {access_method_id: access_method_id, access_grant_id: access_grant_id, reservation_key: reservation_key}.compact)
36
+
37
+ nil
38
+ end
39
+
40
+ # Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners).
41
+ # @param access_method_id ID of the `access_method` to encode onto a card.
42
+ # @param acs_encoder_id ID of the `acs_encoder` to use to encode the `access_method`.
43
+ # @return [Seam::Resources::ActionAttempt] OK
44
+ def encode(access_method_id:, acs_encoder_id:, wait_for_action_attempt: nil)
45
+ res = @client.post("/access_methods/encode", {access_method_id: access_method_id, acs_encoder_id: acs_encoder_id}.compact)
46
+
47
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
48
+
49
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
50
+ end
51
+
52
+ # Gets an access method.
53
+ # @param access_method_id ID of access method to get.
54
+ # @return [Seam::Resources::AccessMethod] OK
55
+ def get(access_method_id:)
56
+ res = @client.post("/access_methods/get", {access_method_id: access_method_id}.compact)
57
+
58
+ Seam::Resources::AccessMethod.load_from_response(res.body["access_method"])
59
+ end
60
+
61
+ # Gets all related resources for one or more Access Methods.
62
+ # @param access_method_ids IDs of the access methods that you want to get along with their related resources.
63
+ # @param exclude
64
+ # @param include
65
+ # @return [Seam::Resources::Batch] OK
66
+ def get_related(access_method_ids:, exclude: nil, include: nil)
67
+ res = @client.post("/access_methods/get_related", {access_method_ids: access_method_ids, exclude: exclude, include: include}.compact)
68
+
69
+ Seam::Resources::Batch.load_from_response(res.body["batch"])
70
+ end
71
+
72
+ # Lists all access methods, usually filtered by Access Grant.
73
+ # @param access_code_id ID of the access code by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`.
74
+ # @param access_grant_id ID of Access Grant to list access methods for.
75
+ # @param access_grant_key Key of Access Grant to list access methods for.
76
+ # @param acs_entrance_id ID of the entrance for which you want to retrieve all access methods that grant access to it.
77
+ # @param device_id ID of the device by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`.
78
+ # @param limit Maximum number of records to return per page.
79
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
80
+ # @param space_id ID of the space by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`.
81
+ # @return [Seam::Resources::AccessMethod] OK
82
+ def list(access_code_id: nil, access_grant_id: nil, access_grant_key: nil, acs_entrance_id: nil, device_id: nil, limit: nil, page_cursor: nil, space_id: nil)
83
+ res = @client.post("/access_methods/list", {access_code_id: access_code_id, access_grant_id: access_grant_id, access_grant_key: access_grant_key, acs_entrance_id: acs_entrance_id, device_id: device_id, limit: limit, page_cursor: page_cursor, space_id: space_id}.compact)
84
+
85
+ Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"])
86
+ end
87
+
88
+ # Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation.
89
+ # @param access_method_id ID of the cloud_key `access_method` to use for the unlock operation.
90
+ # @param acs_entrance_id ID of the entrance to unlock.
91
+ # @return [Seam::Resources::ActionAttempt] OK
92
+ def unlock_door(access_method_id:, acs_entrance_id:, wait_for_action_attempt: nil)
93
+ res = @client.post("/access_methods/unlock_door", {access_method_id: access_method_id, acs_entrance_id: acs_entrance_id}.compact)
94
+
95
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
96
+
97
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AccessMethodsUnmanaged
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Gets an unmanaged access method (where is_managed = false).
12
+ # @param access_method_id ID of unmanaged access method to get.
13
+ # @return [Seam::Resources::UnmanagedAccessMethod] OK
14
+ def get(access_method_id:)
15
+ res = @client.post("/access_methods/unmanaged/get", {access_method_id: access_method_id}.compact)
16
+
17
+ Seam::Resources::UnmanagedAccessMethod.load_from_response(res.body["access_method"])
18
+ end
19
+
20
+ # Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant.
21
+ # @param access_grant_id ID of Access Grant to list unmanaged access methods for.
22
+ # @param acs_entrance_id ID of the entrance for which you want to retrieve all unmanaged access methods.
23
+ # @param device_id ID of the device for which you want to retrieve all unmanaged access methods.
24
+ # @param space_id ID of the space for which you want to retrieve all unmanaged access methods.
25
+ # @return [Seam::Resources::UnmanagedAccessMethod] OK
26
+ def list(access_grant_id:, acs_entrance_id: nil, device_id: nil, space_id: nil)
27
+ res = @client.post("/access_methods/unmanaged/list", {access_grant_id: access_grant_id, acs_entrance_id: acs_entrance_id, device_id: device_id, space_id: space_id}.compact)
28
+
29
+ Seam::Resources::UnmanagedAccessMethod.load_from_response(res.body["access_methods"])
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AcsAccessGroups
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
12
+ # @param acs_access_group_id ID of the access group to which you want to add an access system user.
13
+ # @param acs_user_id ID of the access system user that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id.
14
+ # @param user_identity_id ID of the desired user identity that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created.
15
+ # @return [nil] OK
16
+ def add_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
17
+ @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)
18
+
19
+ nil
20
+ end
21
+
22
+ # Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
23
+ # @param acs_access_group_id ID of the access group that you want to delete.
24
+ # @return [nil] OK
25
+ def delete(acs_access_group_id:)
26
+ @client.post("/acs/access_groups/delete", {acs_access_group_id: acs_access_group_id}.compact)
27
+
28
+ nil
29
+ end
30
+
31
+ # Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
32
+ # @param acs_access_group_id ID of the access group that you want to get.
33
+ # @return [Seam::Resources::AcsAccessGroup] OK
34
+ def get(acs_access_group_id:)
35
+ res = @client.post("/acs/access_groups/get", {acs_access_group_id: acs_access_group_id}.compact)
36
+
37
+ Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_group"])
38
+ end
39
+
40
+ # Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
41
+ # @param acs_system_id ID of the access system for which you want to retrieve all access groups.
42
+ # @param acs_user_id ID of the access system user for which you want to retrieve all access groups.
43
+ # @param search String for which to search. Filters returned access groups to include all records that satisfy a partial match using `name` or `acs_access_group_id`.
44
+ # @param user_identity_id ID of the user identity for which you want to retrieve all access groups.
45
+ # @return [Seam::Resources::AcsAccessGroup] OK
46
+ def list(acs_system_id: nil, acs_user_id: nil, search: nil, user_identity_id: nil)
47
+ res = @client.post("/acs/access_groups/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, search: search, user_identity_id: user_identity_id}.compact)
48
+
49
+ Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_groups"])
50
+ end
51
+
52
+ # Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
53
+ # @param acs_access_group_id ID of the access group for which you want to retrieve all accessible entrances.
54
+ # @return [Seam::Resources::AcsEntrance] OK
55
+ def list_accessible_entrances(acs_access_group_id:)
56
+ res = @client.post("/acs/access_groups/list_accessible_entrances", {acs_access_group_id: acs_access_group_id}.compact)
57
+
58
+ Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
59
+ end
60
+
61
+ # Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
62
+ # @param acs_access_group_id ID of the access group for which you want to retrieve all access system users.
63
+ # @return [Seam::Resources::AcsUser] OK
64
+ def list_users(acs_access_group_id:)
65
+ res = @client.post("/acs/access_groups/list_users", {acs_access_group_id: acs_access_group_id}.compact)
66
+
67
+ Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
68
+ end
69
+
70
+ # Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
71
+ # @param acs_access_group_id ID of the access group from which you want to remove an access system user.
72
+ # @param acs_user_id ID of the access system user that you want to remove from an access group.
73
+ # @param user_identity_id ID of the user identity associated with the user that you want to remove from an access group.
74
+ # @return [nil] OK
75
+ def remove_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
76
+ @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)
77
+
78
+ nil
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,109 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AcsCredentials
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
12
+ # @param acs_credential_id ID of the credential that you want to assign to an access system user.
13
+ # @param acs_user_id ID of the access system user to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id.
14
+ # @param user_identity_id ID of the user identity to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created.
15
+ # @return [nil] OK
16
+ def assign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil)
17
+ @client.post("/acs/credentials/assign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
18
+
19
+ nil
20
+ end
21
+
22
+ # Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential.
23
+ # @param access_method Access method for the new credential. Supported values: `code`, `card`, `mobile_key`, `cloud_key`.
24
+ # @param acs_system_id ID of the access system to which the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`.
25
+ # @param acs_user_id ID of the access system user to whom the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`.
26
+ # @param allowed_acs_entrance_ids Set of IDs of the [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) for which the new credential grants access.
27
+ # @param assa_abloy_vostio_metadata Vostio-specific metadata for the new credential.
28
+ # @param code Access (PIN) code for the new credential. There may be manufacturer-specific code restrictions. For details, see the applicable [device or system integration guide](https://docs.seam.co/device-and-system-integration-guides).
29
+ # @param credential_manager_acs_system_id ACS system ID of the credential manager for the new credential.
30
+ # @param ends_at Date and time at which the validity of the new credential ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`.
31
+ # @param is_multi_phone_sync_credential Indicates whether the new credential is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials).
32
+ # @param salto_space_metadata Salto Space-specific metadata for the new credential.
33
+ # @param starts_at Date and time at which the validity of the new credential starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
34
+ # @param user_identity_id ID of the user identity to whom the new credential belongs. You must provide either `acs_user_id` or the combination of `user_identity_id` and `acs_system_id`. If the access system contains a user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the access system user. If the access system does not have a corresponding user, one is created.
35
+ # @param visionline_metadata Visionline-specific metadata for the new credential.
36
+ # @return [Seam::Resources::AcsCredential] OK
37
+ 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)
38
+ 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)
39
+
40
+ Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"])
41
+ end
42
+
43
+ # Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials).
44
+ # @param acs_credential_id ID of the credential that you want to delete.
45
+ # @return [nil] OK
46
+ def delete(acs_credential_id:)
47
+ @client.post("/acs/credentials/delete", {acs_credential_id: acs_credential_id}.compact)
48
+
49
+ nil
50
+ end
51
+
52
+ # Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials).
53
+ # @param acs_credential_id ID of the credential that you want to get.
54
+ # @return [Seam::Resources::AcsCredential] OK
55
+ def get(acs_credential_id:)
56
+ res = @client.post("/acs/credentials/get", {acs_credential_id: acs_credential_id}.compact)
57
+
58
+ Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"])
59
+ end
60
+
61
+ # Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials).
62
+ # @param acs_user_id ID of the access system user for which you want to retrieve all credentials.
63
+ # @param acs_system_id ID of the access system for which you want to retrieve all credentials.
64
+ # @param user_identity_id ID of the user identity for which you want to retrieve all credentials.
65
+ # @param created_before Date and time, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format, before which events to return were created.
66
+ # @param is_multi_phone_sync_credential Indicates whether you want to retrieve only multi-phone sync credentials or non-multi-phone sync credentials.
67
+ # @param limit Number of credentials to return.
68
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
69
+ # @param search String for which to search. Filters returned credentials to include all records that satisfy a partial match using `display_name`, `code`, `card_number`, `acs_user_id` or `acs_credential_id`.
70
+ # @return [Seam::Resources::AcsCredential] OK
71
+ def list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, created_before: nil, is_multi_phone_sync_credential: nil, limit: nil, page_cursor: nil, search: nil)
72
+ res = @client.post("/acs/credentials/list", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id, created_before: created_before, is_multi_phone_sync_credential: is_multi_phone_sync_credential, limit: limit, page_cursor: page_cursor, search: search}.compact)
73
+
74
+ Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"])
75
+ end
76
+
77
+ # Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access.
78
+ # @param acs_credential_id ID of the credential for which you want to retrieve all entrances to which the credential grants access.
79
+ # @return [Seam::Resources::AcsEntrance] OK
80
+ def list_accessible_entrances(acs_credential_id:)
81
+ res = @client.post("/acs/credentials/list_accessible_entrances", {acs_credential_id: acs_credential_id}.compact)
82
+
83
+ Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
84
+ end
85
+
86
+ # Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
87
+ # @param acs_credential_id ID of the credential that you want to unassign from an access system user.
88
+ # @param acs_user_id ID of the access system user from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id.
89
+ # @param user_identity_id ID of the user identity from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id.
90
+ # @return [nil] OK
91
+ def unassign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil)
92
+ @client.post("/acs/credentials/unassign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
93
+
94
+ nil
95
+ end
96
+
97
+ # Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials).
98
+ # @param acs_credential_id ID of the credential that you want to update.
99
+ # @param code Replacement access (PIN) code for the credential that you want to update.
100
+ # @param ends_at Replacement date and time at which the validity of the credential ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after the `starts_at` value that you set when creating the credential.
101
+ # @return [nil] OK
102
+ def update(acs_credential_id:, code: nil, ends_at: nil)
103
+ @client.post("/acs/credentials/update", {acs_credential_id: acs_credential_id, code: code, ends_at: ends_at}.compact)
104
+
105
+ nil
106
+ end
107
+ end
108
+ end
109
+ end
@@ -14,6 +14,11 @@ module Seam
14
14
  @simulate ||= Seam::Clients::AcsEncodersSimulate.new(client: @client, defaults: @defaults)
15
15
  end
16
16
 
17
+ # Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). Either provide an `acs_credential_id` or an `access_method_id`
18
+ # @param acs_encoder_id ID of the `acs_encoder` to use to encode the `acs_credential`.
19
+ # @param access_method_id ID of the `access_method` to encode onto a card.
20
+ # @param acs_credential_id ID of the `acs_credential` to encode onto a card.
21
+ # @return [Seam::Resources::ActionAttempt] OK
17
22
  def encode_credential(acs_encoder_id:, access_method_id: nil, acs_credential_id: nil, wait_for_action_attempt: nil)
18
23
  res = @client.post("/acs/encoders/encode_credential", {acs_encoder_id: acs_encoder_id, access_method_id: access_method_id, acs_credential_id: acs_credential_id}.compact)
19
24
 
@@ -22,18 +27,32 @@ module Seam
22
27
  Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
23
28
  end
24
29
 
30
+ # Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners).
31
+ # @param acs_encoder_id ID of the encoder that you want to get.
32
+ # @return [Seam::Resources::AcsEncoder] OK
25
33
  def get(acs_encoder_id:)
26
34
  res = @client.post("/acs/encoders/get", {acs_encoder_id: acs_encoder_id}.compact)
27
35
 
28
36
  Seam::Resources::AcsEncoder.load_from_response(res.body["acs_encoder"])
29
37
  end
30
38
 
39
+ # Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners).
40
+ # @param acs_system_id ID of the access system for which you want to retrieve all encoders.
41
+ # @param acs_system_ids IDs of the access systems for which you want to retrieve all encoders.
42
+ # @param acs_encoder_ids IDs of the encoders that you want to retrieve.
43
+ # @param limit Number of encoders to return.
44
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
45
+ # @return [Seam::Resources::AcsEncoder] OK
31
46
  def list(acs_system_id: nil, acs_system_ids: nil, acs_encoder_ids: nil, limit: nil, page_cursor: nil)
32
47
  res = @client.post("/acs/encoders/list", {acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_encoder_ids: acs_encoder_ids, limit: limit, page_cursor: page_cursor}.compact)
33
48
 
34
49
  Seam::Resources::AcsEncoder.load_from_response(res.body["acs_encoders"])
35
50
  end
36
51
 
52
+ # Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners).
53
+ # @param acs_encoder_id ID of the encoder to use for the scan.
54
+ # @param salto_ks_metadata Salto KS-specific metadata for the scan action.
55
+ # @return [Seam::Resources::ActionAttempt] OK
37
56
  def scan_credential(acs_encoder_id:, salto_ks_metadata: nil, wait_for_action_attempt: nil)
38
57
  res = @client.post("/acs/encoders/scan_credential", {acs_encoder_id: acs_encoder_id, salto_ks_metadata: salto_ks_metadata}.compact)
39
58
 
@@ -42,6 +61,12 @@ module Seam
42
61
  Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
43
62
  end
44
63
 
64
+ # Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) and assigns the scanned credential to an ACS user. Provide either an `acs_user_id` or a `user_identity_id`.
65
+ # @param acs_encoder_id ID of the `acs_encoder` to use to scan the credential.
66
+ # @param acs_user_id ID of the `acs_user` to assign the scanned credential to.
67
+ # @param salto_ks_metadata Salto KS-specific metadata for the scan action.
68
+ # @param user_identity_id ID of the `user_identity` to assign the scanned credential to. If the ACS system contains an ACS user linked to this user identity, it is used. Otherwise, one is created.
69
+ # @return [Seam::Resources::ActionAttempt] OK
45
70
  def scan_to_assign_credential(acs_encoder_id:, acs_user_id: nil, salto_ks_metadata: nil, user_identity_id: nil, wait_for_action_attempt: nil)
46
71
  res = @client.post("/acs/encoders/scan_to_assign_credential", {acs_encoder_id: acs_encoder_id, acs_user_id: acs_user_id, salto_ks_metadata: salto_ks_metadata, user_identity_id: user_identity_id}.compact)
47
72
 
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AcsEncodersSimulate
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
12
+ # @param acs_encoder_id ID of the `acs_encoder` that will be used in the next request to encode the `acs_credential`.
13
+ # @param error_code Code of the error to simulate.
14
+ # @param acs_credential_id ID of the `acs_credential` that will fail to be encoded onto a card in the next request.
15
+ # @return [nil] OK
16
+ def next_credential_encode_will_fail(acs_encoder_id:, error_code: nil, acs_credential_id: nil)
17
+ @client.post("/acs/encoders/simulate/next_credential_encode_will_fail", {acs_encoder_id: acs_encoder_id, error_code: error_code, acs_credential_id: acs_credential_id}.compact)
18
+
19
+ nil
20
+ end
21
+
22
+ # Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
23
+ # @param acs_encoder_id ID of the `acs_encoder` that will be used in the next request to encode the `acs_credential`.
24
+ # @param scenario Scenario to simulate.
25
+ # @return [nil] OK
26
+ def next_credential_encode_will_succeed(acs_encoder_id:, scenario: nil)
27
+ @client.post("/acs/encoders/simulate/next_credential_encode_will_succeed", {acs_encoder_id: acs_encoder_id, scenario: scenario}.compact)
28
+
29
+ nil
30
+ end
31
+
32
+ # Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
33
+ # @param acs_encoder_id ID of the `acs_encoder` that will fail to scan the `acs_credential` in the next request.
34
+ # @param error_code
35
+ # @param acs_credential_id_on_seam
36
+ # @return [nil] OK
37
+ def next_credential_scan_will_fail(acs_encoder_id:, error_code: nil, acs_credential_id_on_seam: nil)
38
+ @client.post("/acs/encoders/simulate/next_credential_scan_will_fail", {acs_encoder_id: acs_encoder_id, error_code: error_code, acs_credential_id_on_seam: acs_credential_id_on_seam}.compact)
39
+
40
+ nil
41
+ end
42
+
43
+ # Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
44
+ # @param acs_encoder_id ID of the `acs_encoder` that will be used in the next request to scan the `acs_credential`.
45
+ # @param acs_credential_id_on_seam ID of the Seam `acs_credential` that matches the `acs_credential` on the encoder in this simulation.
46
+ # @param scenario Scenario to simulate.
47
+ # @return [nil] OK
48
+ def next_credential_scan_will_succeed(acs_encoder_id:, acs_credential_id_on_seam: nil, scenario: nil)
49
+ @client.post("/acs/encoders/simulate/next_credential_scan_will_succeed", {acs_encoder_id: acs_encoder_id, acs_credential_id_on_seam: acs_credential_id_on_seam, scenario: scenario}.compact)
50
+
51
+ nil
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "seam/helpers/action_attempt"
4
+
5
+ module Seam
6
+ module Clients
7
+ class AcsEntrances
8
+ def initialize(client:, defaults:)
9
+ @client = client
10
+ @defaults = defaults
11
+ end
12
+
13
+ # Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details).
14
+ # @param acs_entrance_id ID of the entrance that you want to get.
15
+ # @return [Seam::Resources::AcsEntrance] OK
16
+ def get(acs_entrance_id:)
17
+ res = @client.post("/acs/entrances/get", {acs_entrance_id: acs_entrance_id}.compact)
18
+
19
+ Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrance"])
20
+ end
21
+
22
+ # Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details).
23
+ # @param acs_entrance_id ID of the entrance to which you want to grant an access system user access.
24
+ # @param acs_user_id ID of the access system user to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id.
25
+ # @param user_identity_id ID of the user identity to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created.
26
+ # @return [nil] OK
27
+ def grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil)
28
+ @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)
29
+
30
+ nil
31
+ end
32
+
33
+ # Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details).
34
+ # @param access_method_id ID of the access method for which you want to retrieve all entrances to which it grants access.
35
+ # @param acs_credential_id ID of the credential for which you want to retrieve all entrances.
36
+ # @param acs_entrance_ids IDs of the entrances for which you want to retrieve all entrances.
37
+ # @param acs_system_id ID of the access system for which you want to retrieve all entrances.
38
+ # @param connected_account_id ID of the connected account for which you want to retrieve all entrances.
39
+ # @param customer_key Customer key for which you want to list entrances.
40
+ # @param limit Maximum number of records to return per page.
41
+ # @param location_id
42
+ # @deprecated location_id: Use `space_id`.
43
+ # @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
44
+ # @param search String for which to search. Filters returned entrances to include all records that satisfy a partial match using `display_name`.
45
+ # @param space_id ID of the space for which you want to list entrances.
46
+ # @return [Seam::Resources::AcsEntrance] OK
47
+ def list(access_method_id: nil, acs_credential_id: nil, acs_entrance_ids: nil, acs_system_id: nil, connected_account_id: nil, customer_key: nil, limit: nil, location_id: nil, page_cursor: nil, search: nil, space_id: nil)
48
+ res = @client.post("/acs/entrances/list", {access_method_id: access_method_id, acs_credential_id: acs_credential_id, acs_entrance_ids: acs_entrance_ids, acs_system_id: acs_system_id, connected_account_id: connected_account_id, customer_key: customer_key, limit: limit, location_id: location_id, page_cursor: page_cursor, search: search, space_id: space_id}.compact)
49
+
50
+ Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
51
+ end
52
+
53
+ # Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details).
54
+ # @param acs_entrance_id ID of the entrance for which you want to list all credentials that grant access.
55
+ # @param include_if Conditions that credentials must meet to be included in the returned list.
56
+ # @return [Seam::Resources::AcsCredential] OK
57
+ def list_credentials_with_access(acs_entrance_id:, include_if: nil)
58
+ res = @client.post("/acs/entrances/list_credentials_with_access", {acs_entrance_id: acs_entrance_id, include_if: include_if}.compact)
59
+
60
+ Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"])
61
+ end
62
+
63
+ # Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation.
64
+ # @param acs_credential_id ID of the cloud_key credential to use for the unlock operation.
65
+ # @param acs_entrance_id ID of the entrance to unlock.
66
+ # @return [Seam::Resources::ActionAttempt] OK
67
+ def unlock(acs_credential_id:, acs_entrance_id:, wait_for_action_attempt: nil)
68
+ res = @client.post("/acs/entrances/unlock", {acs_credential_id: acs_credential_id, acs_entrance_id: acs_entrance_id}.compact)
69
+
70
+ wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
71
+
72
+ Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seam
4
+ module Clients
5
+ class AcsSystems
6
+ def initialize(client:, defaults:)
7
+ @client = client
8
+ @defaults = defaults
9
+ end
10
+
11
+ # Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems).
12
+ # @param acs_system_id ID of the access system that you want to get.
13
+ # @return [Seam::Resources::AcsSystem] OK
14
+ def get(acs_system_id:)
15
+ res = @client.post("/acs/systems/get", {acs_system_id: acs_system_id}.compact)
16
+
17
+ Seam::Resources::AcsSystem.load_from_response(res.body["acs_system"])
18
+ end
19
+
20
+ # Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems).
21
+ #
22
+ # To filter the list of returned access systems by a specific connected account ID, include the `connected_account_id` in the request body. If you omit the `connected_account_id` parameter, the response includes all access systems connected to your workspace.
23
+ # @param connected_account_id ID of the connected account by which you want to filter the list of access systems.
24
+ # @param customer_key Customer key for which you want to list access systems.
25
+ # @param search String for which to search. Filters returned access systems to include all records that satisfy a partial match using `name` or `acs_system_id`.
26
+ # @return [Seam::Resources::AcsSystem] OK
27
+ def list(connected_account_id: nil, customer_key: nil, search: nil)
28
+ res = @client.post("/acs/systems/list", {connected_account_id: connected_account_id, customer_key: customer_key, search: search}.compact)
29
+
30
+ Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"])
31
+ end
32
+
33
+ # Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems).
34
+ #
35
+ # Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding `acs_system_id` in the request body.
36
+ # @param acs_system_id ID of the access system for which you want to retrieve all compatible credential manager systems.
37
+ # @return [Seam::Resources::AcsSystem] OK
38
+ def list_compatible_credential_manager_acs_systems(acs_system_id:)
39
+ res = @client.post("/acs/systems/list_compatible_credential_manager_acs_systems", {acs_system_id: acs_system_id}.compact)
40
+
41
+ Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"])
42
+ end
43
+
44
+ # Reports ACS system device status including encoders and entrances.
45
+ # @param acs_system_id ID of the ACS system to report resources for
46
+ # @param acs_encoders Array of ACS encoders to report
47
+ # @param acs_entrances Array of ACS entrances to report
48
+ # @return [nil] OK
49
+ def report_devices(acs_system_id:, acs_encoders: nil, acs_entrances: nil)
50
+ @client.post("/acs/systems/report_devices", {acs_system_id: acs_system_id, acs_encoders: acs_encoders, acs_entrances: acs_entrances}.compact)
51
+
52
+ nil
53
+ end
54
+ end
55
+ end
56
+ end