BucketApi

sealed interface BucketApi(source)

The api for interacting with a bucket

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val bucketId: String

The id of the bucket

Link copied to clipboard

The client for interacting with the resumable upload api

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun authenticatedRenderUrl(path: String, transform: ImageTransformation.() -> Unit = {}): String

Returns the authenticated render url of path with the given transform

Link copied to clipboard

Can be used if you want to quickly access a file under an url with your auth_token using a custom download method.

Link copied to clipboard
abstract fun authenticatedUrl(path: String): String

Returns the authenticated url of path. Requires bearer token authentication using the user's access token

Link copied to clipboard
abstract suspend fun changePublicStatusTo(public: Boolean)

Changes the bucket's public status to public

Link copied to clipboard
abstract suspend fun copy(from: String, to: String, destinationBucket: String? = null)

Copies a file under from to to

Link copied to clipboard
abstract suspend fun createSignedUploadUrl(path: String, upsert: Boolean = false): UploadSignedUrl

Creates a signed url to upload without authentication. These urls are valid for 2 hours.

Link copied to clipboard
abstract suspend fun createSignedUrl(path: String, expiresIn: Duration, transform: ImageTransformation.() -> Unit = {}): String

Creates a signed url to download without authentication. The url will expire after expiresIn

Link copied to clipboard
open suspend fun createSignedUrls(expiresIn: Duration, vararg paths: String): List<SignedUrl>
abstract suspend fun createSignedUrls(expiresIn: Duration, paths: Collection<String>): List<SignedUrl>

Creates signed urls for all specified paths. The urls will expire after expiresIn

Link copied to clipboard
open suspend fun delete(vararg paths: String)
abstract suspend fun delete(paths: Collection<String>)

Deletes all files in bucketId with in paths

Link copied to clipboard
abstract suspend fun downloadAuthenticated(path: String, options: DownloadOptionBuilder.() -> Unit = {}): ByteArray
abstract suspend fun downloadAuthenticated(path: String, channel: ByteWriteChannel, options: DownloadOptionBuilder.() -> Unit = {})

Downloads a file from bucketId under path

Link copied to clipboard
fun BucketApi.downloadAuthenticatedAsFlow(path: String, channel: ByteWriteChannel, options: DownloadOptionBuilder.() -> Unit = {}): Flow<DownloadStatus>

Downloads a file from BucketApi.bucketId under path

Link copied to clipboard
suspend fun BucketApi.downloadAuthenticatedTo(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {})
suspend fun BucketApi.downloadAuthenticatedTo(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {})

Downloads a file from BucketApi.bucketId under path and saves it to file

Link copied to clipboard
fun BucketApi.downloadAuthenticatedToAsFlow(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {}): Flow<DownloadStatus>
fun BucketApi.downloadAuthenticatedToAsFlow(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {}): Flow<DownloadStatus>

Downloads a file from BucketApi.bucketId under path and saves it to file

Link copied to clipboard
abstract suspend fun downloadPublic(path: String, options: DownloadOptionBuilder.() -> Unit = {}): ByteArray
abstract suspend fun downloadPublic(path: String, channel: ByteWriteChannel, options: DownloadOptionBuilder.() -> Unit = {})

Downloads a file from bucketId under path using the public url

Link copied to clipboard
fun BucketApi.downloadPublicAsFlow(path: String, channel: ByteWriteChannel, options: DownloadOptionBuilder.() -> Unit = {}): Flow<DownloadStatus>

Downloads a file from BucketApi.bucketId under path using the public url

Link copied to clipboard
suspend fun BucketApi.downloadPublicTo(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {})
suspend fun BucketApi.downloadPublicTo(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {})

Downloads a file from BucketApi.bucketId under path and saves it to file

Link copied to clipboard
fun BucketApi.downloadPublicToAsFlow(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {}): Flow<DownloadStatus>
fun BucketApi.downloadPublicToAsFlow(path: String, file: <Error class: unknown class>, options: DownloadOptionBuilder.() -> Unit = {}): Flow<DownloadStatus>

Downloads a file from BucketApi.bucketId under path and saves it to file

Link copied to clipboard
abstract suspend fun list(prefix: String = "", filter: BucketListFilter.() -> Unit = {}): List<FileObject>

Searches for files with the given prefix and filter

Link copied to clipboard
abstract suspend fun move(from: String, to: String, destinationBucket: String? = null)

Moves a file under from to to

Link copied to clipboard
abstract fun publicRenderUrl(path: String, transform: ImageTransformation.() -> Unit = {}): String

Returns the public render url of path with the given transform

Link copied to clipboard
abstract fun publicUrl(path: String): String

Returns the public url of path

Link copied to clipboard
abstract suspend fun update(path: String, data: UploadData, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse
open suspend fun update(path: String, data: ByteArray, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Updates a file in bucketId under path

Link copied to clipboard
suspend fun BucketApi.update(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse
suspend fun BucketApi.update(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Updates a file in BucketApi.bucketId under path

suspend fun BucketApi.update(path: String, uri: Uri, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Updates a file in BucketApi.bucketId under path

Link copied to clipboard
fun BucketApi.updateAsFlow(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): <Error class: unknown class>
fun BucketApi.updateAsFlow(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): <Error class: unknown class>

Updates a file in BucketApi.bucketId under path

fun BucketApi.updateAsFlow(path: String, uri: Uri, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Updates a file in BucketApi.bucketId under path

fun BucketApi.updateAsFlow(path: String, data: UploadData, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Uploads a file in BucketApi.bucketId under path

fun BucketApi.updateAsFlow(path: String, data: ByteArray, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Updates a file in BucketApi.bucketId under path

Link copied to clipboard
abstract suspend fun upload(path: String, data: UploadData, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse
open suspend fun upload(path: String, data: ByteArray, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in bucketId under path

Link copied to clipboard
suspend fun BucketApi.upload(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse
suspend fun BucketApi.upload(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in BucketApi.bucketId under path

suspend fun BucketApi.upload(path: String, uri: Uri, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in BucketApi.bucketId under path

Link copied to clipboard
fun BucketApi.uploadAsFlow(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): <Error class: unknown class>
fun BucketApi.uploadAsFlow(path: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): <Error class: unknown class>

Uploads a file in BucketApi.bucketId under path

fun BucketApi.uploadAsFlow(path: String, uri: Uri, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Uploads a file in BucketApi.bucketId under path

fun BucketApi.uploadAsFlow(path: String, data: UploadData, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Updates a file in BucketApi.bucketId under path

fun BucketApi.uploadAsFlow(path: String, data: ByteArray, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Uploads a file in BucketApi.bucketId under path

Link copied to clipboard
abstract suspend fun uploadToSignedUrl(path: String, token: String, data: UploadData, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in bucketId under path using a presigned url

open suspend fun uploadToSignedUrl(path: String, token: String, data: ByteArray, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in bucketId under path using a pre-signed url

Link copied to clipboard
suspend fun BucketApi.uploadToSignedUrl(path: String, token: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse
suspend fun BucketApi.uploadToSignedUrl(path: String, token: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in BucketApi.bucketId under path using a presigned url

suspend fun BucketApi.uploadToSignedUrl(path: String, token: String, uri: Uri, options: UploadOptionBuilder.() -> Unit = {}): FileUploadResponse

Uploads a file in BucketApi.bucketId under path using a presigned url

Link copied to clipboard
fun BucketApi.uploadToSignedUrlAsFlow(path: String, token: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): <Error class: unknown class>
fun BucketApi.uploadToSignedUrlAsFlow(path: String, token: String, file: <Error class: unknown class>, options: UploadOptionBuilder.() -> Unit = {}): <Error class: unknown class>

Uploads a file in BucketApi.bucketId under path using a presigned url

fun BucketApi.uploadToSignedUrlAsFlow(path: String, token: String, uri: Uri, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Uploads a file in BucketApi.bucketId under path using a presigned url

fun BucketApi.uploadToSignedUrlAsFlow(path: String, token: String, data: UploadData, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>
fun BucketApi.uploadToSignedUrlAsFlow(path: String, token: String, data: ByteArray, options: UploadOptionBuilder.() -> Unit = {}): Flow<UploadStatus>

Uploads a file in BucketApi.bucketId under path using a presigned url