-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PIA-1904: Hotfix: Crash on missing field
- Loading branch information
1 parent
cb813f5
commit 292b44c
Showing
3 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
core/utils/src/main/java/com/kape/utils/vpnserver/VpnServerOutdated.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.kape.utils.vpnserver | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class VpnServerOutdated( | ||
val name: String, | ||
val iso: String, | ||
val dns: String, | ||
var latency: String?, | ||
val endpoints: Map<VpnServer.ServerGroup, List<VpnServer.ServerEndpointDetails>>, | ||
val key: String, | ||
val latitude: String?, | ||
val longitude: String?, | ||
val isGeo: Boolean, | ||
val isOffline: Boolean, | ||
@SerialName("isAllowsPF") | ||
val allowsPortForwarding: Boolean, | ||
val dipToken: String?, | ||
val dedicatedIp: String?, | ||
val isDedicatedIp: Boolean = !dedicatedIp.isNullOrEmpty(), | ||
) { | ||
fun toVpnServer(): VpnServer = VpnServer( | ||
name, | ||
iso, | ||
dns, | ||
latency, | ||
endpoints, | ||
key, | ||
latitude, | ||
longitude, | ||
isGeo, | ||
isOffline, | ||
allowsPortForwarding, | ||
false, | ||
dipToken, | ||
dedicatedIp, | ||
isDedicatedIp, | ||
) | ||
} |