com.github.stormbit.vksdk.vkapi.methods.MethodsContext.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vk-bot-sdk-kotlin Show documentation
Show all versions of vk-bot-sdk-kotlin Show documentation
The Kotlin library for working with VK api
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