aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt103
1 files changed, 0 insertions, 103 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
index 8b839aa..619853c 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt
@@ -53,107 +53,4 @@ class DevicesApi(sessionManager: SessionManager) : ApiClient(sessionManager), In
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
}
}
- /**
- * Update total distance and hours of the Device
- *
- * @param body
- * @param id
- * @return void
- */
- suspend fun devicesIdAccumulatorsPut(body: DeviceAccumulators, id: Int) {
- val localVariableBody: Any = body
-
- val localVariableConfig = RequestConfig(
- RequestMethod.PUT,
- "/devices/{id}/accumulators".replace("{" + "id" + "}", "$id")
- )
- val response = request<Any?>(
- localVariableConfig, localVariableBody
- )
-
- 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")
- }
- }
- /**
- * Delete a Device
- *
- * @param id
- * @return void
- */
- suspend fun devicesIdDelete(id: Int) {
-
- val localVariableConfig = RequestConfig(
- RequestMethod.DELETE,
- "/devices/{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 Device
- *
- * @param body
- * @param id
- * @return Device
- */
- @Suppress("UNCHECKED_CAST")
- suspend fun devicesIdPut(body: Device, id: Int): Device {
- val localVariableBody: Any = body
-
- val localVariableConfig = RequestConfig(
- RequestMethod.PUT,
- "/devices/{id}".replace("{" + "id" + "}", "$id")
- )
- val response = request<Device>(
- localVariableConfig, localVariableBody
- )
-
- return when (response.responseType) {
- ResponseType.Success -> (response as Success<*>).data as Device
- 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 Device
- *
- * @param body
- * @return Device
- */
- @Suppress("UNCHECKED_CAST")
- suspend fun devicesPost(body: Device): Device {
- val localVariableBody: Any = body
-
- val localVariableConfig = RequestConfig(
- RequestMethod.POST,
- "/devices"
- )
- val response = request<Device>(
- localVariableConfig, localVariableBody
- )
-
- return when (response.responseType) {
- ResponseType.Success -> (response as Success<*>).data as Device
- 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")
- }
- }
}