RequestFactory
Factory for requests, responses and event sources.
Constructors
Types
Functions
Link copied to clipboard
fun eventSource(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): EventSource
fun <B : Any> eventSource(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): EventSource
Creates an EventSource that uses the provided request parameters to supply the Request used for connecting to the Server-Sent Events stream.
Link copied to clipboard
fun <D : Any> eventStream(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null, decoder: (TextMediaTypeDecoder, String?, String?, String, Logger) -> D?): Flow<D>
fun <B : Any, D : Any> eventStream(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null, decoder: (TextMediaTypeDecoder, String?, String?, String, Logger) -> D?): Flow<D>
Creates an Flow of events that uses the provided request parameters to supply the Request used for connecting to the Server-Sent Events stream.
Link copied to clipboard
Register a type of Problem to allow decoding and throwing specific exception instances of the provided type when returned in server responses.
Link copied to clipboard
inline suspend fun request(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): Request
abstract suspend fun <B : Any> request(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null, purpose: RequestFactory.RequestPurpose = RequestPurpose.Normal): Request
Create a Request.
Link copied to clipboard
inline suspend fun response(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): Response
inline suspend fun <B : Any> response(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): Response
Link copied to clipboard
inline suspend fun <R : Any> result(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): R
inline suspend fun <B : Any, R : Any> result(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): R
suspend fun <B : Any, R : Any> result(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null, resultType: KType): R
Create and execute a request created from the given request parameters and returns a result decoded from the server's response.
Link copied to clipboard
inline suspend fun <R : Any> resultResponse(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): ResultResponse<R>
inline suspend fun <B : Any, R : Any> resultResponse(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null): ResultResponse<R>
suspend fun <B : Any, R : Any> resultResponse(method: Method, pathTemplate: String, pathParameters: Parameters? = null, queryParameters: Parameters? = null, body: B? = null, contentTypes: List<MediaType>? = null, acceptTypes: List<MediaType>? = null, headers: Parameters? = null, resultType: KType): ResultResponse<R>