MediaApiClient

Functions

Link copied to clipboard
abstract suspend fun createMedia(): Result<CreateMedia.Response>
Link copied to clipboard
abstract suspend fun <T> download(mxcUri: String, progress: MutableStateFlow<FileTransferProgress?>? = null, timeout: Duration? = null, downloadHandler: suspend (Media) -> T): Result<T>
Link copied to clipboard
abstract suspend fun <T> downloadLegacy(mxcUri: String, allowRemote: Boolean? = null, progress: MutableStateFlow<FileTransferProgress?>? = null, timeout: Duration = Duration.INFINITE, downloadHandler: suspend (Media) -> T): Result<T>
Link copied to clipboard
abstract suspend fun <T> downloadThumbnail(mxcUri: String, width: Long, height: Long, method: ThumbnailResizingMethod, animated: Boolean? = null, progress: MutableStateFlow<FileTransferProgress?>? = null, timeout: Duration? = null, downloadHandler: suspend (Media) -> T): Result<T>
Link copied to clipboard
abstract suspend fun <T> downloadThumbnailLegacy(mxcUri: String, width: Long, height: Long, method: ThumbnailResizingMethod, allowRemote: Boolean? = null, progress: MutableStateFlow<FileTransferProgress?>? = null, timeout: Duration = Duration.INFINITE, downloadHandler: suspend (Media) -> T): Result<T>
Link copied to clipboard
abstract suspend fun getConfig(): Result<GetMediaConfig.Response>
Link copied to clipboard
Link copied to clipboard
abstract suspend fun getUrlPreview(url: String, timestamp: Long? = null): Result<GetUrlPreview.Response>
Link copied to clipboard
abstract suspend fun getUrlPreviewLegacy(url: String, timestamp: Long? = null): Result<GetUrlPreviewLegacy.Response>
Link copied to clipboard
abstract suspend fun upload(media: Media, progress: MutableStateFlow<FileTransferProgress?>? = null, timeout: Duration = Duration.INFINITE): Result<UploadMedia.Response>
abstract suspend fun upload(serverName: String, mediaId: String, media: Media, progress: MutableStateFlow<FileTransferProgress?>? = null, timeout: Duration = Duration.INFINITE): Result<Unit>