commonMain.io.github.jan.supabase.storage.UploadOptionBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of storage-kt-jvm Show documentation
Show all versions of storage-kt-jvm Show documentation
Extends supabase-kt with a Storage Client
package io.github.jan.supabase.storage
import io.github.jan.supabase.SupabaseSerializer
import io.github.jan.supabase.network.HttpRequestOverride
import io.ktor.http.ContentType
/**
* Builder for uploading files with additional options
* @param serializer The serializer to use for encoding the metadata
* @param upsert Whether to update the file if it already exists
* @param contentType The content type of the file. If null, the content type will be inferred from the file extension
*/
class UploadOptionBuilder(
@PublishedApi internal val serializer: SupabaseSerializer,
var upsert: Boolean = false,
var contentType: ContentType? = null,
internal val httpRequestOverrides: MutableList = mutableListOf()
) {
/**
* Overrides the HTTP request
*/
fun httpOverride(override: HttpRequestOverride) {
httpRequestOverrides.add(override)
}
}