Class: Seam::Resources::AccessCode
- Inherits:
-
BaseResource
- Object
- BaseResource
- Seam::Resources::AccessCode
- Defined in:
- lib/seam/resources/access_code.rb
Overview
Represents a smart lock access code.
An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. Using the Seam Access Code API, you can easily generate access codes on the hundreds of door lock models with which we integrate.
Seam supports programming two types of access codes: ongoing and time-bound. To differentiate between the two, refer to the type property of the access code. Ongoing codes display as ongoing, whereas time-bound codes are labeled time_bound. An ongoing access code is active, until it has been removed from the device. To specify an ongoing access code, leave both starts_at and ends_at empty. A time-bound access code will be programmed at the starts_at time and removed at the ends_at time.
In addition, for certain devices, Seam also supports offline access codes. Offline access (PIN) codes are designed for door locks that might not always maintain an internet connection. For this type of access code, the device manufacturer uses encryption keys (tokens) to create server-based registries of algorithmically-generated offline PIN codes. Because the tokens remain synchronized with the managed devices, the locks do not require an active internet connection—and you do not need to be near the locks—to create an offline access code. Then, owners or managers can share these offline codes with users through a variety of mechanisms, such as messaging applications. That is, lock users do not need to install a smartphone application to receive an offline access code.
For granting a person access to a space, Access Grants 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.
Defined Under Namespace
Classes: DormakabaOracodeMetadata, Errors, PendingMutations, Warnings
Instance Attribute Summary collapse
-
#access_code_id ⇒ String
Unique identifier for the access code.
-
#code ⇒ String?
Code used for access.
-
#common_code_key ⇒ String?
Unique identifier for a group of access codes that share the same code.
-
#device_id ⇒ String
Unique identifier for the device associated with the access code.
-
#is_backup ⇒ Boolean?
Indicates whether the access code is a backup code.
-
#is_backup_access_code_available ⇒ Boolean
Indicates whether a backup access code is available for use if the primary access code is lost or compromised.
-
#is_external_modification_allowed ⇒ Boolean
Indicates whether changes to the access code from external sources are permitted.
-
#is_managed ⇒ TrueClass
Indicates whether Seam manages the access code.
-
#is_offline_access_code ⇒ Boolean
Indicates whether the access code is intended for use in offline scenarios.
-
#is_one_time_use ⇒ Boolean
Indicates whether the access code can only be used once.
-
#is_scheduled_on_device ⇒ Boolean?
Indicates whether the code is set on the device according to a preconfigured schedule.
-
#is_waiting_for_code_assignment ⇒ Boolean?
Indicates whether the access code is waiting for a code assignment.
-
#name ⇒ String?
Name of the access code.
-
#pulled_backup_access_code_id ⇒ String?
Identifier of the pulled backup access code.
-
#status ⇒ String
Current status of the access code within the operational lifecycle.
-
#type ⇒ String
Type of the access code.
-
#workspace_id ⇒ String
Unique identifier for the Seam workspace associated with the access code.
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#created_at ⇒ Time
Date and time at which the access code was created.
-
#dormakaba_oracode_metadata ⇒ DormakabaOracodeMetadata?
Metadata for a dormakaba Oracode managed access code.
-
#ends_at ⇒ Time?
Date and time after which the time-bound access code becomes inactive.
-
#errors ⇒ Array<Errors>
Errors associated with the access code.
-
#pending_mutations ⇒ Array<PendingMutations>
Collection of pending mutations for the access code.
-
#starts_at ⇒ Time?
Date and time at which the time-bound access code becomes active.
-
#warnings ⇒ Array<Warnings>
Warnings associated with the access code.
Methods inherited from BaseResource
#[], aliased_accessor, attribute_aliases, date_accessor, discriminated_by, #initialize, #inspect, load_from_response, resource_accessor, resource_accessors, resource_list_accessor, resource_list_accessors, #update_from_response
Constructor Details
This class inherits a constructor from Seam::Resources::BaseResource
Instance Attribute Details
#access_code_id ⇒ String
Unique identifier for the access code.
830 831 832 |
# File 'lib/seam/resources/access_code.rb', line 830 def access_code_id @access_code_id end |
#code ⇒ String?
Code used for access. Typically, a numeric or alphanumeric string.
833 834 835 |
# File 'lib/seam/resources/access_code.rb', line 833 def code @code end |
#common_code_key ⇒ String?
Unique identifier for a group of access codes that share the same code.
836 837 838 |
# File 'lib/seam/resources/access_code.rb', line 836 def common_code_key @common_code_key end |
#device_id ⇒ String
Unique identifier for the device associated with the access code.
839 840 841 |
# File 'lib/seam/resources/access_code.rb', line 839 def device_id @device_id end |
#is_backup ⇒ Boolean?
Indicates whether the access code is a backup code.
842 843 844 |
# File 'lib/seam/resources/access_code.rb', line 842 def is_backup @is_backup end |
#is_backup_access_code_available ⇒ Boolean
Indicates whether a backup access code is available for use if the primary access code is lost or compromised.
845 846 847 |
# File 'lib/seam/resources/access_code.rb', line 845 def is_backup_access_code_available @is_backup_access_code_available end |
#is_external_modification_allowed ⇒ Boolean
Indicates whether changes to the access code from external sources are permitted.
848 849 850 |
# File 'lib/seam/resources/access_code.rb', line 848 def is_external_modification_allowed @is_external_modification_allowed end |
#is_managed ⇒ TrueClass
Indicates whether Seam manages the access code.
851 852 853 |
# File 'lib/seam/resources/access_code.rb', line 851 def is_managed @is_managed end |
#is_offline_access_code ⇒ Boolean
Indicates whether the access code is intended for use in offline scenarios. If true, this code can be created on a device without a network connection.
854 855 856 |
# File 'lib/seam/resources/access_code.rb', line 854 def is_offline_access_code @is_offline_access_code end |
#is_one_time_use ⇒ Boolean
Indicates whether the access code can only be used once. If true, the code becomes invalid after the first use.
857 858 859 |
# File 'lib/seam/resources/access_code.rb', line 857 def is_one_time_use @is_one_time_use end |
#is_scheduled_on_device ⇒ Boolean?
Indicates whether the code is set on the device according to a preconfigured schedule.
860 861 862 |
# File 'lib/seam/resources/access_code.rb', line 860 def is_scheduled_on_device @is_scheduled_on_device end |
#is_waiting_for_code_assignment ⇒ Boolean?
Indicates whether the access code is waiting for a code assignment.
863 864 865 |
# File 'lib/seam/resources/access_code.rb', line 863 def is_waiting_for_code_assignment @is_waiting_for_code_assignment end |
#name ⇒ String?
Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. 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. 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. 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).
866 867 868 |
# File 'lib/seam/resources/access_code.rb', line 866 def name @name end |
#pulled_backup_access_code_id ⇒ String?
Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code.
869 870 871 |
# File 'lib/seam/resources/access_code.rb', line 869 def pulled_backup_access_code_id @pulled_backup_access_code_id end |
#status ⇒ String
Current status of the access code within the operational lifecycle. Values are setting, a transitional phase that indicates that the code is being configured or activated; set, which indicates that the code is active and operational; unset, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; removing, which indicates a transitional period in which the code is being deleted or made inactive; and unknown, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also Lifecycle of Access Codes.
Known values:
settingsetunsetremovingunknown
878 879 880 |
# File 'lib/seam/resources/access_code.rb', line 878 def status @status end |
#type ⇒ String
Type of the access code. ongoing access codes are active continuously until deactivated manually. time_bound access codes have a specific duration.
Known values:
time_boundongoing
884 885 886 |
# File 'lib/seam/resources/access_code.rb', line 884 def type @type end |
#workspace_id ⇒ String
Unique identifier for the Seam workspace associated with the access code.
887 888 889 |
# File 'lib/seam/resources/access_code.rb', line 887 def workspace_id @workspace_id end |
Instance Method Details
#created_at ⇒ Time
Date and time at which the access code was created.
891 |
# File 'lib/seam/resources/access_code.rb', line 891 date_accessor :created_at |
#dormakaba_oracode_metadata ⇒ DormakabaOracodeMetadata?
Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices.
818 |
# File 'lib/seam/resources/access_code.rb', line 818 resource_accessor :dormakaba_oracode_metadata, DormakabaOracodeMetadata |
#ends_at ⇒ Time?
Date and time after which the time-bound access code becomes inactive.
895 |
# File 'lib/seam/resources/access_code.rb', line 895 date_accessor :ends_at |
#errors ⇒ Array<Errors>
Errors associated with the access code.
821 |
# File 'lib/seam/resources/access_code.rb', line 821 resource_list_accessor :errors, Errors |
#pending_mutations ⇒ Array<PendingMutations>
Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device.
824 |
# File 'lib/seam/resources/access_code.rb', line 824 resource_list_accessor :pending_mutations, PendingMutations |
#starts_at ⇒ Time?
Date and time at which the time-bound access code becomes active.
899 |
# File 'lib/seam/resources/access_code.rb', line 899 date_accessor :starts_at |
#warnings ⇒ Array<Warnings>
Warnings associated with the access code.
827 |
# File 'lib/seam/resources/access_code.rb', line 827 resource_list_accessor :warnings, Warnings |