diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-12-14 20:10:30 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-12-14 20:10:30 -0600 |
commit | 5a9752eff691098d727420264c025f7f272c8ef1 (patch) | |
tree | c8aaa20e7295feb2c52c8f7059850fb8391aa814 /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt | |
parent | d533c9684fb6b3f004656a7862c43e6cd9b69ede (diff) | |
parent | 1606ed48c1b3f39cfa0e45aab22658645a9b4118 (diff) | |
download | etbsa-trackermap-mobile-5a9752eff691098d727420264c025f7f272c8ef1.tar.gz etbsa-trackermap-mobile-5a9752eff691098d727420264c025f7f272c8ef1.tar.bz2 etbsa-trackermap-mobile-5a9752eff691098d727420264c025f7f272c8ef1.zip |
Merge branch 'main' of https://git.sr.ht/~avalos/trackermap-mobile
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt index 049aee9..f4a6bff 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt @@ -54,81 +54,5 @@ class GeofencesApi(sessionManager: SessionManager) : ApiClient(sessionManager), ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") } } - /** - * Delete a Geofence - * - * @param id - * @return void - */ - suspend fun geofencesIdDelete(id: Int) { - - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/geofences/{id}".replace("{" + "id" + "}", "$id") - ) - val response = request<Any?>( - localVariableConfig - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - } - } - /** - * Update a Geofence - * - * @param body - * @param id - * @return Geofence - */ - @Suppress("UNCHECKED_CAST") - suspend fun geofencesIdPut(body: Geofence, id: Int): Geofence { - val localVariableBody: Any = body - - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/geofences/{id}".replace("{" + "id" + "}", "$id") - ) - val response = request<Geofence>( - localVariableConfig, localVariableBody - ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Geofence - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - } - } - /** - * Create a Geofence - * - * @param body - * @return Geofence - */ - @Suppress("UNCHECKED_CAST") - suspend fun geofencesPost(body: Geofence): Geofence { - val localVariableBody: Any = body - - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/geofences" - ) - val response = request<Geofence>( - localVariableConfig, localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Geofence - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - } - } } |