JevResult

The answers to one request. Read them with the handles you declared (result[Triage.department]) or by id (result.noul("urgent")). A missing or mismatched answer raises JevResponseValidationException when it is read; an id or handle that wasn't part of the request raises IllegalArgumentException.

Properties

Link copied to clipboard

Every answer by question id, choices keyed by option string, as the response mapped them. A Box's edges are checked when it is read, through box, a handle or boxes, so one here may break the Box's contract.

Link copied to clipboard

Every Box answer, each checked as box checks one.

Link copied to clipboard
Link copied to clipboard

The model that answered, as reported by the API (falls back to requestedModel).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The parsed response body. A JevResponseValidationException carries the body's text as received.

Link copied to clipboard

The model name that was sent, possibly an alias such as jev-latest.

Link copied to clipboard

The x-typesafe-request-id response header.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun box(id: String): BoxAnswer
Link copied to clipboard

Reads a Choice by id, keyed by option string. The chosen option is returned as the server sent it, even one the question didn't declare, as both official SDKs do; enumChoice rejects one, since it has no constant for it.

Link copied to clipboard
inline fun <E : Enum<E>> enumChoice(id: String): ChoiceAnswer<E>

Reads a Choice by id as constants of E. E must have a constant for every option the question declared, else this is a mistake in the calling code, reported as IllegalArgumentException. An option the server returns that the question never declared is a JevResponseValidationException.

Link copied to clipboard
operator fun <A : Answer> get(ref: QuestionRef<A>): A
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String