Liking cljdoc? Tell your friends :D

openadr3.vtn.schema

VTN-side entity coercion and notification payload construction.

Leverages clj-oa3's openadr3.entities for raw→coerced entity coercion. Provides additional helpers for building outbound notification payloads (the reverse direction: coerced/stored objects → wire-format notifications).

VTN-side entity coercion and notification payload construction.

Leverages clj-oa3's openadr3.entities for raw→coerced entity coercion.
Provides additional helpers for building outbound notification payloads
(the reverse direction: coerced/stored objects → wire-format notifications).
raw docstring

->eventclj

source

->programclj

source

->subscriptionclj

source

coercecljmultimethod

Coerce a raw camelCase API map to a namespaced entity. Dispatches on :objectType ("PROGRAM", "EVENT", etc.).

Coerce a raw camelCase API map to a namespaced entity.
Dispatches on :objectType ("PROGRAM", "EVENT", etc.).
sourceraw docstring

coerce-storedclj

(coerce-stored stored-object)

Coerce a stored storage-canon object into a namespaced entity for VTN internal logic. Bridges from the VTN's ZDT/Duration shape to clj-oa3's string-bearing input form before delegating to entities/coerce.

Coerce a stored storage-canon object into a namespaced entity for VTN
internal logic. Bridges from the VTN's ZDT/Duration shape to clj-oa3's
string-bearing input form before delegating to entities/coerce.
sourceraw docstring

coerce-stored-eventsclj

(coerce-stored-events events)

Coerce a sequence of stored event maps.

Coerce a sequence of stored event maps.
sourceraw docstring

coerce-stored-programsclj

(coerce-stored-programs programs)

Coerce a sequence of stored program maps.

Coerce a sequence of stored program maps.
sourceraw docstring

coerce-stored-subscriptionsclj

(coerce-stored-subscriptions subscriptions)

Coerce a sequence of stored subscription maps.

Coerce a sequence of stored subscription maps.
sourceraw docstring

Eventclj

source

Notificationclj

source

notification-payloadclj

(notification-payload object-type operation object)

Build a wire-format notification map suitable for MQTT publishing.

Takes: object-type — string, e.g. "PROGRAM", "EVENT" operation — string, e.g. "CREATE", "UPDATE", "DELETE" object — the storage-canon entity (ZDT-bearing)

Returns a map matching the OpenADR notification schema: {:objectType "PROGRAM" :operation "CREATE" :object {... entity with ZDT/Duration fields ...}}

ZDTs and Durations are serialised to canonical UTC Z / ISO 8601 by the JSONWriter protocol extension when the payload is JSON-encoded for the wire.

Build a wire-format notification map suitable for MQTT publishing.

Takes:
  object-type — string, e.g. "PROGRAM", "EVENT"
  operation   — string, e.g. "CREATE", "UPDATE", "DELETE"
  object      — the storage-canon entity (ZDT-bearing)

Returns a map matching the OpenADR notification schema:
  {:objectType "PROGRAM"
   :operation  "CREATE"
   :object     {... entity with ZDT/Duration fields ...}}

ZDTs and Durations are serialised to canonical UTC Z / ISO 8601 by the
JSONWriter protocol extension when the payload is JSON-encoded for the
wire.
sourceraw docstring

NotificationPayloadclj

Malli schema for an outbound notification (wire format, camelCase).

Malli schema for an outbound notification (wire format, camelCase).
sourceraw docstring

object-typesclj

Valid OpenADR object types for notifications.

Valid OpenADR object types for notifications.
sourceraw docstring

operationsclj

Valid OpenADR notification operations.

Valid OpenADR notification operations.
sourceraw docstring

Programclj

source

Subscriptionclj

source

validate-entity!clj

(validate-entity! entity)

Validate a stored entity against its storage-canon schema. Throws ex-info with :type :validation-error and Malli explanation on failure. Returns the entity unchanged on success.

Validate a stored entity against its storage-canon schema.
Throws ex-info with :type :validation-error and Malli explanation on failure.
Returns the entity unchanged on success.
sourceraw docstring

validate-notification-payloadclj

(validate-notification-payload payload)

Validate an outbound notification payload. Returns nil on success, Malli explanation on failure.

Validate an outbound notification payload. Returns nil on success,
Malli explanation on failure.
sourceraw docstring

WireEventclj

Malli schema for a stored event (storage canon, keyword keys, ZDT/Duration in time fields). GSI fields: programID (programID-index, programID-eventStart-index), intervalPeriod.start → eventStart (objectType-eventStart-index, programID-eventStart-index).

Malli schema for a stored event (storage canon, keyword keys, ZDT/Duration
in time fields). GSI fields: programID (programID-index, programID-eventStart-index),
intervalPeriod.start → eventStart (objectType-eventStart-index,
programID-eventStart-index).
sourceraw docstring

WireProgramclj

Malli schema for a stored program (storage canon, keyword keys, ZDT datetimes). GSI fields: programName (programName-index SK).

Malli schema for a stored program (storage canon, keyword keys, ZDT
datetimes). GSI fields: programName (programName-index SK).
sourceraw docstring

WireSubscriptionclj

Malli schema for a stored subscription (storage canon, keyword keys). GSI fields: clientName (query filter), programID (programID-index).

Malli schema for a stored subscription (storage canon, keyword keys).
GSI fields: clientName (query filter), programID (programID-index).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close