diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-20 20:43:14 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-20 20:43:14 -0600 |
commit | 7da841d2de9ac0526c3863e85d7d603facabb95c (patch) | |
tree | 57f9ad1386fe89d622f4c219d1dc25d0637f5860 /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt | |
parent | d3fbda46d35ef58deb8c8965a2c6f937f204d980 (diff) | |
download | etbsa-trackermap-mobile-7da841d2de9ac0526c3863e85d7d603facabb95c.tar.gz etbsa-trackermap-mobile-7da841d2de9ac0526c3863e85d7d603facabb95c.tar.bz2 etbsa-trackermap-mobile-7da841d2de9ac0526c3863e85d7d603facabb95c.zip |
Implemented feature to switch to different Traccar servers by URL and removed annoying auto-generated redundant qualifiers
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt index c86e66c..3b0dfa1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Group import mx.trackermap.TrackerMap.client.infrastructure.* -class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class GroupsApi : ApiClient() { /** * Fetch a list of Groups @@ -25,18 +25,18 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @return kotlin.Array<Group> */ @Suppress("UNCHECKED_CAST") - suspend fun groupsGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null): kotlin.Array<Group> { + suspend fun groupsGet(all: Boolean? = null, userId: Int? = null): Array<Group> { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/groups", query = localVariableQuery ) - val response = request<kotlin.Array<Group>>( + val response = request<Array<Group>>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array<Group> + ResponseType.Success -> (response as Success<*>).data as Array<Group> ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -49,7 +49,7 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @param id * @return void */ - suspend fun groupsIdDelete(id: kotlin.Int): Unit { + suspend fun groupsIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -75,8 +75,8 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @return Group */ @Suppress("UNCHECKED_CAST") - suspend fun groupsIdPut(body: Group, id: kotlin.Int): Group { - val localVariableBody: kotlin.Any? = body + suspend fun groupsIdPut(body: Group, id: Int): Group { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -102,7 +102,7 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC */ @Suppress("UNCHECKED_CAST") suspend fun groupsPost(body: Group): Group { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, |