module Cisco::CollaborationEndpoint::XAPI

Direct including types

Defined in:

cisco/collaboration_endpoint/response.cr
cisco/collaboration_endpoint/xapi.cr

Constant Summary

BOOL_OR = ->(term : String) do ->(val : String) do val == term ? term : BOOLEAN.call(val) end end
BOOLEAN = ->(val : String) do TRUTHY.includes?(val.downcase) end
COMMAND_RESPONSE = Regex.union(INVALID_COMMAND, SUCCESS)
FALSEY = {"false", "unavailable", "off", "inactive"}
INVALID_COMMAND = /(?<=Command not recognized\.)[\r\n]+/

Regexp's for tokenizing the xAPI command and response structure.

LOGIN_COMPLETE = /Login successful/
PARSERS = {"TTPAR_OnOff" => BOOLEAN, "TTPAR_OnOffAuto" => BOOL_OR.call("Auto"), "TTPAR_OnOffCurrent" => BOOL_OR.call("Current"), "TTPAR_MuteEnabled" => BOOLEAN}
SUCCESS = /(?<=OK)[\r\n]+/
TRUTHY = {"true", "available", "standby", "on", "active"}

Class Method Summary

Macro Summary

Class Method Detail

def self.create_action(__action__ : ActionType, *args, hash_args : Hash(String, JSON::Any::Type) = {} of String => JSON::Any::Type, priority : Int32 | Nil = nil, **kwargs) #

Serialize an xAPI action into transmittable command.


[View source]
def self.parse(data : String) #

[View source]
def self.tokenize(path : String) #

[View source]
def self.value_convert(value : String, valuespace : String | Nil = nil) #

[View source]
def self.xcommand(path : String, hash_args : Hash(String, JSON::Any::Type) = {} of String => JSON::Any::Type, **kwargs) #

Serialize an xCommand into transmittable command.


[View source]
def self.xconfiguration(path : String, setting : String, value : JSON::Any::Type) #

Serialize an xConfiguration action into a transmittable command.


[View source]
def self.xfeedback(action : FeedbackAction, path : String | Nil = nil) #

Serialize a xFeedback subscription request.


[View source]
def self.xstatus(path : String) #

Serialize an xStatus request into transmittable command.


[View source]

Macro Detail

macro command(cmd_name, **params) #

[View source]