MatrixClientServerApiHttpClient

class MatrixClientServerApiHttpClient(baseUrl: Url? = null, eventContentSerializerMappings: EventContentSerializerMappings = DefaultEventContentSerializerMappings, json: Json = createMatrixEventJson(eventContentSerializerMappings), accessToken: MutableStateFlow<String?>, onLogout: suspend (isSoft: Boolean) -> Unit = {}, httpClientFactory: (HttpClientConfig<*>.() -> Unit) -> HttpClient = { HttpClient(it) }) : MatrixApiClient

Constructors

Link copied to clipboard
constructor(baseUrl: Url? = null, eventContentSerializerMappings: EventContentSerializerMappings = DefaultEventContentSerializerMappings, json: Json = createMatrixEventJson(eventContentSerializerMappings), accessToken: MutableStateFlow<String?>, onLogout: suspend (isSoft: Boolean) -> Unit = {}, httpClientFactory: (HttpClientConfig<*>.() -> Unit) -> HttpClient = { HttpClient(it) })

Properties

Link copied to clipboard
val baseClient: HttpClient
Link copied to clipboard
val contentMappings: EventContentSerializerMappings
Link copied to clipboard
val json: Json

Functions

Link copied to clipboard
open suspend override fun onErrorResponse(response: HttpResponse, errorResponse: ErrorResponse)
Link copied to clipboard
inline suspend fun <ENDPOINT : MatrixEndpoint<Unit, RESPONSE>, RESPONSE> request(endpoint: ENDPOINT, requestBuilder: HttpRequestBuilder.() -> Unit): Result<RESPONSE>
inline suspend fun <ENDPOINT : MatrixEndpoint<REQUEST, RESPONSE>, REQUEST, RESPONSE> request(endpoint: ENDPOINT, body: REQUEST, requestBuilder: HttpRequestBuilder.() -> Unit): Result<RESPONSE>
Link copied to clipboard
inline suspend fun <ENDPOINT : MatrixUIAEndpoint<Unit, RESPONSE>, RESPONSE> uiaRequest(endpoint: ENDPOINT, noinline requestBuilder: HttpRequestBuilder.() -> Unit = {}): Result<UIA<RESPONSE>>
inline suspend fun <ENDPOINT : MatrixUIAEndpoint<REQUEST, RESPONSE>, REQUEST, RESPONSE> uiaRequest(endpoint: ENDPOINT, requestBody: REQUEST, noinline requestBuilder: HttpRequestBuilder.() -> Unit = {}): Result<UIA<RESPONSE>>