Companion

object Companion

Types

Link copied to clipboard
class Builder<Res, ResH>(var status: Int = 200, var body: Res = Unit as Res, var headers: ResH = Empty as ResH, var cookies: List<Cookie> = emptyList())

Functions

Link copied to clipboard
infix fun <Res> Int.withBody(body: Res): ApiResponse<Res, Empty>

Creates an ApiResponse with the given body.

Link copied to clipboard
infix fun <Res> Res.withCookie(cookie: Cookie): ApiResponse<Res, Empty>
infix fun Int.withCookie(cookie: Cookie): ApiResponse<Unit, Empty>

Creates an ApiResponse with the given cookie.

Link copied to clipboard
infix fun <Res> Res.withCookies(cookies: List<Cookie>): ApiResponse<Res, Empty>
fun <Res> Res.withCookies(vararg cookies: Cookie): ApiResponse<Res, Empty>
infix fun Int.withCookies(cookies: List<Cookie>): ApiResponse<Unit, Empty>
fun Int.withCookies(vararg cookies: Cookie): ApiResponse<Unit, Empty>

Creates an ApiResponse with the given cookies.

Link copied to clipboard
infix fun <Res, ResH> Res.withHeaders(headers: ResH): ApiResponse<Res, ResH>
infix fun <ResH> Int.withHeaders(headers: ResH): ApiResponse<Unit, ResH>

Creates an ApiResponse with the given headers.

Link copied to clipboard
infix fun <Res> Res.withStatus(status: Int): ApiResponse<Res, Empty>

Creates an ApiResponse with the given status.