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

com.github.stormbit.vksdk.vkapi.methods.MethodsContext.kt Maven / Gradle / Ivy

The newest version!
package com.github.stormbit.vksdk.vkapi.methods

import com.github.stormbit.vksdk.clients.Client
import com.github.stormbit.vksdk.vkapi.VkApiRequest
import io.ktor.http.*
import kotlinx.serialization.KSerializer
import kotlinx.serialization.serializer

abstract class MethodsContext(private val client: Client) {
    fun  String.call(
        serializer: KSerializer,
        block: ParametersBuilder.() -> Unit = {}
    ) = VkApiRequest(
        client,
        HttpMethod.Get,
        this,
        Parameters.build(block),
        serializer
    )

    inline fun  String.call(
        noinline block: ParametersBuilder.() -> Unit = {}
    ): VkApiRequest {
        return call(serializer(), block)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy