SendNetworkRequestEventSchema

@Serializable
@SerialName(value = "SendNetworkRequest")
data class SendNetworkRequestEventSchema(val id: String, val trigger: EventTrigger, val events: SerializableImmutableList<EventSchema>?, val url: String, val method: HttpMethod, val body: AnySerializable?, val headers: Map<String, String>?, val timeoutMillis: Long? = null) : EventSchema

Sends an HTTP request to url with method, headers, body and an optional timeoutMillis, and emits the response downstream. This is the general-purpose way to talk to a backend from inside an event chain.

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

incomingData consumed: not used.

Triggers fired:

  • OnStartEventTrigger — before the request is sent.

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

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

  • OnFailureEventTrigger — when the response is not 2xx and no status-specific event was declared (the parsed body is passed), and whenever the request itself fails — timeout, no connectivity, and so on — in which case the Throwable is passed and the error is logged.

Exactly one of these outcome triggers fires per response.

Constructors

Link copied to clipboard
constructor(id: String, trigger: EventTrigger, events: SerializableImmutableList<EventSchema>?, url: String, method: HttpMethod, body: AnySerializable?, headers: Map<String, String>?, timeoutMillis: Long? = null)

Properties

Link copied to clipboard
@SerialName(value = "body")
val body: AnySerializable?
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 = "timeoutMillis")
val timeoutMillis: Long?
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