class Place::StaffAPI

Defined in:

place/staff_api.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.driver_interface : String #

Instance Method Detail

def approve(booking_id : String | Int64) #

[View source]
def booking_check_in(booking_id : String | Int64, state : Bool = true, utm_source : String | Nil = nil) #

[View source]
def booking_delete(booking_id : String | Int64, utm_source : String | Nil = nil) #

[View source]
def booking_state(booking_id : String | Int64, state : String) #

[View source]
def chat_members(session_id : String) : Array(String) #

[View source]
def create_booking(booking_type : String, asset_id : String, user_id : String, user_email : String, user_name : String, zones : Array(String), booking_start : Int64 | Nil = nil, booking_end : Int64 | Nil = nil, checked_in : Bool = false, approved : Bool | Nil = nil, title : String | Nil = nil, description : String | Nil = nil, time_zone : String | Nil = nil, extension_data : JSON::Any | Nil = nil, utm_source : String | Nil = nil, limit_override : Int64 | Nil = nil, attendees : Array(PlaceCalendar::Event::Attendee) | Nil = nil) #

=================================== BOOKINGS ACTIONS


[View source]
def create_event(event : PlaceCalendar::Event) #

[View source]
def create_user(body_json : String) #

[View source]
def delete_event(system_id : String, event_id : String) #

[View source]
def delete_user(id : String, force_removal : Bool = false) : Nil #

[View source]
def get_booking(booking_id : String | Int64) #

[View source]
def get_event(event_id : String, system_id : String | Nil = nil, calendar : String | Nil = nil) #

gets an event from either the system_id or calendar if only one is provided if both are provided, it gets the event from calendar and the metadata from system_id

NOTE : the use of calendar will typically not work from a driver unless the X-API-Key has read access to it. From a driver perspective you should probably use a dedicated Calendar driver with application access and the query_metadata function below if metadata is required: query_metadata(system_id: "sys", event_ref: ["id", "uuid"])


[View source]
def get_survey_invites(survey_id : Int64 | Nil = nil, sent : Bool | Nil = nil) #

[View source]
def get_system(id : String, complete : Bool = false) #

[View source]
def guest_details(guest_id : String) #

=================================== Guest details


[View source]
def kick_user(user_id : String, session_id : String, reason : String) #

[View source]
def lookup_authority_id(retry : Int32 = 0) #

[View source]
def merge_metadata(id : String, key : String, payload : JSON::Any, description : String = "") #

[View source]
def metadata(id : String, key : String | Nil = nil) #

=================================== ZONE METADATA


[View source]
def metadata_children(id : String, key : String | Nil = nil) #

[View source]
def on_load #

[View source]
def on_update #

[View source]
def patch_event_metadata(system_id : String, event_id : String, metadata : JSON::Any, ical_uid : String | Nil = nil, setup_time : Int64 | Nil = nil, breakdown_time : Int64 | Nil = nil, setup_event_id : String | Nil = nil, breakdown_event_id : String | Nil = nil) #

[View source]
def push_event_status #

[View source]
def query_bookings(type : String | Nil = nil, period_start : Int64 | Nil = nil, period_end : Int64 | Nil = nil, zones : Array(String) = [] of String, user : String | Nil = nil, email : String | Nil = nil, state : String | Nil = nil, created_before : Int64 | Nil = nil, created_after : Int64 | Nil = nil, approved : Bool | Nil = nil, rejected : Bool | Nil = nil, checked_in : Bool | Nil = nil, include_checked_out : Bool | Nil = nil, extension_data : JSON::Any | Nil = nil) #

=================================== BOOKINGS QUERY


[View source]
def query_events(period_start : Int64, period_end : Int64, zones : Array(String) | Nil = nil, systems : Array(String) | Nil = nil, capacity : Int32 | Nil = nil, features : String | Nil = nil, bookable : Bool | Nil = nil, include_cancelled : Bool | Nil = nil) #

=================================== CALENDAR EVENT ACTIONS (via staff api)


[View source]
def query_guests(period_start : Int64, period_end : Int64, zones : Array(String)) #

[View source]
def query_metadata(period_start : Int64 | Nil = nil, period_end : Int64 | Nil = nil, field_name : String | Nil = nil, value : String | Nil = nil, system_id : String | Nil = nil, event_ref : Array(String) | Nil = nil) #

Search for metadata that exists on events to obtain the event information. For response details see EventMetadata__Assigner in the OpenAPI docs https://editor.swagger.io/?url=https://raw.githubusercontent.com/PlaceOS/staff-api/master/OPENAPI_DOC.yml


[View source]
def query_users(q : String | Nil = nil, limit : Int32 = 20, offset : Int32 = 0, authority_id : String | Nil = nil, include_deleted : Bool = false) #

[View source]
def reject(booking_id : String | Int64, utm_source : String | Nil = nil) #

[View source]
def replace_event_metadata(system_id : String, event_id : String, metadata : JSON::Any, ical_uid : String | Nil = nil, setup_time : Int64 | Nil = nil, breakdown_time : Int64 | Nil = nil, setup_event_id : String | Nil = nil, breakdown_event_id : String | Nil = nil) #

[View source]
def resource_token #

[View source]
def revive_user(id : String) : Nil #

[View source]
def signal(channel : String, payload : JSON::Any | Nil = nil) #

[View source]
def staff_details(email : String) #

Staff details returns the information from AD


[View source]
def system_settings(id : String, key : String) #

[View source]
def systems(q : String | Nil = nil, zone_id : String | Nil = nil, capacity : Int32 | Nil = nil, bookable : Bool | Nil = nil, features : String | Nil = nil, limit : Int32 = 1000, offset : Int32 = 0) #

[View source]
def systems_in_building(zone_id : String, ids_only : Bool = true) #

[View source]
def transfer_user(user_id : String, session_id : String, payload : JSON::Any) #

[View source]
def update_booking(booking_id : String | Int64, booking_start : Int64 | Nil = nil, booking_end : Int64 | Nil = nil, asset_id : String | Nil = nil, title : String | Nil = nil, description : String | Nil = nil, timezone : String | Nil = nil, extension_data : JSON::Any | Nil = nil, approved : Bool | Nil = nil, checked_in : Bool | Nil = nil, limit_override : Int64 | Nil = nil) #

[View source]
def update_event(system_id : String, event : PlaceCalendar::Event) #

NOTE : https://docs.google.com/document/d/1OaZljpjLVueFitmFWx8xy8BT8rA2lITyPsIvSYyNNW8/edit# The service account making this request needs delegated access and hence you can only edit events associated with a resource calendar


[View source]
def update_guest(id : String, body_json : String) : Nil #

[View source]
def update_survey_invite(token : String, email : String | Nil = nil, sent : Bool | Nil = nil) #

[View source]
def update_user(id : String, body_json : String) : Nil #

[View source]
def user(id : String) #

=================================== User details


[View source]
def user_resource_token #

NOTE : this function requires "users" scope to be specified explicity for access


[View source]
def write_metadata(id : String, key : String, payload : JSON::Any, description : String = "") #

[View source]
def zone(zone_id : String) #

=================================== ZONE INFORMATION


[View source]
def zones(q : String | Nil = nil, limit : Int32 = 1000, offset : Int32 = 0, parent : String | Nil = nil, tags : Array(String) | String | Nil = nil) #

[View source]