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

commonMain.io.github.jan.supabase.postgrest.request.UpdateRequest.kt Maven / Gradle / Ivy

The newest version!
package io.github.jan.supabase.postgrest.request

import io.github.jan.supabase.postgrest.query.Count
import io.github.jan.supabase.postgrest.query.Returning
import io.ktor.http.Headers
import io.ktor.http.HttpMethod
import kotlinx.serialization.json.JsonElement

@PublishedApi
internal class UpdateRequest(
    override val returning: Returning = Returning.Minimal,
    private val count: Count? = null,
    override val urlParams: Map,
    override val body: JsonElement,
    override val schema: String,
    override val headers: Headers = Headers.Empty,
) : PostgrestRequest {

    override val method = HttpMethod.Patch
    override val prefer = buildList {
        add("return=${returning.identifier}")
        if (count != null) add("count=${count.identifier}")
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy