API specifications¶
Python data structures describing various aspects of the api.ninchat.com service.
-
ninchat.api.actions¶ Dictionary; maps name strings to Interface instances.
-
ninchat.api.events¶ Dictionary; maps name strings to Interface instances.
-
ninchat.api.paramtypes¶ Dictionary; maps name strings to Parameter instances.
-
ninchat.api.objecttypes¶ Dictionary; maps name strings to Object instances.
-
class
ninchat.api.Interface(key, spec)¶ Description of an action or an event.
-
name¶ String
-
params¶ Dictionary; maps name strings to Parameter instances.
-
-
class
ninchat.api.Object(key, spec)¶ Description of an event parameter’s structure.
-
name¶ String
-
value¶ String|None; type of a map object’s values.
-
item¶ String|None; type of an array object’s items.
-
params¶ Dictionary|None; maps property name strings to Parameter instances.
-
-
class
ninchat.api.Parameter(key, spec)¶ Description of an action’s or an event’s parameter.
-
name¶ String
-
type¶ String|None
-
required¶ Boolean
-
validate(value)¶ Check if value conforms to the type requirements, or is None while the parameter is optional.
-
Attributes¶
Attributes for each entity type.
-
ninchat.api.attrs.user¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.identity¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.dialoguemember¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.channel¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.channelmember¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.realm¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.realmmember¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.queue¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.queuemember¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.tag¶ Dictionary; maps name strings to Attribute instances.
-
ninchat.api.attrs.puppet¶ Dictionary; maps name strings to Attribute instances.
Message types¶
Standard message type definitions.
-
ninchat.api.messages.log¶ A logging.Logger instance which may be configured by the application.
-
ninchat.api.messages.factories¶ List of pairs; maps message-type-pattern strings to handler-factory callables.
A handler-factory callable takes a message-type string and a payload list as positional parameters, and returns an instance of a Message implementation or None.
-
class
ninchat.api.messages.Message(messagetype, payload)¶ Message handler interface. Subclasses should override the validate(), stringify() and get_property(name) methods if applicable.
-
type¶ String
-
payload¶ List of some kind of objects.
-
get_property(name)¶ Get a type-specific string property.
-
stringify()¶ Get the presentable textual content of the message, if any.
-
validate()¶ Check if the payload conforms to the type requirements.
-
-
class
ninchat.api.messages.file.FileMessage(messagetype, payload)¶ Stub for the ninchat.com/file message type.
-
class
ninchat.api.messages.info.AccessInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/access message type.
-
class
ninchat.api.messages.info.ChannelInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/channel message type.
-
class
ninchat.api.messages.info.JoinInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/join message type.
-
class
ninchat.api.messages.info.MemberInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/member message type.
-
class
ninchat.api.messages.info.PartInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/part message type.
-
class
ninchat.api.messages.info.TransferSourceInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/transfer/source message type.
-
class
ninchat.api.messages.info.TransferTargetInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/transfer/target message type.
-
class
ninchat.api.messages.info.UserInfoMessage(messagetype, payload)¶ Stub for the ninchat.com/info/user message type.
-
class
ninchat.api.messages.json.JSONMessage(messagetype, payload)¶ Handler for ninchat.com/json messages. Supports the “json” property.
-
stringify()¶ Get the presentable textual content of the message, if any.
-
-
class
ninchat.api.messages.link.LinkMessage(messagetype, payload)¶ Handler for ninchat.com/link messages. This message type is deprecated.
-
stringify()¶ Get the presentable textual content of the message, if any.
-
-
class
ninchat.api.messages.metadata.MetadataMessage(messagetype, payload)¶ Handler for ninchat.com/metadata messages.
-
stringify()¶ Get the presentable textual content of the message, if any.
-
-
class
ninchat.api.messages.notice.NoticeMessage(messagetype, payload)¶ Handler for ninchat.com/notice messages. Supports the “text” property.
-
class
ninchat.api.messages.rtc.AnswerRTCMessage(messagetype, payload)¶
-
class
ninchat.api.messages.rtc.CallRTCMessage(messagetype, payload)¶
-
class
ninchat.api.messages.rtc.HangUpRTCMessage(messagetype, payload)¶
-
class
ninchat.api.messages.rtc.IceCandidateRTCMessage(messagetype, payload)¶
-
class
ninchat.api.messages.rtc.OfferRTCMessage(messagetype, payload)¶
-
class
ninchat.api.messages.rtc.PickUpRTCMessage(messagetype, payload)¶
-
class
ninchat.api.messages.text.TextMessage(messagetype, payload)¶ Handler for ninchat.com/text messages. Supports the “text” property.
-
stringify()¶ Get the presentable textual content of the message, if any.
-
-
class
ninchat.api.messages.ui.ActionUIMessage(messagetype, payload)¶ Handler for ninchat.com/ui/action messages.
-
class
ninchat.api.messages.ui.ComposeUIMessage(messagetype, payload)¶ Handler for ninchat.com/ui/action messages.