GetFileEventSchema

@Serializable
@SerialName(value = "GetFile")
data class GetFileEventSchema(val id: String, val trigger: EventTrigger, val events: SerializableImmutableList<EventSchema>?, val fileName: String, val outputType: FileOutputType = FileOutputType.ArrayOfBytes) : EventSchema

Reads the file stored under fileName from the client's own file storage and emits its content downstream.

outputType decides the shape handed to the next events:

  • ArrayOfBytes (default) — the raw ByteArray.

  • FlowOfBytes — a streaming flow of chunks, for large files.

  • PlatformFile — the platform file handle.

  • MapObject — the bytes decoded as a JSON map.

  • Base64 — the bytes encoded as a Base64 String.

incomingData consumed: not used.

Triggers fired:

  • OnSuccessEventTrigger — when the file was read; the content, in the shape chosen by outputType, is passed as incomingData.

  • OnFailureEventTrigger — when the read failed, when no file exists under fileName (a NoSuchElementException is passed), or when MapObject decoding failed. The Throwable is passed as incomingData and the error is logged.

Constructors

Link copied to clipboard
constructor(id: String, trigger: EventTrigger, events: SerializableImmutableList<EventSchema>?, fileName: String, outputType: FileOutputType = FileOutputType.ArrayOfBytes)

Properties

Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?

This event's own children — each declaring, via its own trigger, which of this event's outgoing triggers runs it. null when this event declares no children.

Link copied to clipboard
@SerialName(value = "fileName")
val fileName: String
Link copied to clipboard
@SerialName(value = "id")
open override val id: String

Unique identifier — how TriggerEvent/UpdateEvents address this event by id. Defaults to a random id when omitted from the DSL.

Link copied to clipboard
@SerialName(value = "outputType")
val outputType: FileOutputType
Link copied to clipboard
@SerialName(value = "trigger")
open override val trigger: EventTrigger

The condition that must occur for this event to run — matched by structural equality (data class/data object equality) against whatever trigger value fired, never by any kind of subscription or listener registry.