seam 2.132.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seam/resources/access_code.rb +55 -2
- data/lib/seam/resources/access_grant.rb +39 -2
- data/lib/seam/resources/access_method.rb +34 -2
- data/lib/seam/resources/acs_access_group.rb +32 -1
- data/lib/seam/resources/acs_credential.rb +61 -2
- data/lib/seam/resources/acs_encoder.rb +25 -1
- data/lib/seam/resources/acs_entrance.rb +48 -1
- data/lib/seam/resources/acs_system.rb +41 -1
- data/lib/seam/resources/acs_user.rb +50 -1
- data/lib/seam/resources/action_attempt.rb +10 -1
- data/lib/seam/resources/batch.rb +126 -1
- data/lib/seam/resources/client_session.rb +35 -2
- data/lib/seam/resources/connect_webview.rb +50 -2
- data/lib/seam/resources/connected_account.rb +33 -1
- data/lib/seam/resources/customer_portal.rb +16 -2
- data/lib/seam/resources/device.rb +70 -1
- data/lib/seam/resources/device_provider.rb +48 -1
- data/lib/seam/resources/event.rb +184 -2
- data/lib/seam/resources/instant_key.rb +22 -2
- data/lib/seam/resources/noise_threshold.rb +15 -1
- data/lib/seam/resources/pagination.rb +7 -1
- data/lib/seam/resources/phone.rb +16 -1
- data/lib/seam/resources/space.rb +22 -1
- data/lib/seam/resources/thermostat_daily_program.rb +12 -1
- data/lib/seam/resources/thermostat_schedule.rb +23 -2
- data/lib/seam/resources/unmanaged_access_code.rb +41 -2
- data/lib/seam/resources/unmanaged_access_grant.rb +31 -2
- data/lib/seam/resources/unmanaged_access_method.rb +28 -2
- data/lib/seam/resources/unmanaged_device.rb +60 -1
- data/lib/seam/resources/unmanaged_user_identity.rb +16 -1
- data/lib/seam/resources/user_identity.rb +18 -1
- data/lib/seam/resources/webhook.rb +9 -1
- data/lib/seam/resources/workspace.rb +20 -1
- data/lib/seam/routes/access_codes.rb +147 -0
- data/lib/seam/routes/access_codes_simulate.rb +5 -0
- data/lib/seam/routes/access_codes_unmanaged.rb +34 -0
- data/lib/seam/routes/access_grants.rb +59 -0
- data/lib/seam/routes/access_grants_unmanaged.rb +20 -0
- data/lib/seam/routes/access_methods.rb +35 -0
- data/lib/seam/routes/access_methods_unmanaged.rb +9 -0
- data/lib/seam/routes/acs_access_groups.rb +28 -0
- data/lib/seam/routes/acs_credentials.rb +49 -0
- data/lib/seam/routes/acs_encoders.rb +25 -0
- data/lib/seam/routes/acs_encoders_simulate.rb +19 -0
- data/lib/seam/routes/acs_entrances.rb +30 -0
- data/lib/seam/routes/acs_systems.rb +20 -0
- data/lib/seam/routes/acs_users.rb +72 -0
- data/lib/seam/routes/action_attempts.rb +9 -0
- data/lib/seam/routes/client_sessions.rb +48 -0
- data/lib/seam/routes/connect_webviews.rb +36 -0
- data/lib/seam/routes/connected_accounts.rb +31 -0
- data/lib/seam/routes/connected_accounts_simulate.rb +3 -0
- data/lib/seam/routes/customers.rb +57 -0
- data/lib/seam/routes/devices.rb +45 -0
- data/lib/seam/routes/devices_simulate.rb +28 -0
- data/lib/seam/routes/devices_unmanaged.rb +36 -0
- data/lib/seam/routes/events.rb +35 -0
- data/lib/seam/routes/instant_keys.rb +10 -0
- data/lib/seam/routes/locks.rb +35 -0
- data/lib/seam/routes/locks_simulate.rb +7 -0
- data/lib/seam/routes/noise_sensors.rb +19 -0
- data/lib/seam/routes/noise_sensors_noise_thresholds.rb +27 -0
- data/lib/seam/routes/noise_sensors_simulate.rb +3 -0
- data/lib/seam/routes/phones.rb +10 -0
- data/lib/seam/routes/phones_simulate.rb +6 -0
- data/lib/seam/routes/spaces.rb +61 -0
- data/lib/seam/routes/thermostats.rb +112 -0
- data/lib/seam/routes/thermostats_daily_programs.rb +13 -0
- data/lib/seam/routes/thermostats_schedules.rb +28 -0
- data/lib/seam/routes/thermostats_simulate.rb +13 -0
- data/lib/seam/routes/user_identities.rb +67 -0
- data/lib/seam/routes/user_identities_unmanaged.rb +16 -0
- data/lib/seam/routes/webhooks.rb +16 -0
- data/lib/seam/routes/workspaces.rb +31 -0
- data/lib/seam/version.rb +1 -1
- metadata +2 -2
|
@@ -2,9 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
module Seam
|
|
4
4
|
module Resources
|
|
5
|
+
# Represents a [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with an application user account.
|
|
5
6
|
class UserIdentity < BaseResource
|
|
6
|
-
|
|
7
|
+
# Array of access system user IDs associated with the user identity.
|
|
8
|
+
attr_accessor :acs_user_ids
|
|
9
|
+
# Display name for the user identity.
|
|
10
|
+
attr_accessor :display_name
|
|
11
|
+
# Unique email address for the user identity.
|
|
12
|
+
attr_accessor :email_address
|
|
13
|
+
# Full name of the user associated with the user identity.
|
|
14
|
+
attr_accessor :full_name
|
|
15
|
+
# Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100).
|
|
16
|
+
attr_accessor :phone_number
|
|
17
|
+
# ID of the user identity.
|
|
18
|
+
attr_accessor :user_identity_id
|
|
19
|
+
# Unique key for the user identity.
|
|
20
|
+
attr_accessor :user_identity_key
|
|
21
|
+
# ID of the workspace that contains the user identity.
|
|
22
|
+
attr_accessor :workspace_id
|
|
7
23
|
|
|
24
|
+
# Date and time at which the user identity was created.
|
|
8
25
|
date_accessor :created_at
|
|
9
26
|
|
|
10
27
|
include Seam::Resources::ResourceErrorsSupport
|
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module Seam
|
|
4
4
|
module Resources
|
|
5
|
+
# Represents a [webhook](https://docs.seam.co/developer-tools/webhooks) that enables you to receive notifications of events. When you create a webhook, specify the endpoint URL at which you want to receive events and the set of event types that you want to receive.
|
|
5
6
|
class Webhook < BaseResource
|
|
6
|
-
|
|
7
|
+
# Types of events that the [webhook](https://docs.seam.co/developer-tools/webhooks) should receive.
|
|
8
|
+
attr_accessor :event_types
|
|
9
|
+
# Secret associated with the [webhook](https://docs.seam.co/developer-tools/webhooks).
|
|
10
|
+
attr_accessor :secret
|
|
11
|
+
# URL for the [webhook](https://docs.seam.co/developer-tools/webhooks).
|
|
12
|
+
attr_accessor :url
|
|
13
|
+
# ID of the webhook.
|
|
14
|
+
attr_accessor :webhook_id
|
|
7
15
|
end
|
|
8
16
|
end
|
|
9
17
|
end
|
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
module Seam
|
|
4
4
|
module Resources
|
|
5
|
+
# Represents a Seam [workspace](https://docs.seam.co/core-concepts/workspaces). A workspace is a top-level entity that encompasses all other resources below it, such as devices, connected accounts, and Connect Webviews. Seam provides two types of workspaces. A [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is a special type of workspace designed for testing code. Sandbox workspaces offer test device accounts and virtual devices that you can connect and control. This ability to work with virtual devices is quite handy because it removes the need to own physical devices from multiple brands. To connect real devices and systems to Seam, use a [production workspace](https://docs.seam.co/core-concepts/workspaces#production-workspaces).
|
|
5
6
|
class Workspace < BaseResource
|
|
6
|
-
|
|
7
|
+
# Company name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces).
|
|
8
|
+
attr_accessor :company_name
|
|
9
|
+
# @deprecated Use `company_name` instead.
|
|
10
|
+
attr_accessor :connect_partner_name
|
|
11
|
+
attr_accessor :connect_webview_customization
|
|
12
|
+
# Indicates whether publishable key authentication is enabled for this workspace.
|
|
13
|
+
attr_accessor :is_publishable_key_auth_enabled
|
|
14
|
+
# Indicates whether the workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
|
|
15
|
+
attr_accessor :is_sandbox
|
|
16
|
+
# Indicates whether the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is suspended. Seam suspends sandbox workspaces that have not been accessed in 14 days.
|
|
17
|
+
attr_accessor :is_suspended
|
|
18
|
+
# Name of the [workspace](https://docs.seam.co/core-concepts/workspaces).
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
# ID of the organization to which the workspace belongs, or `null` if the workspace is not assigned to an organization.
|
|
21
|
+
attr_accessor :organization_id
|
|
22
|
+
# Publishable key for the [workspace](https://docs.seam.co/core-concepts/workspaces). This key is used to identify the workspace in client-side applications.
|
|
23
|
+
attr_accessor :publishable_key
|
|
24
|
+
# ID of the workspace.
|
|
25
|
+
attr_accessor :workspace_id
|
|
7
26
|
end
|
|
8
27
|
end
|
|
9
28
|
end
|
|
@@ -16,60 +16,207 @@ module Seam
|
|
|
16
16
|
@unmanaged ||= Seam::Clients::AccessCodesUnmanaged.new(client: @client, defaults: @defaults)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
# Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value.
|
|
20
|
+
# @param device_id ID of the device for which you want to create the new access code.
|
|
21
|
+
# @param allow_external_modification Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`.
|
|
22
|
+
# @param attempt_for_offline_device
|
|
23
|
+
# @param code Code to be used for access.
|
|
24
|
+
# @param common_code_key Key to identify access codes that should have the same code. Any two access codes with the same `common_code_key` are guaranteed to have the same `code`. See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes).
|
|
25
|
+
# @param ends_at Date and time at which the validity of the new access code 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`.
|
|
26
|
+
# @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`.
|
|
27
|
+
# @param is_offline_access_code Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes).
|
|
28
|
+
# @param is_one_time_use Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code.
|
|
29
|
+
# @param max_time_rounding Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`.
|
|
30
|
+
# @param name Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.
|
|
31
|
+
#
|
|
32
|
+
# Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`.
|
|
33
|
+
#
|
|
34
|
+
# To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints.
|
|
35
|
+
#
|
|
36
|
+
# To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components).
|
|
37
|
+
# @param prefer_native_scheduling Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`.
|
|
38
|
+
# @param preferred_code_length Preferred code length. Only applicable if you do not specify a `code`. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length.
|
|
39
|
+
# @param starts_at Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
40
|
+
# @param use_backup_access_code_pool Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code).
|
|
41
|
+
# @param use_offline_access_code
|
|
42
|
+
# @deprecated use_offline_access_code: Use `is_offline_access_code` instead.
|
|
43
|
+
# @return [Seam::Resources::AccessCode] OK
|
|
19
44
|
def create(device_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, common_code_key: nil, ends_at: nil, is_external_modification_allowed: 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, use_backup_access_code_pool: nil, use_offline_access_code: nil)
|
|
20
45
|
res = @client.post("/access_codes/create", {device_id: device_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, common_code_key: common_code_key, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, 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, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact)
|
|
21
46
|
|
|
22
47
|
Seam::Resources::AccessCode.load_from_response(res.body["access_code"])
|
|
23
48
|
end
|
|
24
49
|
|
|
50
|
+
# Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices.
|
|
51
|
+
#
|
|
52
|
+
# Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock.
|
|
53
|
+
#
|
|
54
|
+
# If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a `common_code_key`. That is, `common_code_key` remains null for these access codes.
|
|
55
|
+
#
|
|
56
|
+
# If you want to change these access codes that are not linked by a `common_code_key`, you cannot use `/access_codes/update_multiple`. However, you can update each of these access codes individually, using `/access_codes/update`.
|
|
57
|
+
#
|
|
58
|
+
# See also [Creating and Updating Multiple Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes).
|
|
59
|
+
#
|
|
60
|
+
# For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes.
|
|
61
|
+
# @param device_ids IDs of the devices for which you want to create the new access codes.
|
|
62
|
+
# @param allow_external_modification Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`.
|
|
63
|
+
# @param attempt_for_offline_device
|
|
64
|
+
# @param behavior_when_code_cannot_be_shared Desired behavior if any device cannot share a code. If `throw` (default), no access codes will be created if any device cannot share a code. If `create_random_code`, a random code will be created on devices that cannot share a code.
|
|
65
|
+
# @param code Code to be used for access.
|
|
66
|
+
# @param ends_at Date and time at which the validity of the new access code 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`.
|
|
67
|
+
# @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`.
|
|
68
|
+
# @param name Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.
|
|
69
|
+
#
|
|
70
|
+
# Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`.
|
|
71
|
+
#
|
|
72
|
+
# To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints.
|
|
73
|
+
#
|
|
74
|
+
# To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components).
|
|
75
|
+
# @param prefer_native_scheduling Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`.
|
|
76
|
+
# @param preferred_code_length Preferred code length. If the affected devices do not support the preferred code length, Seam reverts to using the shortest supported code length.
|
|
77
|
+
# @param starts_at Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
78
|
+
# @param use_backup_access_code_pool Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code).
|
|
79
|
+
# @return [Seam::Resources::AccessCode] OK
|
|
25
80
|
def create_multiple(device_ids:, allow_external_modification: nil, attempt_for_offline_device: nil, behavior_when_code_cannot_be_shared: nil, code: nil, ends_at: nil, is_external_modification_allowed: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, use_backup_access_code_pool: nil)
|
|
26
81
|
res = @client.post("/access_codes/create_multiple", {device_ids: device_ids, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, behavior_when_code_cannot_be_shared: behavior_when_code_cannot_be_shared, code: code, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, use_backup_access_code_pool: use_backup_access_code_pool}.compact)
|
|
27
82
|
|
|
28
83
|
Seam::Resources::AccessCode.load_from_response(res.body["access_codes"])
|
|
29
84
|
end
|
|
30
85
|
|
|
86
|
+
# Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
|
|
87
|
+
# @param access_code_id ID of the access code that you want to delete.
|
|
88
|
+
# @param device_id ID of the device for which you want to delete the access code.
|
|
89
|
+
# @return [nil] OK
|
|
31
90
|
def delete(access_code_id:, device_id: nil)
|
|
32
91
|
@client.post("/access_codes/delete", {access_code_id: access_code_id, device_id: device_id}.compact)
|
|
33
92
|
|
|
34
93
|
nil
|
|
35
94
|
end
|
|
36
95
|
|
|
96
|
+
# Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID.
|
|
97
|
+
# @param device_id ID of the device for which you want to generate a code.
|
|
98
|
+
# @return [Seam::Resources::AccessCode] OK
|
|
37
99
|
def generate_code(device_id:)
|
|
38
100
|
res = @client.post("/access_codes/generate_code", {device_id: device_id}.compact)
|
|
39
101
|
|
|
40
102
|
Seam::Resources::AccessCode.load_from_response(res.body["generated_code"])
|
|
41
103
|
end
|
|
42
104
|
|
|
105
|
+
# Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
|
|
106
|
+
#
|
|
107
|
+
# You must specify either `access_code_id` or both `device_id` and `code`.
|
|
108
|
+
# @param access_code_id ID of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
|
|
109
|
+
# @param code Code of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
|
|
110
|
+
# @param device_id ID of the device containing the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
|
|
111
|
+
# @return [Seam::Resources::AccessCode] OK
|
|
43
112
|
def get(access_code_id: nil, code: nil, device_id: nil)
|
|
44
113
|
res = @client.post("/access_codes/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact)
|
|
45
114
|
|
|
46
115
|
Seam::Resources::AccessCode.load_from_response(res.body["access_code"])
|
|
47
116
|
end
|
|
48
117
|
|
|
118
|
+
# Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
|
|
119
|
+
#
|
|
120
|
+
# Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
|
|
121
|
+
# @param access_code_ids IDs of the access codes that you want to retrieve. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
|
|
122
|
+
# @param access_grant_id ID of the access grant for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
|
|
123
|
+
# @param access_grant_key Key of the access grant for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
|
|
124
|
+
# @param access_method_id ID of the access method for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
|
|
125
|
+
# @param customer_key Customer key for which you want to list access codes.
|
|
126
|
+
# @param device_id ID of the device for which you want to list access codes. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
|
|
127
|
+
# @param limit Numerical limit on the number of access codes to return.
|
|
128
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
129
|
+
# @param search String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`.
|
|
130
|
+
# @param user_identifier_key Your user ID for the user by which to filter access codes.
|
|
131
|
+
# @return [Seam::Resources::AccessCode] OK
|
|
49
132
|
def list(access_code_ids: nil, access_grant_id: nil, access_grant_key: nil, access_method_id: nil, customer_key: nil, device_id: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil)
|
|
50
133
|
res = @client.post("/access_codes/list", {access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_key: access_grant_key, access_method_id: access_method_id, customer_key: customer_key, device_id: device_id, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact)
|
|
51
134
|
|
|
52
135
|
Seam::Resources::AccessCode.load_from_response(res.body["access_codes"])
|
|
53
136
|
end
|
|
54
137
|
|
|
138
|
+
# Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes).
|
|
139
|
+
#
|
|
140
|
+
# A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access.
|
|
141
|
+
#
|
|
142
|
+
# You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends.
|
|
143
|
+
#
|
|
144
|
+
# You can only pull backup access codes for time-bound access codes.
|
|
145
|
+
#
|
|
146
|
+
# Before pulling a backup access code, make sure that the device's `properties.supports_backup_access_code_pool` is `true`. Then, to activate the backup pool, set `use_backup_access_code_pool` to `true` when creating an access code.
|
|
147
|
+
# @param access_code_id ID of the access code for which you want to pull a backup access code.
|
|
148
|
+
# @return [Seam::Resources::AccessCode] OK
|
|
55
149
|
def pull_backup_access_code(access_code_id:)
|
|
56
150
|
res = @client.post("/access_codes/pull_backup_access_code", {access_code_id: access_code_id}.compact)
|
|
57
151
|
|
|
58
152
|
Seam::Resources::AccessCode.load_from_response(res.body["access_code"])
|
|
59
153
|
end
|
|
60
154
|
|
|
155
|
+
# Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices.
|
|
156
|
+
#
|
|
157
|
+
# Specify either `supported_code_lengths` or `min_code_length`/`max_code_length`.
|
|
158
|
+
# @param device_id ID of the device for which you want to report constraints.
|
|
159
|
+
# @param max_code_length Maximum supported code length as an integer between 4 and 20, inclusive. You can specify either `min_code_length`/`max_code_length` or `supported_code_lengths`.
|
|
160
|
+
# @param min_code_length Minimum supported code length as an integer between 4 and 20, inclusive. You can specify either `min_code_length`/`max_code_length` or `supported_code_lengths`.
|
|
161
|
+
# @param supported_code_lengths Array of supported code lengths as integers between 4 and 20, inclusive. You can specify either `supported_code_lengths` or `min_code_length`/`max_code_length`.
|
|
162
|
+
# @return [nil] OK
|
|
61
163
|
def report_device_constraints(device_id:, max_code_length: nil, min_code_length: nil, supported_code_lengths: nil)
|
|
62
164
|
@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
165
|
|
|
64
166
|
nil
|
|
65
167
|
end
|
|
66
168
|
|
|
169
|
+
# Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
|
|
170
|
+
#
|
|
171
|
+
# See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes).
|
|
172
|
+
# @param access_code_id ID of the access code that you want to update.
|
|
173
|
+
# @param allow_external_modification Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`.
|
|
174
|
+
# @param attempt_for_offline_device
|
|
175
|
+
# @param code Code to be used for access.
|
|
176
|
+
# @param device_id ID of the device containing the access code that you want to update.
|
|
177
|
+
# @param ends_at Date and time at which the validity of the new access code 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`.
|
|
178
|
+
# @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`.
|
|
179
|
+
# @param is_managed Indicates whether the access code is managed through Seam. Note that to convert an unmanaged access code into a managed access code, use `/access_codes/unmanaged/convert_to_managed`.
|
|
180
|
+
# @param is_offline_access_code Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes).
|
|
181
|
+
# @param is_one_time_use Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code.
|
|
182
|
+
# @param max_time_rounding Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`.
|
|
183
|
+
# @param name Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.
|
|
184
|
+
#
|
|
185
|
+
# Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`.
|
|
186
|
+
#
|
|
187
|
+
# To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints.
|
|
188
|
+
#
|
|
189
|
+
# To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components).
|
|
190
|
+
# @param prefer_native_scheduling Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`.
|
|
191
|
+
# @param preferred_code_length Preferred code length. Only applicable if you do not specify a `code`. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length.
|
|
192
|
+
# @param starts_at Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
193
|
+
# @param type Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set `type` to `ongoing`. See also [Changing a time-bound access code to permanent access](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access).
|
|
194
|
+
# @param use_backup_access_code_pool Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code).
|
|
195
|
+
# @param use_offline_access_code
|
|
196
|
+
# @deprecated use_offline_access_code: Use `is_offline_access_code` instead.
|
|
197
|
+
# @return [nil] OK
|
|
67
198
|
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, type: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil)
|
|
68
199
|
@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, type: type, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact)
|
|
69
200
|
|
|
70
201
|
nil
|
|
71
202
|
end
|
|
72
203
|
|
|
204
|
+
# Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes) that share a common code across multiple devices.
|
|
205
|
+
#
|
|
206
|
+
# Specify the `common_code_key` to identify the set of access codes that you want to update.
|
|
207
|
+
#
|
|
208
|
+
# See also [Update Linked Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes).
|
|
209
|
+
# @param common_code_key Key that links the group of access codes, assigned on creation by `/access_codes/create_multiple`.
|
|
210
|
+
# @param ends_at Date and time at which the validity of the new access code 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`.
|
|
211
|
+
# @param name Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.
|
|
212
|
+
#
|
|
213
|
+
# Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`.
|
|
214
|
+
#
|
|
215
|
+
# To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints.
|
|
216
|
+
#
|
|
217
|
+
# To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components).
|
|
218
|
+
# @param starts_at Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
219
|
+
# @return [nil] OK
|
|
73
220
|
def update_multiple(common_code_key:, ends_at: nil, name: nil, starts_at: nil)
|
|
74
221
|
@client.post("/access_codes/update_multiple", {common_code_key: common_code_key, ends_at: ends_at, name: name, starts_at: starts_at}.compact)
|
|
75
222
|
|
|
@@ -8,6 +8,11 @@ module Seam
|
|
|
8
8
|
@defaults = defaults
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
|
|
12
|
+
# @param code Code of the simulated unmanaged access code.
|
|
13
|
+
# @param device_id ID of the device for which you want to simulate the creation of an unmanaged access code.
|
|
14
|
+
# @param name Name of the simulated unmanaged access code.
|
|
15
|
+
# @return [Seam::Resources::UnmanagedAccessCode] OK
|
|
11
16
|
def create_unmanaged_access_code(code:, device_id:, name:)
|
|
12
17
|
res = @client.post("/access_codes/simulate/create_unmanaged_access_code", {code: code, device_id: device_id, name: name}.compact)
|
|
13
18
|
|
|
@@ -8,30 +8,64 @@ module Seam
|
|
|
8
8
|
@defaults = defaults
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
|
|
12
|
+
#
|
|
13
|
+
# An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it.
|
|
14
|
+
#
|
|
15
|
+
# Note that not all device providers support converting an unmanaged access code to a managed access code.
|
|
16
|
+
# @param access_code_id ID of the unmanaged access code that you want to convert to a managed access code.
|
|
17
|
+
# @param allow_external_modification Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed.
|
|
18
|
+
# @param force Indicates whether to force the access code conversion. To switch management of an access code from one Seam workspace to another, set `force` to `true`.
|
|
19
|
+
# @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed.
|
|
20
|
+
# @return [nil] OK
|
|
11
21
|
def convert_to_managed(access_code_id:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil)
|
|
12
22
|
@client.post("/access_codes/unmanaged/convert_to_managed", {access_code_id: access_code_id, allow_external_modification: allow_external_modification, force: force, is_external_modification_allowed: is_external_modification_allowed}.compact)
|
|
13
23
|
|
|
14
24
|
nil
|
|
15
25
|
end
|
|
16
26
|
|
|
27
|
+
# Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes).
|
|
28
|
+
# @param access_code_id ID of the unmanaged access code that you want to delete.
|
|
29
|
+
# @return [nil] OK
|
|
17
30
|
def delete(access_code_id:)
|
|
18
31
|
@client.post("/access_codes/unmanaged/delete", {access_code_id: access_code_id}.compact)
|
|
19
32
|
|
|
20
33
|
nil
|
|
21
34
|
end
|
|
22
35
|
|
|
36
|
+
# Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes).
|
|
37
|
+
#
|
|
38
|
+
# You must specify either `access_code_id` or both `device_id` and `code`.
|
|
39
|
+
# @param access_code_id ID of the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
|
|
40
|
+
# @param code Code of the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
|
|
41
|
+
# @param device_id ID of the device containing the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
|
|
42
|
+
# @return [Seam::Resources::UnmanagedAccessCode] OK
|
|
23
43
|
def get(access_code_id: nil, code: nil, device_id: nil)
|
|
24
44
|
res = @client.post("/access_codes/unmanaged/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact)
|
|
25
45
|
|
|
26
46
|
Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_code"])
|
|
27
47
|
end
|
|
28
48
|
|
|
49
|
+
# Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes).
|
|
50
|
+
# @param device_id ID of the device for which you want to list unmanaged access codes.
|
|
51
|
+
# @param limit Numerical limit on the number of unmanaged access codes to return.
|
|
52
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
53
|
+
# @param search String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`.
|
|
54
|
+
# @param user_identifier_key Your user ID for the user by which to filter unmanaged access codes.
|
|
55
|
+
# @return [Seam::Resources::UnmanagedAccessCode] OK
|
|
29
56
|
def list(device_id:, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil)
|
|
30
57
|
res = @client.post("/access_codes/unmanaged/list", {device_id: device_id, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact)
|
|
31
58
|
|
|
32
59
|
Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_codes"])
|
|
33
60
|
end
|
|
34
61
|
|
|
62
|
+
# Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes).
|
|
63
|
+
# @param access_code_id ID of the unmanaged access code that you want to update.
|
|
64
|
+
# @param is_managed
|
|
65
|
+
# @param allow_external_modification Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed.
|
|
66
|
+
# @param force Indicates whether to force the unmanaged access code update.
|
|
67
|
+
# @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed.
|
|
68
|
+
# @return [nil] OK
|
|
35
69
|
def update(access_code_id:, is_managed:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil)
|
|
36
70
|
@client.post("/access_codes/unmanaged/update", {access_code_id: access_code_id, is_managed: is_managed, allow_external_modification: allow_external_modification, force: force, is_external_modification_allowed: is_external_modification_allowed}.compact)
|
|
37
71
|
|
|
@@ -12,42 +12,101 @@ module Seam
|
|
|
12
12
|
@unmanaged ||= Seam::Clients::AccessGrantsUnmanaged.new(client: @client, defaults: @defaults)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using `device_ids`) and access control systems (using `acs_entrance_ids` or `space_ids`), and can issue PIN codes, key cards, and mobile keys through a single request.
|
|
16
|
+
# @param requested_access_methods
|
|
17
|
+
# @param user_identity_id ID of user identity for whom access is being granted.
|
|
18
|
+
# @param user_identity When used, creates a new user identity with the given details, and grants them access.
|
|
19
|
+
# @param access_grant_key Unique key for the access grant within the workspace.
|
|
20
|
+
# @param acs_entrance_ids Set of IDs of the [entrances](https://docs.seam.co/api/acs/systems/list) to which access is being granted.
|
|
21
|
+
# @param customization_profile_id ID of the customization profile to apply to the Access Grant and its access methods.
|
|
22
|
+
# @param device_ids Set of IDs of the [devices](https://docs.seam.co/api/devices/list) to which access is being granted.
|
|
23
|
+
# @param ends_at Date and time at which the validity of the new grant 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`.
|
|
24
|
+
# @param location
|
|
25
|
+
# @deprecated location: Create a space first, then reference it using `space_ids`.
|
|
26
|
+
# @param location_ids
|
|
27
|
+
# @deprecated location_ids: Use `space_ids`.
|
|
28
|
+
# @param name Name for the access grant.
|
|
29
|
+
# @param reservation_key Reservation key for the access grant.
|
|
30
|
+
# @param space_ids Set of IDs of existing spaces to which access is being granted.
|
|
31
|
+
# @param space_keys Set of keys of existing spaces to which access is being granted.
|
|
32
|
+
# @param starts_at Date and time at which the validity of the new grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
33
|
+
# @return [Seam::Resources::AccessGrant] OK
|
|
15
34
|
def create(requested_access_methods:, user_identity_id: nil, user_identity: nil, access_grant_key: nil, acs_entrance_ids: nil, customization_profile_id: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: nil, reservation_key: nil, space_ids: nil, space_keys: nil, starts_at: nil)
|
|
16
35
|
res = @client.post("/access_grants/create", {requested_access_methods: requested_access_methods, user_identity_id: user_identity_id, user_identity: user_identity, access_grant_key: access_grant_key, acs_entrance_ids: acs_entrance_ids, customization_profile_id: customization_profile_id, device_ids: device_ids, ends_at: ends_at, location: location, location_ids: location_ids, name: name, reservation_key: reservation_key, space_ids: space_ids, space_keys: space_keys, starts_at: starts_at}.compact)
|
|
17
36
|
|
|
18
37
|
Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"])
|
|
19
38
|
end
|
|
20
39
|
|
|
40
|
+
# Delete an Access Grant.
|
|
41
|
+
# @param access_grant_id ID of Access Grant to delete.
|
|
42
|
+
# @return [nil] OK
|
|
21
43
|
def delete(access_grant_id:)
|
|
22
44
|
@client.post("/access_grants/delete", {access_grant_id: access_grant_id}.compact)
|
|
23
45
|
|
|
24
46
|
nil
|
|
25
47
|
end
|
|
26
48
|
|
|
49
|
+
# Get an Access Grant.
|
|
50
|
+
# @param access_grant_id ID of Access Grant to get.
|
|
51
|
+
# @param access_grant_key Unique key of Access Grant to get.
|
|
52
|
+
# @return [Seam::Resources::AccessGrant] OK
|
|
27
53
|
def get(access_grant_id: nil, access_grant_key: nil)
|
|
28
54
|
res = @client.post("/access_grants/get", {access_grant_id: access_grant_id, access_grant_key: access_grant_key}.compact)
|
|
29
55
|
|
|
30
56
|
Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"])
|
|
31
57
|
end
|
|
32
58
|
|
|
59
|
+
# Gets all related resources for one or more Access Grants.
|
|
60
|
+
# @param access_grant_ids IDs of the access grants that you want to get along with their related resources.
|
|
61
|
+
# @param access_grant_keys Keys of the access grants that you want to get along with their related resources.
|
|
62
|
+
# @param exclude
|
|
63
|
+
# @param include
|
|
64
|
+
# @return [Seam::Resources::Batch] OK
|
|
33
65
|
def get_related(access_grant_ids: nil, access_grant_keys: nil, exclude: nil, include: nil)
|
|
34
66
|
res = @client.post("/access_grants/get_related", {access_grant_ids: access_grant_ids, access_grant_keys: access_grant_keys, exclude: exclude, include: include}.compact)
|
|
35
67
|
|
|
36
68
|
Seam::Resources::Batch.load_from_response(res.body["batch"])
|
|
37
69
|
end
|
|
38
70
|
|
|
71
|
+
# Gets an Access Grant.
|
|
72
|
+
# @param access_code_id ID of the access code by which you want to filter the list of Access Grants.
|
|
73
|
+
# @param access_grant_ids IDs of the access grants to retrieve.
|
|
74
|
+
# @param access_grant_key Filter Access Grants by access_grant_key. Use null to filter for Access Grants without an access_grant_key.
|
|
75
|
+
# @param acs_entrance_id ID of the entrance by which you want to filter the list of Access Grants.
|
|
76
|
+
# @param acs_system_id ID of the access system by which you want to filter the list of Access Grants.
|
|
77
|
+
# @param customer_key Customer key for which you want to list access grants.
|
|
78
|
+
# @param device_id ID of the device by which you want to filter the list of Access Grants.
|
|
79
|
+
# @param limit Numerical limit on the number of access grants to return.
|
|
80
|
+
# @param location_id
|
|
81
|
+
# @deprecated location_id: Use `space_id`.
|
|
82
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
83
|
+
# @param reservation_key Filter Access Grants by reservation_key.
|
|
84
|
+
# @param space_id ID of the space by which you want to filter the list of Access Grants.
|
|
85
|
+
# @param user_identity_id ID of user identity by which you want to filter the list of Access Grants.
|
|
86
|
+
# @return [Seam::Resources::AccessGrant] OK
|
|
39
87
|
def list(access_code_id: nil, access_grant_ids: nil, access_grant_key: nil, acs_entrance_id: nil, acs_system_id: nil, customer_key: nil, device_id: nil, limit: nil, location_id: nil, page_cursor: nil, reservation_key: nil, space_id: nil, user_identity_id: nil)
|
|
40
88
|
res = @client.post("/access_grants/list", {access_code_id: access_code_id, access_grant_ids: access_grant_ids, access_grant_key: access_grant_key, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, customer_key: customer_key, device_id: device_id, limit: limit, location_id: location_id, page_cursor: page_cursor, reservation_key: reservation_key, space_id: space_id, user_identity_id: user_identity_id}.compact)
|
|
41
89
|
|
|
42
90
|
Seam::Resources::AccessGrant.load_from_response(res.body["access_grants"])
|
|
43
91
|
end
|
|
44
92
|
|
|
93
|
+
# Adds additional requested access methods to an existing Access Grant.
|
|
94
|
+
# @param access_grant_id ID of the Access Grant to add access methods to.
|
|
95
|
+
# @param requested_access_methods Array of requested access methods to add to the access grant.
|
|
96
|
+
# @return [Seam::Resources::AccessGrant] OK
|
|
45
97
|
def request_access_methods(access_grant_id:, requested_access_methods:)
|
|
46
98
|
res = @client.post("/access_grants/request_access_methods", {access_grant_id: access_grant_id, requested_access_methods: requested_access_methods}.compact)
|
|
47
99
|
|
|
48
100
|
Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"])
|
|
49
101
|
end
|
|
50
102
|
|
|
103
|
+
# Updates an existing Access Grant's time window.
|
|
104
|
+
# @param access_grant_id ID of the Access Grant to update. Provide either `access_grant_id` or `access_grant_key`.
|
|
105
|
+
# @param access_grant_key Key of the Access Grant to update. Provide either `access_grant_id` or `access_grant_key`.
|
|
106
|
+
# @param ends_at Date and time at which the validity of the grant 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`.
|
|
107
|
+
# @param name Display name for the access grant.
|
|
108
|
+
# @param starts_at Date and time at which the validity of the grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
109
|
+
# @return [nil] OK
|
|
51
110
|
def update(access_grant_id: nil, access_grant_key: nil, ends_at: nil, name: nil, starts_at: nil)
|
|
52
111
|
@client.post("/access_grants/update", {access_grant_id: access_grant_id, access_grant_key: access_grant_key, ends_at: ends_at, name: name, starts_at: starts_at}.compact)
|
|
53
112
|
|
|
@@ -8,18 +8,38 @@ module Seam
|
|
|
8
8
|
@defaults = defaults
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Get an unmanaged Access Grant (where is_managed = false).
|
|
12
|
+
# @param access_grant_id ID of unmanaged Access Grant to get.
|
|
13
|
+
# @return [Seam::Resources::UnmanagedAccessGrant] OK
|
|
11
14
|
def get(access_grant_id:)
|
|
12
15
|
res = @client.post("/access_grants/unmanaged/get", {access_grant_id: access_grant_id}.compact)
|
|
13
16
|
|
|
14
17
|
Seam::Resources::UnmanagedAccessGrant.load_from_response(res.body["access_grant"])
|
|
15
18
|
end
|
|
16
19
|
|
|
20
|
+
# Gets unmanaged Access Grants (where is_managed = false).
|
|
21
|
+
# @param acs_entrance_id ID of the entrance by which you want to filter the list of unmanaged Access Grants.
|
|
22
|
+
# @param acs_system_id ID of the access system by which you want to filter the list of unmanaged Access Grants.
|
|
23
|
+
# @param limit Numerical limit on the number of unmanaged access grants to return.
|
|
24
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
25
|
+
# @param reservation_key Filter unmanaged Access Grants by reservation_key.
|
|
26
|
+
# @param user_identity_id ID of user identity by which you want to filter the list of unmanaged Access Grants.
|
|
27
|
+
# @return [Seam::Resources::UnmanagedAccessGrant] OK
|
|
17
28
|
def list(acs_entrance_id: nil, acs_system_id: nil, limit: nil, page_cursor: nil, reservation_key: nil, user_identity_id: nil)
|
|
18
29
|
res = @client.post("/access_grants/unmanaged/list", {acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, limit: limit, page_cursor: page_cursor, reservation_key: reservation_key, user_identity_id: user_identity_id}.compact)
|
|
19
30
|
|
|
20
31
|
Seam::Resources::UnmanagedAccessGrant.load_from_response(res.body["access_grants"])
|
|
21
32
|
end
|
|
22
33
|
|
|
34
|
+
# Updates an unmanaged Access Grant to make it managed.
|
|
35
|
+
#
|
|
36
|
+
# This endpoint can only be used to convert unmanaged access grants to managed ones by setting `is_managed` to `true`. It cannot be used to convert managed access grants back to unmanaged.
|
|
37
|
+
#
|
|
38
|
+
# When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed.
|
|
39
|
+
# @param access_grant_id ID of the unmanaged Access Grant to update.
|
|
40
|
+
# @param is_managed Must be set to true to convert the unmanaged access grant to managed.
|
|
41
|
+
# @param access_grant_key Unique key for the access grant. If not provided, the existing key will be preserved.
|
|
42
|
+
# @return [nil] OK
|
|
23
43
|
def update(access_grant_id:, is_managed:, access_grant_key: nil)
|
|
24
44
|
@client.post("/access_grants/unmanaged/update", {access_grant_id: access_grant_id, is_managed: is_managed, access_grant_key: access_grant_key}.compact)
|
|
25
45
|
|
|
@@ -14,6 +14,10 @@ module Seam
|
|
|
14
14
|
@unmanaged ||= Seam::Clients::AccessMethodsUnmanaged.new(client: @client, defaults: @defaults)
|
|
15
15
|
end
|
|
16
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
|
|
17
21
|
def assign_card(access_method_id:, card_number:, wait_for_action_attempt: nil)
|
|
18
22
|
res = @client.post("/access_methods/assign_card", {access_method_id: access_method_id, card_number: card_number}.compact)
|
|
19
23
|
|
|
@@ -22,12 +26,21 @@ module Seam
|
|
|
22
26
|
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
23
27
|
end
|
|
24
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
|
|
25
34
|
def delete(access_method_id: nil, access_grant_id: nil, reservation_key: nil)
|
|
26
35
|
@client.post("/access_methods/delete", {access_method_id: access_method_id, access_grant_id: access_grant_id, reservation_key: reservation_key}.compact)
|
|
27
36
|
|
|
28
37
|
nil
|
|
29
38
|
end
|
|
30
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
|
|
31
44
|
def encode(access_method_id:, acs_encoder_id:, wait_for_action_attempt: nil)
|
|
32
45
|
res = @client.post("/access_methods/encode", {access_method_id: access_method_id, acs_encoder_id: acs_encoder_id}.compact)
|
|
33
46
|
|
|
@@ -36,24 +49,46 @@ module Seam
|
|
|
36
49
|
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
37
50
|
end
|
|
38
51
|
|
|
52
|
+
# Gets an access method.
|
|
53
|
+
# @param access_method_id ID of access method to get.
|
|
54
|
+
# @return [Seam::Resources::AccessMethod] OK
|
|
39
55
|
def get(access_method_id:)
|
|
40
56
|
res = @client.post("/access_methods/get", {access_method_id: access_method_id}.compact)
|
|
41
57
|
|
|
42
58
|
Seam::Resources::AccessMethod.load_from_response(res.body["access_method"])
|
|
43
59
|
end
|
|
44
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
|
|
45
66
|
def get_related(access_method_ids:, exclude: nil, include: nil)
|
|
46
67
|
res = @client.post("/access_methods/get_related", {access_method_ids: access_method_ids, exclude: exclude, include: include}.compact)
|
|
47
68
|
|
|
48
69
|
Seam::Resources::Batch.load_from_response(res.body["batch"])
|
|
49
70
|
end
|
|
50
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
|
|
51
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)
|
|
52
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)
|
|
53
84
|
|
|
54
85
|
Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"])
|
|
55
86
|
end
|
|
56
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
|
|
57
92
|
def unlock_door(access_method_id:, acs_entrance_id:, wait_for_action_attempt: nil)
|
|
58
93
|
res = @client.post("/access_methods/unlock_door", {access_method_id: access_method_id, acs_entrance_id: acs_entrance_id}.compact)
|
|
59
94
|
|