diff --git a/CHANGELOG b/CHANGELOG index 96762ecf16..442914cbae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -47,3 +47,4 @@ * Old extension `OkHttpClient.Builder#useWith` now deprecated and must be replaced by the same in `com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor` package +* Replace `ProxySettings` data class in `settings` package, deprecate old link diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/ProxySettings.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/ProxySettings.kt index a137983f62..afbe01c957 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/ProxySettings.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/ProxySettings.kt @@ -3,12 +3,11 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.useWith import okhttp3.OkHttpClient -data class ProxySettings( - val host: String = "localhost", - val port: Int = 1080, - val username: String? = null, - val password: String? = null +@Deprecated( + "Replaced in settings package", + ReplaceWith("ProxySettings", "com.github.insanusmokrassar.TelegramBotAPI.bot.settings.ProxySettings") ) +typealias ProxySettings = com.github.insanusmokrassar.TelegramBotAPI.bot.settings.ProxySettings @Deprecated( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/settings/ProxySettings.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/settings/ProxySettings.kt new file mode 100644 index 0000000000..19dfdec44d --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/settings/ProxySettings.kt @@ -0,0 +1,16 @@ +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 +)