UploadFileEventSchema

@Serializable
@SerialName(value = "UploadFile")
data class UploadFileEventSchema(val id: String, val trigger: EventTrigger, val events: SerializableImmutableList<EventSchema>?, val url: String?, val method: HttpMethod, val headers: Map<String, String>?, val contentType: String?) : EventSchema

Uploads the file carried in the event's incomingData to url with method, headers and contentType, reporting progress as it goes. Pair it with OpenFilePicker or GetFile using their PlatformFile output.

Response shape: a JSON content type is parsed into plain maps, lists and primitives; anything else is passed through as raw bytes. A JSON body that fails to parse yields null.

incomingData consumed: required, and must be a PlatformFile — it is the file uploaded.

Triggers fired:

  • OnStartEventTrigger — after incomingData was validated, before the upload begins.

  • OnUploadProgressEventTrigger — repeatedly while uploading, with the progress passed as incomingData.

  • OnNetworkResponseEventTrigger / OnNetworkFailureEventTrigger — when this event declares an event wired to the response's exact HTTP status: the first for successful statuses, the second for the rest. The parsed body is passed as incomingData.

  • OnSuccessEventTrigger — when the upload succeeded and no status-specific event was declared; the parsed body is passed as incomingData.

  • OnFailureEventTrigger — when incomingData is not a PlatformFile (fired before OnStartEventTrigger, with no data), when the response is unsuccessful and no status-specific event was declared (the parsed body is passed), and when the upload itself fails (the Throwable is passed). Failures are logged.

Constructors

Link copied to clipboard
constructor(id: String, trigger: EventTrigger, events: SerializableImmutableList<EventSchema>?, url: String?, method: HttpMethod, headers: Map<String, String>?, contentType: String?)

Properties

Link copied to clipboard
@SerialName(value = "contentType")
val contentType: String?
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 = "headers")
val headers: Map<String, 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 = "method")
val method: HttpMethod
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.

Link copied to clipboard
@SerialName(value = "url")
val url: String?