1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-04 23:59:55 +00:00

make all serializers are internal

This commit is contained in:
2020-01-15 13:03:42 +06:00
parent 3fe7bd1382
commit 12496f8261
16 changed files with 18 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ data class FileId(
fun String.toInputFile(): InputFile = FileId(this)
@Serializer(InputFile::class)
object InputFileSerializer : KSerializer<InputFile> {
internal object InputFileSerializer : KSerializer<InputFile> {
override val descriptor: SerialDescriptor = StringDescriptor.withName(FileId::class.toString())
override fun serialize(encoder: Encoder, obj: InputFile) = encoder.encodeString(obj.fileId)
override fun deserialize(decoder: Decoder): FileId = FileId(decoder.decodeString())

View File

@@ -51,6 +51,6 @@ fun InlineQuery.createAnswer(
switchPmParameter
)
object InlineQueryAnswersResultsSerializer: KSerializer<List<InlineQueryResult>> by ArrayListSerializer(
internal object InlineQueryAnswersResultsSerializer: KSerializer<List<InlineQueryResult>> by ArrayListSerializer(
InlineQueryResultSerializer
)

View File

@@ -21,7 +21,7 @@ data class AnswerShippingQueryOk(
get() = serializer()
}
object ShippingOptionsSerializer : KSerializer<List<ShippingOption>> by ArrayListSerializer(
internal object ShippingOptionsSerializer : KSerializer<List<ShippingOption>> by ArrayListSerializer(
ShippingOption.serializer()
)

View File

@@ -15,4 +15,4 @@ interface GetGameHighScores : SimpleRequest<List<GameHighScore>> {
get() = GameHighScoresSerializer
}
object GameHighScoresSerializer : KSerializer<List<GameHighScore>> by ArrayListSerializer(GameHighScore.serializer())
internal object GameHighScoresSerializer : KSerializer<List<GameHighScore>> by ArrayListSerializer(GameHighScore.serializer())