diff --git a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/DownloadLimit.kt b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/DownloadLimit.kt index 5a5305ba..494598ca 100644 --- a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/DownloadLimit.kt +++ b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/DownloadLimit.kt @@ -21,5 +21,5 @@ enum class DownloadLimit(val value: String) { TWOHUNDREDFIFTY("250"), ONEHUNDRED("100"), TWENTY("20"), - ONE("1"); + ONE("1"), } diff --git a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/EmailLanguage.kt b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/EmailLanguage.kt index d7e5d63c..28231c50 100644 --- a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/EmailLanguage.kt +++ b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/EmailLanguage.kt @@ -22,5 +22,5 @@ enum class EmailLanguage(val value: String) { FRENCH("french"), GERMAN("german"), ITALIAN("italian"), - SPANISH("spanish"); + SPANISH("spanish"), } diff --git a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/Theme.kt b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/Theme.kt index 835adbf7..9fde6634 100644 --- a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/Theme.kt +++ b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/Theme.kt @@ -20,5 +20,5 @@ package com.infomaniak.multiplatform_swisstransfer.common.models enum class Theme(val value: String) { SYSTEM("system"), LIGHT("light"), - DARK("dark"); + DARK("dark"), } diff --git a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/ValidityPeriod.kt b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/ValidityPeriod.kt index 88d83a1c..4723d209 100644 --- a/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/ValidityPeriod.kt +++ b/STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/models/ValidityPeriod.kt @@ -21,5 +21,5 @@ enum class ValidityPeriod(val value: String) { THIRTY("30"), FIFTEEN("15"), SEVEN("7"), - ONE("1"); + ONE("1"), } diff --git a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AppSettingsManager.kt b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AppSettingsManager.kt index 6ea3c8a0..c0ec4500 100644 --- a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AppSettingsManager.kt +++ b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AppSettingsManager.kt @@ -54,7 +54,7 @@ class AppSettingsManager internal constructor( * @throws IllegalArgumentException If the provided theme is invalid. * @throws CancellationException If the operation is cancelled. */ - @Throws(IllegalArgumentException::class, CancellationException::class) + @Throws(IllegalArgumentException::class, CancellationException::class) suspend fun setTheme(theme: Theme) = withContext(Dispatchers.IO) { appSettingsController.setTheme(theme) } @@ -67,7 +67,7 @@ class AppSettingsManager internal constructor( * @throws IllegalArgumentException If the provided validity period is invalid. * @throws CancellationException If the operation is cancelled. */ - @Throws(IllegalArgumentException::class, CancellationException::class) + @Throws(IllegalArgumentException::class, CancellationException::class) suspend fun setValidityPeriod(validityPeriod: ValidityPeriod) = withContext(Dispatchers.IO) { appSettingsController.setValidityPeriod(validityPeriod) } @@ -80,7 +80,7 @@ class AppSettingsManager internal constructor( * @throws IllegalArgumentException If the provided download limit is invalid. * @throws CancellationException If the operation is cancelled. */ - @Throws(IllegalArgumentException::class, CancellationException::class) + @Throws(IllegalArgumentException::class, CancellationException::class) suspend fun setDownloadLimit(downloadLimit: DownloadLimit) = withContext(Dispatchers.IO) { appSettingsController.setDownloadLimit(downloadLimit) } @@ -93,7 +93,7 @@ class AppSettingsManager internal constructor( * @throws IllegalArgumentException If the provided email language is invalid. * @throws CancellationException If the operation is cancelled. */ - @Throws(IllegalArgumentException::class, CancellationException::class) + @Throws(IllegalArgumentException::class, CancellationException::class) suspend fun setEmailLanguage(emailLanguage: EmailLanguage) = withContext(Dispatchers.IO) { appSettingsController.setEmailLanguage(emailLanguage) } diff --git a/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/cache/setting/AppSettingsController.kt b/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/cache/setting/AppSettingsController.kt index 3fbe2268..e6c1043b 100644 --- a/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/cache/setting/AppSettingsController.kt +++ b/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/cache/setting/AppSettingsController.kt @@ -17,7 +17,6 @@ */ package com.infomaniak.multiplatform_swisstransfer.database.cache.setting -import com.infomaniak.multiplatform_swisstransfer.common.interfaces.appSettings.AppSettings import com.infomaniak.multiplatform_swisstransfer.common.models.DownloadLimit import com.infomaniak.multiplatform_swisstransfer.common.models.EmailLanguage import com.infomaniak.multiplatform_swisstransfer.common.models.Theme @@ -26,10 +25,10 @@ import com.infomaniak.multiplatform_swisstransfer.database.RealmProvider import com.infomaniak.multiplatform_swisstransfer.database.models.setting.AppSettingsDB import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.ext.query -import kotlin.coroutines.cancellation.CancellationException import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.mapLatest +import kotlin.coroutines.cancellation.CancellationException @OptIn(ExperimentalCoroutinesApi::class) class AppSettingsController(private val realmProvider: RealmProvider) { diff --git a/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/BaseRequest.kt b/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/BaseRequest.kt index c15f9f40..cf68429e 100644 --- a/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/BaseRequest.kt +++ b/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/BaseRequest.kt @@ -19,11 +19,7 @@ package com.infomaniak.multiplatform_swisstransfer.network.requests import com.infomaniak.multiplatform_swisstransfer.network.utils.ApiRoutes import io.ktor.client.HttpClient -import io.ktor.client.request.delete -import io.ktor.client.request.get -import io.ktor.client.request.post -import io.ktor.client.request.put -import io.ktor.client.request.setBody +import io.ktor.client.request.* import io.ktor.client.statement.HttpResponse import io.ktor.client.statement.bodyAsText import io.ktor.http.URLBuilder diff --git a/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/serializers/IntToBooleanSerializer.kt b/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/serializers/IntToBooleanSerializer.kt index fd5e896b..7a6c9c6f 100644 --- a/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/serializers/IntToBooleanSerializer.kt +++ b/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/serializers/IntToBooleanSerializer.kt @@ -18,11 +18,7 @@ package com.infomaniak.multiplatform_swisstransfer.network.serializers import kotlinx.serialization.builtins.serializer -import kotlinx.serialization.json.JsonElement -import kotlinx.serialization.json.JsonPrimitive -import kotlinx.serialization.json.JsonTransformingSerializer -import kotlinx.serialization.json.int -import kotlinx.serialization.json.jsonPrimitive +import kotlinx.serialization.json.* internal object IntToBooleanSerializer : JsonTransformingSerializer(Boolean.serializer()) { override fun transformDeserialize(element: JsonElement): JsonElement {