1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/WebhookInfo.kt
2019-02-27 14:01:04 +08:00

33 lines
916 B
Kotlin

package com.github.insanusmokrassar.TelegramBotAPI.types
import kotlinx.serialization.*
@Serializable
data class WebhookInfo(
@SerialName(urlField)
val url: String,
@SerialName(pendingUpdateCountField)
val awaitDeliery: Int,
@SerialName(maxAllowedConnectionsField)
@Optional
val maxConnections: Int = 40, // default count according to documentation
@SerialName(hasCustomCertificateField)
@Optional
val customCertificate: Boolean = false,
@SerialName(allowedUpdatesField)
@Optional
val allowedUpdates: List<String> = ALL_UPDATES_LIST,
@SerialName(lastErrorDateField)
@Optional
val lastErrorDate: TelegramDate? = null,
@SerialName(lastErrorMessageField)
@Optional
val lastErrorMessage: String? = null
) {
@Transient
val isNotUseWebhook: Boolean = url.isEmpty()
@Transient
val hasError: Boolean = lastErrorMessage != null
}