Endpoint
data class Endpoint(urlParts: EndpointRegion.UrlParts, queryParameters: EndpointRegion.QueryParameters)
Content copied to clipboard
Class representing an endpoint template. Valid template structures:
static text
{var}
-> replace w/ value{{var}}
-> replace w//var/{var}
or&var={var}
if in query params[?var:...]
-> body if var != null, else empty. The body must contain whole segments{{?var}}
->[?var:{{var}}]
Constructors
Link copied to clipboard
fun Endpoint(urlParts: EndpointRegion.UrlParts, queryParameters: EndpointRegion.QueryParameters)
Content copied to clipboard
Types
Functions
Link copied to clipboard
Link copied to clipboard
inline fun fillParameters(transform: (EndpointPart.Parameter) -> String?): Endpoint
Content copied to clipboard
Substitute parameters in this endpoint, without resolving optionals (it maps into all of them)
Link copied to clipboard
Link copied to clipboard
inline fun forEachPart(traverseOptionals: Boolean = true, block: (EndpointPart<*>) -> Unit)
Content copied to clipboard
Call block on each part of the endpoint, traversing down into optionals if traverseOptionals is true.
inline fun forEachPart(noinline traverseOptionals: (String) -> Boolean, block: (EndpointPart<*>) -> Unit)
Content copied to clipboard
Call block on each part of the endpoint, traversing down into optionals if traverseOptionals is true for that optional.
Link copied to clipboard
Include or exclude any optionals depending on if their key is in usedOptionals