TaskBridgeHttpApi

Abstraction for HTTP operations required by the SDK.

This interface decouples the core SDK from specific HTTP clients like OkHttp or Ktor.

Functions

Link copied to clipboard
abstract suspend fun cancelTask(context: Ctx, url: String, body: CancelTaskBody? = null): CancelTaskResponse

Executes a POST request to cancel a task.

Link copied to clipboard
abstract suspend fun createTaskJson(context: Ctx, url: String, body: TaskCreateJsonRequest): TaskCreatedResponse

Executes a POST request to create a task with JSON body.

Link copied to clipboard
abstract suspend fun createTaskMultipart(context: Ctx, url: String, clientRequestId: String, taskType: String, inputJson: String?, metadataJson: String?, attachments: List<TaskBridgeMultipartAttachment>): TaskCreatedResponse

Executes a POST request to create a task with multipart/form-data.

Link copied to clipboard
abstract suspend fun pollEvents(context: Ctx, url: String, afterEventId: String?, waitTimeoutMs: Int, maxEvents: Int): PollEventsResponse

Executes a GET request to poll for events using long-polling.

Link copied to clipboard
abstract suspend fun submitAction(context: Ctx, url: String, body: TaskActionRequest): SubmitActionResponse

Executes a POST request to submit a task action.