All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.jan.supabase.storage.UploadOptionBuilder.kt Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
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)
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy