From 402e1b12dc24d4259c28fb31fc0364254bdd5612 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 17 Aug 2019 22:29:42 +0600 Subject: [PATCH] current raw tools are internal --- .../TelegramBotAPI/requests/GetUpdates.kt | 21 ------------------- .../types/message/abstracts/Message.kt | 4 ++-- .../types/update/abstracts/Update.kt | 4 ++-- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt index 06ce78b2ac..d2e1193178 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/GetUpdates.kt @@ -10,27 +10,6 @@ import kotlinx.serialization.KSerializer import kotlinx.serialization.Serializable import kotlinx.serialization.internal.ArrayListSerializer -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_MESSAGE", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_MESSAGE")) -const val UPDATE_MESSAGE = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_MESSAGE -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_EDITED_MESSAGE", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_EDITED_MESSAGE")) -const val UPDATE_EDITED_MESSAGE = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_EDITED_MESSAGE -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_CHANNEL_POST", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_CHANNEL_POST")) -const val UPDATE_CHANNEL_POST = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_CHANNEL_POST -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_EDITED_CHANNEL_POST", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_EDITED_CHANNEL_POST")) -const val UPDATE_EDITED_CHANNEL_POST = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_EDITED_CHANNEL_POST -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_CHOSEN_INLINE_RESULT", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_CHOSEN_INLINE_RESULT")) -const val UPDATE_CHOSEN_INLINE_RESULT = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_CHOSEN_INLINE_RESULT -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_INLINE_QUERY", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_INLINE_QUERY")) -const val UPDATE_INLINE_QUERY = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_INLINE_QUERY -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_CALLBACK_QUERY", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_CALLBACK_QUERY")) -const val UPDATE_CALLBACK_QUERY = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_CALLBACK_QUERY -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_SHIPPING_QUERY", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_SHIPPING_QUERY")) -const val UPDATE_SHIPPING_QUERY = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_SHIPPING_QUERY -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_PRE_CHECKOUT_QUERY", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_PRE_CHECKOUT_QUERY")) -const val UPDATE_PRE_CHECKOUT_QUERY = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_PRE_CHECKOUT_QUERY -@Deprecated("Replaced to other package", ReplaceWith("UPDATE_POLL", "com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_POLL")) -const val UPDATE_POLL = com.github.insanusmokrassar.TelegramBotAPI.types.UPDATE_POLL - @Serializable data class GetUpdates( val offset: UpdateIdentifier? = null,// set `last update id + 1` to receive next part of updates diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/abstracts/Message.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/abstracts/Message.kt index 9c500b31cd..ac99fbbce8 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/abstracts/Message.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/abstracts/Message.kt @@ -13,7 +13,7 @@ interface Message { val date: DateTime } -object TelegramBotAPIMessageDeserializationStrategy : DeserializationStrategy { +internal object TelegramBotAPIMessageDeserializationStrategy : DeserializationStrategy { override val descriptor: SerialDescriptor = StringDescriptor.withName("TelegramBotAPIMessageSerializer") override fun patch(decoder: Decoder, old: Message): Message = throw UpdateNotSupportedException(descriptor.name) @@ -22,7 +22,7 @@ object TelegramBotAPIMessageDeserializationStrategy : DeserializationStrategy { +internal object TelegramBotAPIMessageDeserializeOnlySerializer : KSerializer { override val descriptor: SerialDescriptor get() = TelegramBotAPIMessageDeserializationStrategy.descriptor diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt index 7bb89c0ffb..46f998d759 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/abstracts/Update.kt @@ -10,7 +10,7 @@ interface Update { val data: Any } -object UpdateSerializerWithoutDeserialization : KSerializer { +internal object UpdateSerializerWithoutDeserialization : KSerializer { override val descriptor: SerialDescriptor = StringDescriptor.withName("UpdateSerializerWithoutDeserialization") override fun deserialize(decoder: Decoder): Update = UpdateDeserializationStrategy.deserialize(decoder) @@ -18,7 +18,7 @@ object UpdateSerializerWithoutDeserialization : KSerializer { override fun serialize(encoder: Encoder, obj: Update) = throw UnsupportedOperationException() } -object UpdateDeserializationStrategy : DeserializationStrategy { +internal object UpdateDeserializationStrategy : DeserializationStrategy { override val descriptor: SerialDescriptor = StringDescriptor.withName("UpdateDeserializationStrategy") override fun patch(decoder: Decoder, old: Update): Update = throw UpdateNotSupportedException(descriptor.name)