1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-16 13:23:47 +00:00
tgbotapi/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt

25 lines
1.1 KiB
Kotlin
Raw Normal View History

2018-12-26 08:07:24 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.requests
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
2019-02-27 06:01:04 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.ALL_UPDATES_LIST
2019-03-15 08:12:17 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
2019-08-17 16:08:36 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.UpdateSerializerWithoutDeserialization
2019-04-13 02:21:19 +00:00
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
2018-12-26 08:07:24 +00:00
import kotlinx.serialization.internal.ArrayListSerializer
@Serializable
data class GetUpdates(
val offset: UpdateIdentifier? = null,// set `last update id + 1` to receive next part of updates
val limit: Int? = null,
val timeout: Int? = null,
2019-02-27 06:01:04 +00:00
val allowed_updates: List<String>? = ALL_UPDATES_LIST
2019-08-17 16:08:36 +00:00
): SimpleRequest<List<Update>> {
2018-12-26 08:07:24 +00:00
override fun method(): String = "getUpdates"
2019-08-17 16:08:36 +00:00
override fun resultDeserializer(): KSerializer<List<Update>> = ArrayListSerializer(
UpdateSerializerWithoutDeserialization
)
2018-12-26 08:07:24 +00:00
}