1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ResponseParametersRaw.kt

23 lines
657 B
Kotlin
Raw Normal View History

2019-02-05 04:51:52 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.types
2019-12-03 05:07:25 +00:00
import com.soywiz.klock.DateTime
2019-02-05 04:51:52 +00:00
import kotlinx.serialization.*
@Serializable
data class ResponseParametersRaw(
@SerialName("migrate_to_chat_id")
private val migrateToChatId: ChatId? = null,
@SerialName("retry_after")
private val retryAfter: Long? = null
) {
@Transient
2019-12-03 05:07:25 +00:00
private val createTime: Long = DateTime.now().unixMillisLong
2019-02-05 04:51:52 +00:00
val error: RequestError? by lazy {
when {
migrateToChatId != null -> MigrateChatId(migrateToChatId);
retryAfter != null -> RetryAfterError(retryAfter, createTime);
else -> null
}
}
}