From 7da841d2de9ac0526c3863e85d7d603facabb95c Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 20 Jan 2022 20:43:14 -0600 Subject: Implemented feature to switch to different Traccar servers by URL and removed annoying auto-generated redundant qualifiers --- .../TrackerMap/client/apis/NotificationsApi.kt | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt index 86c34d0..1f0d744 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.NotificationType import mx.trackermap.TrackerMap.client.infrastructure.* -class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class NotificationsApi : ApiClient() { /** * Fetch a list of Notifications @@ -29,18 +29,18 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun notificationsGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun notificationsGet(all: Boolean? = null, userId: Int? = null, deviceId: Int? = null, groupId: Int? = null, refresh: Boolean? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId"), "deviceId" to listOf("$deviceId"), "groupId" to listOf("$groupId"), "refresh" to listOf("$refresh")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/notifications", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -53,7 +53,7 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @param id * @return void */ - suspend fun notificationsIdDelete(id: kotlin.Int): Unit { + suspend fun notificationsIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -79,8 +79,8 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @return Notification */ @Suppress("UNCHECKED_CAST") - suspend fun notificationsIdPut(body: Notification, id: kotlin.Int): Notification { - val localVariableBody: kotlin.Any? = body + suspend fun notificationsIdPut(body: Notification, id: Int): Notification { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -106,7 +106,7 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") */ @Suppress("UNCHECKED_CAST") suspend fun notificationsPost(body: Notification): Notification { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, @@ -129,7 +129,7 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * * @return void */ - suspend fun notificationsTestPost(): Unit { + suspend fun notificationsTestPost(){ val localVariableConfig = RequestConfig( RequestMethod.POST, @@ -153,18 +153,18 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun notificationsTypesGet(): kotlin.Array { + suspend fun notificationsTypesGet(): Array { val localVariableConfig = RequestConfig( RequestMethod.GET, "/notifications/types" ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") -- cgit v1.2.3