1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

remove optional

This commit is contained in:
InsanusMokrassar 2019-04-13 09:38:25 +08:00
parent ddd7425033
commit c40e857a23
102 changed files with 0 additions and 407 deletions

View File

@ -1,16 +1,11 @@
package com.github.insanusmokrassar.TelegramBotAPI.bot.settings
import kotlinx.serialization.Optional
import kotlinx.serialization.Serializable
@Serializable
data class ProxySettings(
@Optional
val host: String = "localhost",
@Optional
val port: Int = 1080,
@Optional
val username: String? = null,
@Optional
val password: String? = null
)

View File

@ -14,13 +14,9 @@ private object CompleteRequest : RequestEvent()
@Serializable
data class PowLimiter(
@Optional
private val minAwaitTime: Long = 0L,
@Optional
private val maxAwaitTime: Long = 10000L,
@Optional
private val powValue: Double = 4.0,
@Optional
private val powK: Double = 0.0016
) : RequestLimiter {
@Transient

View File

@ -14,7 +14,6 @@ data class ForwardMessage(
@SerialName(messageIdField)
val messageId: MessageIdentifier,
@SerialName(disableNotificationField)
@Optional
val disableNotification: Boolean = false
): SimpleRequest<RawMessage> {
override fun method(): String = "forwardMessage"

View File

@ -28,13 +28,9 @@ const val UPDATE_PRE_CHECKOUT_QUERY = com.github.insanusmokrassar.TelegramBotAPI
@Serializable
data class GetUpdates(
@Optional
val offset: UpdateIdentifier? = null,// set `last update id + 1` to receive next part of updates
@Optional
val limit: Int? = null,
@Optional
val timeout: Int? = null,
@Optional
val allowed_updates: List<String>? = ALL_UPDATES_LIST
): SimpleRequest<List<RawUpdate>> {
override fun method(): String = "getUpdates"

View File

@ -11,16 +11,12 @@ data class AnswerCallbackQuery(
@SerialName(callbackQueryIdField)
val callbackQueryId: CallbackQueryIdentifier,
@SerialName(textField)
@Optional
val text: String? = null,
@SerialName(showAlertField)
@Optional
val showAlert: Boolean? = null,
@SerialName(urlField)
@Optional
val url: String? = null,
@SerialName(cachedTimeField)
@Optional
val cachedTimeSeconds: Int? = null
) : SimpleRequest<Boolean> {
override fun method(): String = "answerCallbackQuery"

View File

@ -17,19 +17,14 @@ data class AnswerInlineQuery(
@SerialName(resultsField)
val results: List<InlineQueryResult> = emptyList(),
@SerialName(cachedTimeField)
@Optional
val cachedTime: Int? = null,
@SerialName(isPersonalField)
@Optional
val isPersonal: Boolean? = null,
@SerialName(nextOffsetField)
@Optional
val nextOffset: String? = null,
@SerialName(switchPmTextField)
@Optional
val switchPmText: String? = null,
@SerialName(switchPmParameterField)
@Optional
val switchPmParameter: String? = null
): SimpleRequest<Boolean> {
override fun method(): String = "answerInlineQuery"

View File

@ -13,7 +13,6 @@ data class KickChatMember(
@SerialName(userIdField)
override val userId: UserId,
@SerialName(untilDateField)
@Optional
override val untilDate: TelegramDate? = null
) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "kickChatMember"

View File

@ -13,31 +13,22 @@ data class PromoteChatMember(
@SerialName(userIdField)
override val userId: UserId,
@SerialName(untilDateField)
@Optional
override val untilDate: TelegramDate? = null,
@SerialName(canChangeInfoField)
@Optional
private val canChangeInfo: Boolean? = null,
@SerialName(canPostMessagesField)
@Optional
private val canPostMessages: Boolean? = null,
@SerialName(canEditMessagesField)
@Optional
private val canEditMessages: Boolean? = null,
@SerialName(canDeleteMessagesField)
@Optional
private val canDeleteMessages: Boolean? = null,
@SerialName(canInviteUsersField)
@Optional
private val canInviteUsers: Boolean? = null,
@SerialName(canRestrictMembersField)
@Optional
private val canRestrictMembers: Boolean? = null,
@SerialName(canPinMessagesField)
@Optional
private val canPinMessages: Boolean? = null,
@SerialName(canPromoteMembersField)
@Optional
private val canPromoteMembers: Boolean? = null
) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "promoteChatMember"

View File

@ -13,19 +13,14 @@ data class RestrictChatMember(
@SerialName(userIdField)
override val userId: UserId,
@SerialName(untilDateField)
@Optional
override val untilDate: TelegramDate? = null,
@SerialName(canSendMessagesField)
@Optional
private val canSendMessages: Boolean? = null,
@SerialName(canSendMediaMessagesField)
@Optional
private val canSendMediaMessages: Boolean? = null,
@SerialName(canSendOtherMessagesField)
@Optional
private val canSendOtherMessages: Boolean? = null,
@SerialName(canAddWebPagePreviewsField)
@Optional
private val canAddWebPagePreviews: Boolean? = null
) : ChatMemberRequest<Boolean>, UntilDate {
override fun method(): String = "restrictChatMember"

View File

@ -14,7 +14,6 @@ data class PinChatMessage (
@SerialName(messageIdField)
val messageId: MessageIdentifier,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false
): ChatRequest, SimpleRequest<Boolean>, DisableNotification {
override fun method(): String = "pinChatMessage"

View File

@ -17,7 +17,6 @@ data class EditChatMessageLiveLocation(
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditReplyMessage, EditLocationMessage {
override fun method(): String = "editMessageLiveLocation"

View File

@ -14,7 +14,6 @@ data class EditInlineMessageLiveLocation(
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage, EditLocationMessage {
override fun method(): String = "editMessageLiveLocation"

View File

@ -14,7 +14,6 @@ data class StopChatMessageLiveLocation(
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditReplyMessage {
override fun method(): String = "stopMessageLiveLocation"

View File

@ -11,7 +11,6 @@ data class StopInlineMessageLiveLocation(
@SerialName(inlineMessageIdField)
override val inlineMessageId: InlineMessageIdentifier,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage {
override fun method(): String = "stopMessageLiveLocation"

View File

@ -16,7 +16,6 @@ data class EditChatMessageReplyMarkup(
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditReplyMessage {

View File

@ -11,7 +11,6 @@ data class EditInlineMessageReplyMarkup(
@SerialName(inlineMessageIdField)
override val inlineMessageId: InlineMessageIdentifier,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage {
override fun method(): String = editMessageReplyMarkupMethod

View File

@ -19,10 +19,8 @@ data class EditChatMessageCaption(
@SerialName(captionField)
override val text: String,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditTextChatMessage, EditReplyMessage {

View File

@ -14,10 +14,8 @@ data class EditInlineMessageCaption(
@SerialName(captionField)
override val text: String,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage {
override fun method(): String = editMessageCaptionMethod

View File

@ -19,7 +19,6 @@ data class EditChatMessageMedia(
@SerialName(mediaField)
override val media: InputMedia,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditReplyMessage, EditMediaMessage {

View File

@ -14,7 +14,6 @@ data class EditInlineMessageMedia(
@SerialName(mediaField)
override val media: InputMedia,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditReplyMessage, EditMediaMessage {

View File

@ -19,13 +19,10 @@ data class EditChatMessageText(
@SerialName(textField)
override val text: String,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(disableWebPagePreviewField)
@Optional
override val disableWebPagePreview: Boolean? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditChatMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage {

View File

@ -15,13 +15,10 @@ data class EditInlineMessageText(
@SerialName(textField)
override val text: String,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(disableWebPagePreviewField)
@Optional
override val disableWebPagePreview: Boolean? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditDisableWebPagePreviewMessage {
override fun method(): String = editMessageMediaMethod

View File

@ -16,9 +16,7 @@ data class SetGameScoreByChatId (
@SerialName(messageIdField)
override val messageId: MessageIdentifier,
@SerialName(forceField)
@Optional
override val force: Boolean = false,
@SerialName(disableEditMessageField)
@Optional
override val disableEditMessage: Boolean = false
) : SetGameScore, ByMessageId

View File

@ -14,9 +14,7 @@ data class SetGameScoreByInlineMessageId (
@SerialName(inlineMessageIdField)
override val inlineMessageId: InlineMessageIdentifier,
@SerialName(forceField)
@Optional
override val force: Boolean = false,
@SerialName(disableEditMessageField)
@Optional
override val disableEditMessage: Boolean = false
) : SetGameScore, ByInlineMessageId

View File

@ -16,16 +16,12 @@ data class SendContact(
@SerialName(firstNameField)
val firstName: String,
@SerialName(lastNameField)
@Optional
val lastName: String? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<RawMessage>,
ReplyingMarkupSendMessageRequest<RawMessage>

View File

@ -16,16 +16,12 @@ data class SendLocation(
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(livePeriodField)
@Optional
val livePeriod: Long? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<RawMessage>,
ReplyingMarkupSendMessageRequest<RawMessage>,

View File

@ -16,19 +16,14 @@ data class SendMessage(
@SerialName(textField)
override val text: String,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(disableWebPagePreviewField)
@Optional
override val disableWebPagePreview: Boolean? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<RawMessage>,
ReplyingMarkupSendMessageRequest<RawMessage>,

View File

@ -19,16 +19,12 @@ data class SendVenue(
@SerialName(addressField)
val address: String,
@SerialName(foursquareIdField)
@Optional
val foursquareId: String? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<RawMessage>,
PositionedSendMessageRequest<RawMessage>,

View File

@ -14,13 +14,10 @@ data class SendGame (
@SerialName(gameShortNameField)
val gameShortName: String,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<RawMessage>,
ReplyMarkup {

View File

@ -58,34 +58,24 @@ data class SendAnimationData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(animationField)
@Optional
val animation: String? = null,
@SerialName(thumbField)
@Optional
override val thumb: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Long? = null,
@SerialName(widthField)
@Optional
override val width: Int? = null,
@SerialName(heightField)
@Optional
override val height: Int? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -59,34 +59,24 @@ data class SendAudioData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(audioField)
@Optional
val audio: String? = null,
@SerialName(thumbField)
@Optional
override val thumb: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Long? = null,
@SerialName(performerField)
@Optional
override val performer: String? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -52,25 +52,18 @@ data class SendDocumentData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(documentField)
@Optional
val document: String? = null,
@SerialName(thumbField)
@Optional
override val thumb: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -61,10 +61,8 @@ data class SendMediaGroupData internal constructor(
@Transient
val media: List<MediaGroupMemberInputMedia> = emptyList(),
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null
) : DataRequest<List<RawMessage>>,
SendMessageRequest<List<RawMessage>>

View File

@ -41,22 +41,16 @@ data class SendPhotoData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(photoField)
@Optional
val photo: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -34,16 +34,12 @@ data class SendStickerByFileId internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(stickerField)
@Optional
val sticker: FileId? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : SendMessageRequest<RawMessage>, ReplyingMarkupSendMessageRequest<RawMessage> {
override fun method(): String = "sendSticker"

View File

@ -60,37 +60,26 @@ data class SendVideoData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(videoField)
@Optional
val video: String? = null,
@SerialName(thumbField)
@Optional
override val thumb: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Long? = null,
@SerialName(widthField)
@Optional
override val width: Int? = null,
@SerialName(heightField)
@Optional
override val height: Int? = null,
@SerialName(supportStreamingField)
@Optional
val supportStreaming: Boolean? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -56,31 +56,22 @@ data class SendVideoNoteData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(videoNoteField)
@Optional
val videoNote: String? = null,
@SerialName(thumbField)
@Optional
override val thumb: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Long? = null,
@SerialName(lengthField)
@Optional
override val width: Int? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -54,28 +54,20 @@ data class SendVoiceData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(voiceField)
@Optional
val voice: String? = null,
@SerialName(thumbField)
@Optional
override val thumb: String? = null,
@SerialName(captionField)
@Optional
override val text: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(durationField)
@Optional
override val duration: Long? = null,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<RawMessage>,
SendMessageRequest<RawMessage>,

View File

@ -9,7 +9,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.payments.LabeledPrice
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.LabeledPricesSerializer
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.abstracts.*
import kotlinx.serialization.*
import kotlinx.serialization.Optional
import java.util.*
/**
@ -36,37 +35,26 @@ data class SendInvoice(
@SerialName(pricesField)
override val prices: List<LabeledPrice>,
@SerialName(providerDataField)
@Optional
val providerData: String? = null,
@SerialName(requireNameField)
@Optional
val requireName: Boolean = false,
@SerialName(requirePhoneNumberField)
@Optional
val requirePhoneNumber: Boolean = false,
@SerialName(requireEmailField)
@Optional
val requireEmail: Boolean = false,
@SerialName(requireShippingAddressField)
@Optional
val requireShippingAddress: Boolean = false,
@SerialName(shouldSendPhoneNumberToProviderField)
@Optional
val shouldSendPhoneNumberToProvider: Boolean = false,
@SerialName(shouldSendEmailToProviderField)
@Optional
val shouldSendEmailToProvider: Boolean = false,
@SerialName(priceDependOnShipAddressField)
@Optional
val priceDependOnShipAddress: Boolean = false,
@SerialName(disableNotificationField)
@Optional
override val disableNotification: Boolean = false,
@SerialName(replyToMessageIdField)
@Optional
override val replyToMessageId: MessageIdentifier? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null
) : Currencied,
Priced,

View File

@ -33,10 +33,8 @@ data class AddStickerToSet internal constructor(
@SerialName(emojisField)
override val emojis: String,
@SerialName(pngStickerField)
@Optional
val sticker: FileId? = null,
@SerialName(maskPositionField)
@Optional
override val maskPosition: MaskPosition? = null
) : StickerSetAction {
init {

View File

@ -34,13 +34,10 @@ data class CreateNewStickerSet internal constructor(
@SerialName(emojisField)
override val emojis: String,
@SerialName(pngStickerField)
@Optional
val sticker: FileId? = null,
@SerialName(containsMasksField)
@Optional
val containsMasks: Boolean? = null,
@SerialName(maskPositionField)
@Optional
override val maskPosition: MaskPosition? = null
) : StickerSetAction {
init {

View File

@ -44,13 +44,10 @@ data class SetWebhook internal constructor(
@SerialName(urlField)
val url: String,
@SerialName(certificateField)
@Optional
val certificateFile: String? = null,
@SerialName(maxAllowedConnectionsField)
@Optional
val maxAllowedConnections: Int? = null,
@SerialName(allowedUpdatesField)
@Optional
val allowedUpdates: List<String>? = null
) : DataRequest<Boolean> {
override fun method(): String = "setWebhook"

View File

@ -10,17 +10,13 @@ data class RawCallbackQuery(
val id: CallbackQueryIdentifier,
@SerialName(fromField)
val from: User,
@Optional
val message: RawMessage? = null,
@SerialName(inlineMessageIdField)
@Optional
val inlineMessageId: InlineMessageIdentifier? = null,
@SerialName("chat_instance")
val chatInstance: String,
@Optional
val data: String? = null,
@SerialName("game_short_name")
@Optional
val gameShortName: String? = null
) {
@Transient

View File

@ -7,46 +7,32 @@ import kotlinx.serialization.*
data class RawChatMember(
val user: User,
private val status: String,
@Optional
private val until_date: TelegramDate? = null,
@SerialName(canBeEditedField)
@Optional
private val canBeEdited: Boolean = false,
@SerialName(canChangeInfoField)
@Optional
private val canChangeInfo: Boolean = false,
@SerialName(canPostMessagesField)
@Optional
private val canPostMessages: Boolean = false,
@SerialName(canEditMessagesField)
@Optional
private val canEditMessages: Boolean = false,
@SerialName(canDeleteMessagesField)
@Optional
private val canDeleteMessages: Boolean = false,
@SerialName(canInviteUsersField)
@Optional
private val canInviteUsers: Boolean = false,
@SerialName(canRestrictMembersField)
@Optional
private val canRestrictMembers: Boolean = false,
@SerialName(canPinMessagesField)
@Optional
private val canPinMessages: Boolean = false,
@SerialName(canPromoteMembersField)
@Optional
private val canPromoteMembers: Boolean = false,
@SerialName(canSendMessagesField)
@Optional
private val canSendMessages: Boolean = false,
@SerialName(canSendMediaMessagesField)
@Optional
private val canSendMediaMessages: Boolean = false,
@SerialName(canSendOtherMessagesField)
@Optional
private val canSendOtherMessages: Boolean = false,
@SerialName(canAddWebPagePreviewsField)
@Optional
private val canAddWebPagePreviews: Boolean = false
) {
@Transient

View File

@ -10,12 +10,9 @@ data class Contact(
@SerialName(firstNameField)
override val firstName: String,
@SerialName(lastNameField)
@Optional
override val lastName: String? = null,
@SerialName(userIdField)
@Optional
val userId: UserId? = null,
@SerialName(vcardField)
@Optional
override val vcard: String? = null
) : CommonContactData

View File

@ -13,10 +13,8 @@ data class RawChosenInlineResult(
@SerialName(queryField)
val query: String,
@SerialName(locationField)
@Optional
val location: Location? = null,
@SerialName(inlineMessageIdField)
@Optional
val inlineMessageId: InlineMessageIdentifier? = null
) {
@Transient

View File

@ -15,25 +15,18 @@ class InlineQueryResultArticle(
@SerialName(inputMessageContentField)
override val inputMessageContent: InputMessageContent,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(urlField)
@Optional
override val url: String? = null,
@SerialName(hideUrlField)
@Optional
val hideUrl: Boolean? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null
) : InlineQueryResult,
ThumbSizedInlineQueryResult,

View File

@ -17,16 +17,12 @@ data class InlineQueryResultAudioCachedImpl(
@SerialName(audioFileIdField)
override val fileId: FileId,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultAudioCached {
override val type: String = inlineQueryResultAudioType

View File

@ -18,22 +18,16 @@ data class InlineQueryResultAudioImpl(
@SerialName(titleField)
override val title: String,
@SerialName(performerField)
@Optional
override val performer: String? = null,
@SerialName(audioDurationField)
@Optional
override val duration: Int? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultAudio {
override val type: String = inlineQueryResultAudioType

View File

@ -16,25 +16,18 @@ data class InlineQueryResultContact(
@SerialName(firstNameField)
override val firstName: String,
@SerialName(lastNameField)
@Optional
override val lastName: String? = null,
@SerialName(vcardField)
@Optional
override val vcard: String? = null,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult,
CommonContactData,

View File

@ -19,19 +19,14 @@ data class InlineQueryResultDocumentCachedImpl(
@SerialName(titleField)
override val title: String,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultDocumentCached {
override val type: String = inlineQueryResultDocumentType

View File

@ -21,28 +21,20 @@ data class InlineQueryResultDocumentImpl(
@SerialName(mimeTypeField)
override val mimeType: String,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultDocument {
override val type: String = inlineQueryResultDocumentType

View File

@ -17,19 +17,14 @@ data class InlineQueryResultGifCachedImpl(
@SerialName(gifFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultGifCached {
override val type: String = inlineQueryResultGifType

View File

@ -18,28 +18,20 @@ data class InlineQueryResultGifImpl(
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(gifWidthField)
@Optional
override val width: Int? = null,
@SerialName(gifHeightField)
@Optional
override val height: Int? = null,
@SerialName(gifDurationField)
@Optional
override val duration: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultGif {
override val type: String = inlineQueryResultGifType

View File

@ -19,22 +19,16 @@ data class InlineQueryResultLocation(
@SerialName(titleField)
override val title: String,
@SerialName(livePeriodField)
@Optional
override val livePeriod: Int? = null,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult,
Locationed,

View File

@ -17,19 +17,14 @@ data class InlineQueryResultMpeg4GifCachedImpl(
@SerialName(mpeg4GifFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultMpeg4GifCached {
override val type: String = inlineQueryResultMpeg4GifType

View File

@ -18,28 +18,20 @@ data class InlineQueryResultMpeg4GifImpl(
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(mpeg4GifWidthField)
@Optional
override val width: Int? = null,
@SerialName(mpeg4GifHeightField)
@Optional
override val height: Int? = null,
@SerialName(mpeg4GifDurationField)
@Optional
override val duration: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultMpeg4Gif {
override val type: String = inlineQueryResultMpeg4GifType

View File

@ -17,22 +17,16 @@ data class InlineQueryResultPhotoCachedImpl(
@SerialName(photoFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultPhotoCached {
override val type: String = inlineQueryResultPhotoType

View File

@ -18,28 +18,20 @@ data class InlineQueryResultPhotoImpl(
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(photoWidthField)
@Optional
override val width: Int? = null,
@SerialName(photoHeightField)
@Optional
override val height: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultPhoto {
override val type: String = inlineQueryResultPhotoType

View File

@ -14,10 +14,8 @@ data class InlineQueryResultStickerCached(
@SerialName(stickerFileIdField)
override val fileId: FileId,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult, WithInputMessageContentInlineQueryResult, WithFileIdInlineQueryResult {
override val type: String = "sticker"

View File

@ -21,25 +21,18 @@ data class InlineQueryResultVenue(
@SerialName(addressField)
override val address: String,
@SerialName(foursquareIdField)
@Optional
override val foursquareId: String? = null,
@SerialName(foursquareTypeField)
@Optional
override val foursquareType: String? = null,
@SerialName(thumbUrlField)
@Optional
override val thumbUrl: String? = null,
@SerialName(thumbWidthField)
@Optional
override val thumbWidth: Int? = null,
@SerialName(thumbHeightField)
@Optional
override val thumbHeight: Int? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResult,
Locationed,

View File

@ -19,19 +19,14 @@ data class InlineQueryResultVideoCachedImpl(
@SerialName(titleField)
override val title: String,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVideoCached {
override val type: String = inlineQueryResultVideoType

View File

@ -23,28 +23,20 @@ data class InlineQueryResultVideoImpl(
@SerialName(titleField)
override val title: String,
@SerialName(videoWidthField)
@Optional
override val width: Int? = null,
@SerialName(videoHeightField)
@Optional
override val height: Int? = null,
@SerialName(videoDurationField)
@Optional
override val duration: Int? = null,
@SerialName(descriptionField)
@Optional
override val description: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVideo {
override val type: String = inlineQueryResultVideoType

View File

@ -19,16 +19,12 @@ data class InlineQueryResultVoiceCachedImpl(
@SerialName(titleField)
override val title: String,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVoiceCached {
override val type: String = inlineQueryResultVoiceType

View File

@ -18,19 +18,14 @@ data class InlineQueryResultVoiceImpl(
@SerialName(titleField)
override val title: String,
@SerialName(voiceDurationField)
@Optional
override val duration: Int? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVoice {
override val type: String = inlineQueryResultVoiceType

View File

@ -12,9 +12,7 @@ data class InputContactMessageContent(
@SerialName(firstNameField)
override val firstName: String,
@SerialName(lastNameField)
@Optional
override val lastName: String? = null,
@SerialName(vcardField)
@Optional
override val vcard: String? = null
) : CommonContactData, InputMessageContent

View File

@ -13,6 +13,5 @@ data class InputLocationMessageContent(
@SerialName(longitudeField)
override val longitude: Double,
@SerialName(livePeriodField)
@Optional
override val livePeriod: Int? = null
) : Locationed, Livable, InputMessageContent

View File

@ -14,9 +14,7 @@ data class InputTextMessageContent(
@SerialName(messageTextField)
override val caption: String,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(disableWebPagePreviewField)
@Optional
override val disableWebPagePreview: Boolean? = null
) : Captioned, DisableWebPagePreview, InputMessageContent

View File

@ -17,9 +17,7 @@ data class InputVenueMessageContent(
@SerialName(addressField)
override val address: String,
@SerialName(foursquareIdField)
@Optional
override val foursquareId: String? = null,
@SerialName(foursquareTypeField)
@Optional
override val foursquareType: String? = null
) : Locationed, CommonVenueData, InputMessageContent

View File

@ -14,7 +14,6 @@ data class RawInlineQuery(
@SerialName(offsetField)
val offset: String,
@SerialName(locationField)
@Optional
val location: Location? = null
) {
@Transient

View File

@ -10,16 +10,11 @@ import kotlinx.serialization.*
data class InputMediaAnimation(
@Transient
override val file: InputFile = throw IllegalStateException("Must be created with file"),
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@Optional
override val width: Int? = null,
@Optional
override val height: Int? = null,
@Optional
override val duration: Long? = null,
@Transient
override val thumb: InputFile? = null

View File

@ -11,16 +11,11 @@ import kotlinx.serialization.*
data class InputMediaAudio(
@Transient
override val file: InputFile = throw IllegalStateException("Must be created with file"),
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@Optional
override val duration: Long? = null,
@Optional
override val performer: String? = null,
@Optional
override val title: String? = null,
override val thumb: InputFile? = null
) : InputMedia, DuratedInputMedia, ThumbedInputMedia, TitledInputMedia, CaptionedInputMedia, Performerable {

View File

@ -10,10 +10,8 @@ import kotlinx.serialization.*
data class InputMediaDocument(
@Transient
override val file: InputFile = throw IllegalStateException("Must be created with file"),
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@Transient
override val thumb: InputFile? = null

View File

@ -11,10 +11,8 @@ import kotlinx.serialization.*
data class InputMediaPhoto(
@Transient
override val file: InputFile = throw IllegalStateException("Must be created with file"),
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null
) : InputMedia, CaptionedInputMedia, MediaGroupMemberInputMedia {
override val type: String = "photo"

View File

@ -10,16 +10,11 @@ import kotlinx.serialization.*
data class InputMediaVideo(
@Transient
override val file: InputFile = throw IllegalStateException("Must be created with file"),
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@Optional
override val width: Int? = null,
@Optional
override val height: Int? = null,
@Optional
override val duration: Long? = null,
@Transient
override val thumb: InputFile? = null

View File

@ -9,9 +9,7 @@ data class RawMessageEntity(
val type: String,
val offset: Int,
val length: Int,
@Optional
val url: String? = null,
@Optional
val user: User? = null
) {
fun asMessageEntity(source: String): MessageEntity {

View File

@ -11,13 +11,9 @@ typealias ResponseParameters<T> = Response<T>
@Serializable
data class Response<T : Any>(
val ok: Boolean = false,
@Optional
val description: String? = null,
@SerialName("error_code")
@Optional
val errorCode: Int? = null,
@Optional
val result: T? = null,
@Optional
val parameters: ResponseParametersRaw? = null
)

View File

@ -5,10 +5,8 @@ import kotlinx.serialization.*
@Serializable
data class ResponseParametersRaw(
@SerialName("migrate_to_chat_id")
@Optional
private val migrateToChatId: ChatId? = null,
@SerialName("retry_after")
@Optional
private val retryAfter: Long? = null
) {
@Transient

View File

@ -1,25 +1,20 @@
package com.github.insanusmokrassar.TelegramBotAPI.types
import kotlinx.serialization.*
import kotlinx.serialization.Optional
import java.util.*
@Serializable
data class User(
val id: ChatId,
@SerialName(isBotField)
@Optional
val isBot: Boolean = false,
@SerialName(firstNameField)
val firstName: String,
@SerialName(lastNameField)
@Optional
val lastName: String? = null,
@SerialName(usernameField)
@Optional
val username: Username? = null,
@SerialName(languageCodeField)
@Optional
private val languageCode: String? = null
) {
@Transient

View File

@ -12,9 +12,7 @@ data class Venue(
@SerialName(addressField)
override val address: String,
@SerialName(foursquareIdField)
@Optional
override val foursquareId: String? = null,
@SerialName(foursquareTypeField)
@Optional
override val foursquareType: String? = null
) : CommonVenueData

View File

@ -9,19 +9,14 @@ data class WebhookInfo(
@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

View File

@ -4,7 +4,6 @@ import kotlinx.serialization.*
@Serializable
data class ForceReply(
@Optional
val selective: Boolean? = null
) : KeyboardMarkup {
@SerialName("force_reply")

View File

@ -6,9 +6,7 @@ import kotlinx.serialization.*
data class KeyboardButton(
val text: String,
@SerialName("request_contact")
@Optional
val requestContact: Boolean? = null,
@SerialName("request_location")
@Optional
val requestLocation: Boolean? = null
)

View File

@ -6,11 +6,8 @@ import kotlinx.serialization.*
data class ReplyKeyboardMarkup(
val keyboard: Matrix<KeyboardButton>,
@SerialName("resize_keyboard")
@Optional
val resizeKeyboard: Boolean? = null,
@SerialName("one_time_keyboard")
@Optional
val oneTimeKeyboard: Boolean? = null,
@Optional
val selective: Boolean? = null
) : KeyboardMarkup

View File

@ -4,7 +4,6 @@ import kotlinx.serialization.*
@Serializable
data class ReplyKeyboardRemove(
@Optional
val selective: Boolean? = null
) : KeyboardMarkup {
@SerialName("remove_keyboard")

View File

@ -10,17 +10,12 @@ data class AnimationFile(
override val fileId: FileId,
override val width: Int,
override val height: Int,
@Optional
override val duration: Long? = null,
@Optional
override val thumb: PhotoSize? = null,
@SerialName(fileNameField)
@Optional
override val fileName: String? = null,
@SerialName(mimeTypeField)
@Optional
override val mimeType: String? = null,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, CustomNamedMediaFile, SizedMediaFile

View File

@ -9,18 +9,12 @@ import kotlinx.serialization.*
data class AudioFile(
@SerialName(fileIdField)
override val fileId: FileId,
@Optional
override val duration: Long? = null,
@Optional
override val performer: String? = null,
@Optional
override val title: String? = null,
@SerialName(mimeTypeField)
@Optional
override val mimeType: String? = null,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null,
@Optional
override val thumb: PhotoSize? = null
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile, Performerable

View File

@ -9,14 +9,10 @@ data class DocumentFile(
@SerialName(fileIdField)
override val fileId: FileId,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null,
@Optional
override val thumb: PhotoSize? = null,
@SerialName(mimeTypeField)
@Optional
override val mimeType: String? = null,
@SerialName(fileNameField)
@Optional
override val fileName: String? = null
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, CustomNamedMediaFile

View File

@ -9,6 +9,5 @@ data class File(
@SerialName(fileIdField)
override val fileId: FileId,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
): TelegramMediaFile

View File

@ -11,7 +11,6 @@ data class PathedFile(
@SerialName(filePathField)
val filePath: String,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
): TelegramMediaFile

View File

@ -20,7 +20,6 @@ data class PhotoSize(
@SerialName(fileIdField)
override val fileId: FileId,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null,
override val width: Int,
override val height: Int

View File

@ -15,18 +15,13 @@ data class Sticker(
@SerialName(heightField)
override val height: Int,
@SerialName(thumbField)
@Optional
override val thumb: PhotoSize? = null,
@SerialName(emojiField)
@Optional
val emoji: String? = null,
@SerialName(stickerSetNameField)
@Optional
val stickerSetName: String? = null,
@SerialName(maskPositionField)
@Optional
val maskPosition: MaskPosition? = null,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
) : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile

View File

@ -9,9 +9,7 @@ data class TelegramFile(
@SerialName(fileIdField)
override val fileId: FileId,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null,
@SerialName("file_path")
@Optional
val filePath: String? = null
) : TelegramMediaFile

View File

@ -10,14 +10,10 @@ data class VideoFile(
override val fileId: FileId,
override val width: Int,
override val height: Int,
@Optional
override val duration: Long? = null,
@Optional
override val thumb: PhotoSize? = null,
@SerialName(mimeTypeField)
@Optional
override val mimeType: String? = null,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile

View File

@ -10,12 +10,9 @@ data class VideoNoteFile(
override val fileId: FileId,
@SerialName("length")
override val width: Int,
@Optional
override val duration: Long? = null,
@Optional
override val thumb: PhotoSize? = null,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
) : TelegramMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile {
override val height: Int

View File

@ -8,12 +8,9 @@ import kotlinx.serialization.*
data class VoiceFile(
@SerialName(fileIdField)
override val fileId: FileId,
@Optional
override val duration: Long? = null,
@SerialName(mimeTypeField)
@Optional
override val mimeType: String? = null,
@SerialName(fileSizeField)
@Optional
override val fileSize: Long? = null
) : TelegramMediaFile, MimedMediaFile, PlayableMediaFile

View File

@ -15,14 +15,11 @@ data class Game(
@SerialName(photoField)
val photo: Photo,
@SerialName(textField)
@Optional
val text: String? = null,
@Serializable(RawMessageEntitiesSerializer::class)
@SerialName(textEntitiesField)
@Optional
private val textEntitiesRaw: RawMessageEntities? = null,
@SerialName(animationField)
@Optional
val animation: AnimationFile? = null
) {
@Transient

View File

@ -30,7 +30,6 @@ data class RawMessage(
@SerialName(chatField)
private val chat: RawChat,
@SerialName(fromField)
@Optional
private val from: User? = null,
@Optional private val forward_from: User? = null,
@Optional private val forward_from_chat: RawChat? = null,

View File

@ -3,7 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.payments
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.abstracts.*
import kotlinx.serialization.*
import kotlinx.serialization.Optional
import java.util.*
// TODO:: separate to normal classes hierarchy
@ -21,9 +20,7 @@ data class PreCheckoutQuery(
@SerialName(invoicePayloadField)
val invoicePayload: InvoicePayload,
@SerialName(shippingOptionIdField)
@Optional
val shippingOptionId: ShippingOptionIdentifier? = null,
@SerialName(orderInfoField)
@Optional
val orderInfo: OrderInfo? = null
) : Currencied, Amounted

View File

@ -14,9 +14,7 @@ data class ShippingAddress(
@SerialName(secondStreetLineField)
val secondStreetLine: String,
@SerialName(stateField)
@Optional
val state: String = "",
@SerialName(postCodeField)
@Optional
val postCode: String = ""
)

Some files were not shown because too many files have changed in this diff Show More