class Gallagher::RestAPI
- Gallagher::RestAPI
- PlaceOS::Driver
- Reference
- Object
Included Modules
- PlaceOS::Driver::Interface::DoorSecurity
Defined in:
gallagher/rest_api.crClass Method Summary
Macro Summary
Instance Method Summary
- #cardholder_exists?(filter : String)
- #connected
- #create_cardholder(first_name : String, last_name : String, description : String = "a cardholder", authorised : Bool = true, pdfs : Hash(String, String) | Nil = nil, cards : Array(Card) | Nil = nil, access_groups : Array(CardholderAccessGroup) | Nil = nil, short_name : String | Nil = nil, division_href : String | Nil = nil)
- #delete_card(href : String)
- #delete_href(href : String)
- #disable_card(href : String)
- #door_list : Array(Door)
- #doors
-
#free_zone(zone_id : String | Int32) : Bool | Nil
forces a zone to be free, that is doors are unlocked
- #get_access_group(id : String)
- #get_access_group_members(id : String)
- #get_access_groups(name : String | Nil = nil, exact_match : Bool = true)
- #get_base64_pdf(user_id : String, pdf_id : String | UInt64)
- #get_card_type(id : String | Int32 | Nil = nil)
- #get_cardholder(id : String)
- #get_division(id : String)
- #get_divisions(name : String | Nil = nil, exact_match : Bool = true)
- #get_event_groups
- #get_events
- #get_href(href : String)
- #get_pdf(user_id : String, pdf_id : String | UInt64)
- #get_pdfs(name : String | Nil = nil, exact_match : Bool = true)
- #get_zones(name : String | Nil = nil, exact_match : Bool = true)
- #on_load
- #on_unload
- #on_update
- #query_card_types
- #query_cardholders(filter : String, pdf_name : String | Nil = nil, exact_match : Bool = true)
- #query_endpoints
- #remove_cardholder_access(id : String | Nil = nil, href : String | Nil = nil)
-
#reset_zone(zone_id : String | Int32) : Bool | Nil
returns the zone to it's default scheduled state, removing any overrides
-
#secure_zone(zone_id : String | Int32) : Bool | Nil
forces a zone to be secure and require a swipe card to access
-
#unlock(door_id : String) : Bool | Nil
true for success, false for failed, nil for not supported
- #update_cardholder(id : String | Nil = nil, href : String | Nil = nil, first_name : String | Nil = nil, last_name : String | Nil = nil, description : String | Nil = nil, authorised : Bool = true, pdfs : Hash(String, String) | Nil = nil, cards : Array(Card) | Nil = nil, remove_cards : Array(Card) | Nil = nil, update_cards : Array(Card) | Nil = nil, access_groups : Array(CardholderAccessGroup) | Nil = nil, remove_access_groups : Array(CardholderAccessGroup) | Nil = nil, update_access_groups : Array(CardholderAccessGroup) | Nil = nil, short_name : String | Nil = nil, division_href : String | Nil = nil)
Class Method Detail
Macro Detail
Instance Method Detail
Create a new cardholder.
@param first_name [String] The first name of the new cardholder. Either this or last name is required (but we should assume both are for most instances).
@param last_name [String] The last name of the new cardholder. Either this or first name is required (but we should assume both are for most instances).
@option options [String] :division The division to add the cardholder to. This is required when making the request to create the cardholder but if none is passed the default_division
is used.
@option options [Hash] :pdfs A hash containing all PDFs to add to the user in the form { some_pdf_name: some_pdf_value, another_pdf_name: another_pdf_value }
.
@option options [Array] :cards An array of cards to be added to this cardholder which can include both virtual and physical cards.
@option options [Array] :access_groups An array of access groups to add this cardholder to. These may include from
and until
fields to dictate temporary access.
@option options [Array] :competencies An array of competencies to add this cardholder to.
@return [Hash] The cardholder that was created.
forces a zone to be free, that is doors are unlocked
Personal Data Fields (PDFs) are custom fields that Gallagher allows definintions of on a site-by-site basis. They will usually be for things like email address, employee ID or some other field specific to whoever is hosting the Gallagher instance. Allows retrieval of the PDFs used in the Gallagher instance, primarily so we can get the PDF's ID and use that to filter cardholders based on that PDF.
@param name [String] The name of the PDF which we want to retrieve. This will only return one result (as the PDF names are unique). @return [Hash] A list of PDF results and a next link for pagination (we will generally have less than 100 PDFs so 'next' link will mostly be unused): @example An example response: { "results": [ { "name": "email", "id": "5516", "href": "https://localhost:8904/api/personal_data_fields/5516" }, { "name": "cellphone", "id": "9998", "href": "https://localhost:8904/api/personal_data_fields/9998", "serverDisplayName": "Site B" } ], "next": { "href": "https://localhost:8904/api/personal_data_fields?pos=900&sort=id" } }
returns the zone to it's default scheduled state, removing any overrides
forces a zone to be secure and require a swipe card to access
true for success, false for failed, nil for not supported