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 --- .../mx/trackermap/TrackerMap/client/apis/DriversApi.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt index 2a8f92c..7cf26d0 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Driver import mx.trackermap.TrackerMap.client.infrastructure.* -class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class DriversApi : ApiClient() { /** * Fetch a list of Drivers @@ -28,18 +28,18 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun driversGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun driversGet(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, "/drivers", 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") @@ -52,7 +52,7 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @param id * @return void */ - suspend fun driversIdDelete(id: kotlin.Int): Unit { + suspend fun driversIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -78,8 +78,8 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @return Driver */ @Suppress("UNCHECKED_CAST") - suspend fun driversIdPut(body: Driver, id: kotlin.Int): Driver { - val localVariableBody: kotlin.Any? = body + suspend fun driversIdPut(body: Driver, id: Int): Driver { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -105,7 +105,7 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api */ @Suppress("UNCHECKED_CAST") suspend fun driversPost(body: Driver): Driver { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, -- cgit v1.2.3