class Lenel::OpenAccess::Client

Overview

Lenel OpenAccess API wrapper.

Provides thin abstractions over API endpoints. Requests are executed on the pased transport. This can be a PlaceOS::Driver, HTTP::Client or other type supporting the same set of base HTTP request methods.

Defined in:

lenel/open_access/client.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(transport : HTTP::Client, app_id : String) #

[View source]

Instance Method Detail

def app_id : String #

[View source]
def app_id=(app_id : String) #

[View source]
def count(entity type_name : T.class, filter : String | Nil = nil) forall T #

Counts the number of instances of entity.

filter may optionally be used to specify a subset of these.


[View source]
def create(entity : T.class, **props) forall T #

Creates a new instance of entity.

API create responses return a partial object, which is provided here as an untyped return. This includes the object's database key (which varies between object types - ID, BADGEKEY etc), however contents of this is unspecified. The partial object is provided here, in full, with keys transformed to match how they appear in a type-safe model.


[View source]
def delete(entity : T.class, **props) : Nil forall T #

Deletes an instance of entity.


[View source]
def directories #

Enumerates the directories available for auth.


[View source]
def get_logged_events(filter : String | Nil = nil, page_number : Int32 | Nil = nil, page_size : Int32 | Nil = 100, order_by : String | Nil = nil) #

Retrieve a list of logged events from Onguard See Onguard 7.6 OpenAccess User Gude > Chapter 4 REST API > Manage Instances > get logged_events


[View source]
def keepalive : Nil #

Request a connection keepalive to prevent session timeout.


[View source]
def login(username user_name : String, password : String, directory_id : String | Nil) #

Creates a new auth session.


[View source]
def logout : Nil #

Removes an auth session.


[View source]
def lookup(entity type_name : T.class, filter : String | Nil = nil, page_number : Int32 | Nil = nil, page_size : Int32 | Nil = nil, order_by : String | Nil = nil) : Array(T) forall T #

Retrieves instances of a particular entity.

The search criteria specified in filter is a subset of SQL. This supports operations such as as:

  • exclusion LastName != "Lake"
  • wildcards LastName like "La%"
  • boolean operators LastName = "Lake" OR FirstName = "Lisa"

[View source]
def raw_lookup(type_name : String, filter : String | Nil = nil, page_number : Int32 | Nil = nil, page_size : Int32 | Nil = 100, order_by : String | Nil = nil) #

[View source]
def token : String | Nil #

[View source]
def token=(token : String | Nil) #

[View source]
def update(entity : T.class, **props) : T forall T #

Updates a record of entity. Passed properties must include the types key and any fields to update.


[View source]
def version #

Gets the version of the attached OnGuard system.


[View source]