aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-22 22:32:27 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-22 22:32:27 -0600
commit707b89f48297c68af514d6aa475b13624652df51 (patch)
tree4b63479f55e404a8b35e958a1e7a6b4439517096 /shared/src/commonMain/kotlin/mx
parent35da6cfb0b80b57a7c3c47c7f9f9b8a5f222019d (diff)
downloadetbsa-trackermap-mobile-707b89f48297c68af514d6aa475b13624652df51.tar.gz
etbsa-trackermap-mobile-707b89f48297c68af514d6aa475b13624652df51.tar.bz2
etbsa-trackermap-mobile-707b89f48297c68af514d6aa475b13624652df51.zip
Removed all Java references from shared module
Diffstat (limited to 'shared/src/commonMain/kotlin/mx')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt9
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt3
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt13
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt4
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt5
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt9
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt3
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt6
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt5
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt19
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt17
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt38
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt6
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt15
17 files changed, 100 insertions, 58 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt
index 569a036..eff40ad 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt
@@ -12,6 +12,7 @@
package mx.trackermap.TrackerMap.client.apis
import io.ktor.content.*
+import kotlinx.datetime.LocalDateTime
import mx.trackermap.TrackerMap.client.models.Event
import mx.trackermap.TrackerMap.client.models.Position
import mx.trackermap.TrackerMap.client.models.Stop
@@ -248,8 +249,8 @@ class ReportsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
*/
@Suppress("UNCHECKED_CAST")
suspend fun reportsSummaryGet(
- from: java.time.LocalDateTime,
- to: java.time.LocalDateTime,
+ from: LocalDateTime,
+ to: LocalDateTime,
deviceId: Array<Int>? = null,
groupId: Array<Int>? = null
): Array<ReportSummary> {
@@ -291,8 +292,8 @@ class ReportsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
*/
@Suppress("UNCHECKED_CAST")
suspend fun reportsTripsGet(
- from: java.time.LocalDateTime,
- to: java.time.LocalDateTime,
+ from: LocalDateTime,
+ to: LocalDateTime,
deviceId: Array<Int>? = null,
groupId: Array<Int>? = null
): Array<ReportTrips> {
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt
index d121f81..296e589 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.apis
+import kotlinx.datetime.LocalDateTime
import mx.trackermap.TrackerMap.client.models.Statistics
import mx.trackermap.TrackerMap.client.infrastructure.*
@@ -25,7 +26,7 @@ class StatisticsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) {
* @return kotlin.Array<Statistics>
*/
@Suppress("UNCHECKED_CAST")
- suspend fun statisticsGet(from: java.time.LocalDateTime, to: java.time.LocalDateTime): Array<Statistics> {
+ suspend fun statisticsGet(from: LocalDateTime, to: LocalDateTime): Array<Statistics> {
val localVariableQuery: MultiValueMap = mapOf("from" to listOf("$from"), "to" to listOf("$to"))
val localVariableConfig = RequestConfig(
RequestMethod.GET,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt
index 0404967..7c139b5 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
*
@@ -20,13 +22,14 @@ package mx.trackermap.TrackerMap.client.models
* @param expression
* @param type String|Number|Boolean
*/
+@Serializable
data class Attribute (
- val id: kotlin.Int? = null,
- val description: kotlin.String? = null,
- val attribute: kotlin.String? = null,
- val expression: kotlin.String? = null,
+ val id: Int? = null,
+ val description: String? = null,
+ val attribute: String? = null,
+ val expression: String? = null,
/* String|Number|Boolean */
- val type: kotlin.String? = null
+ val type: String? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt
index c528673..6501ff4 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
@@ -19,8 +20,9 @@ import kotlinx.serialization.json.JsonPrimitive
* @param id
* @param name
* @param &#x60;data&#x60; base64 encoded in iCalendar format
- * @param attributes
+ * @param attributes
*/
+@Serializable
data class Calendar (
val id: Int? = null,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt
index 7b1a742..fa00d24 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt
@@ -11,13 +11,16 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
*
* @param type
*/
+@Serializable
data class CommandType (
- val type: kotlin.String? = null
+ val type: String? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt
index 43c8fb9..87cb0a7 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
*
@@ -18,11 +20,12 @@ package mx.trackermap.TrackerMap.client.models
* @param totalDistance in meters
* @param hours
*/
+@Serializable
data class DeviceAccumulators (
- val deviceId: kotlin.Int? = null,
+ val deviceId: Int? = null,
/* in meters */
- val totalDistance: java.math.BigDecimal? = null,
- val hours: java.math.BigDecimal? = null
+ val totalDistance: Double? = null,
+ val hours: Long? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt
index c83543e..309e4b9 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
@@ -21,6 +22,7 @@ import kotlinx.serialization.json.JsonPrimitive
* @param uniqueId
* @param attributes
*/
+@Serializable
data class Driver (
val id: Int? = null,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt
index 5e4b2d5..a008fa8 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt
@@ -1,5 +1,8 @@
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
+@Serializable
data class EventInformation(
val event: Event,
val position: Position?,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt
index b90e591..6ab32cd 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
@@ -21,6 +22,7 @@ import kotlinx.serialization.json.JsonPrimitive
* @param groupId
* @param attributes
*/
+@Serializable
data class Group (
val id: Int? = null,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt
index f9d4fcd..1979e1a 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
@@ -23,13 +24,14 @@ import kotlinx.serialization.json.JsonPrimitive
* @param period
* @param attributes
*/
+@Serializable
data class Maintenance (
val id: Int? = null,
val name: String? = null,
val type: String? = null,
- val start: java.math.BigDecimal? = null,
- val period: java.math.BigDecimal? = null,
+ val start: Double? = null,
+ val period: Double? = null,
val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt
index 2be5468..eb35ecd 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
@@ -25,6 +26,7 @@ import kotlinx.serialization.json.JsonPrimitive
* @param calendarId
* @param attributes
*/
+@Serializable
data class Notification (
val id: Int? = null,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt
index 55763ca..486c67b 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt
@@ -11,13 +11,16 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
*
* @param type
*/
+@Serializable
data class NotificationType (
- val type: kotlin.String? = null
+ val type: String? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt
index c4c236b..0d1be29 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
* This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }
@@ -23,23 +25,24 @@ package mx.trackermap.TrackerMap.client.models
* @param driverId Driver Id, can be second parameter only
* @param managedUserId User Id, can be second parameter only and only in combination with userId
*/
+@Serializable
data class Permission (
/* User Id, can be only first parameter */
- val userId: kotlin.Int? = null,
+ val userId: Int? = null,
/* Device Id, can be first parameter or second only in combination with userId */
- val deviceId: kotlin.Int? = null,
+ val deviceId: Int? = null,
/* Group Id, can be first parameter or second only in combination with userId */
- val groupId: kotlin.Int? = null,
+ val groupId: Int? = null,
/* Geofence Id, can be second parameter only */
- val geofenceId: kotlin.Int? = null,
+ val geofenceId: Int? = null,
/* Calendar Id, can be second parameter only and only in combination with userId */
- val calendarId: kotlin.Int? = null,
+ val calendarId: Int? = null,
/* Computed Attribute Id, can be second parameter only */
- val attributeId: kotlin.Int? = null,
+ val attributeId: Int? = null,
/* Driver Id, can be second parameter only */
- val driverId: kotlin.Int? = null,
+ val driverId: Int? = null,
/* User Id, can be second parameter only and only in combination with userId */
- val managedUserId: kotlin.Int? = null
+ val managedUserId: Int? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt
index c6f59a6..25f5b9d 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
*
@@ -22,18 +24,19 @@ package mx.trackermap.TrackerMap.client.models
* @param spentFuel in liters
* @param engineHours
*/
+@Serializable
data class ReportSummary (
- val deviceId: kotlin.Int? = null,
- val deviceName: kotlin.String? = null,
+ val deviceId: Int? = null,
+ val deviceName: String? = null,
/* in knots */
- val maxSpeed: java.math.BigDecimal? = null,
+ val maxSpeed: Double? = null,
/* in knots */
- val averageSpeed: java.math.BigDecimal? = null,
+ val averageSpeed: Double? = null,
/* in meters */
- val distance: java.math.BigDecimal? = null,
+ val distance: Double? = null,
/* in liters */
- val spentFuel: java.math.BigDecimal? = null,
- val engineHours: kotlin.Int? = null
+ val spentFuel: Double? = null,
+ val engineHours: Double? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt
index d7e9598..666b2ad 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt
@@ -11,6 +11,9 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.datetime.LocalDateTime
+import kotlinx.serialization.Serializable
+
/**
*
@@ -32,30 +35,31 @@ package mx.trackermap.TrackerMap.client.models
* @param driverUniqueId
* @param driverName
*/
+@Serializable
data class ReportTrips (
- val deviceId: kotlin.Int? = null,
- val deviceName: kotlin.String? = null,
+ val deviceId: Int? = null,
+ val deviceName: String? = null,
/* in knots */
- val maxSpeed: java.math.BigDecimal? = null,
+ val maxSpeed: Double? = null,
/* in knots */
- val averageSpeed: java.math.BigDecimal? = null,
+ val averageSpeed: Double? = null,
/* in meters */
- val distance: java.math.BigDecimal? = null,
+ val distance: Double? = null,
/* in liters */
- val spentFuel: java.math.BigDecimal? = null,
- val duration: kotlin.Int? = null,
+ val spentFuel: Double? = null,
+ val duration: Int? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val startTime: java.time.LocalDateTime? = null,
- val startAddress: kotlin.String? = null,
- val startLat: java.math.BigDecimal? = null,
- val startLon: java.math.BigDecimal? = null,
+ val startTime: String? = null,
+ val startAddress: String? = null,
+ val startLat: Double? = null,
+ val startLon: Double? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val endTime: java.time.LocalDateTime? = null,
- val endAddress: kotlin.String? = null,
- val endLat: java.math.BigDecimal? = null,
- val endLon: java.math.BigDecimal? = null,
- val driverUniqueId: kotlin.Int? = null,
- val driverName: kotlin.String? = null
+ val endTime: String? = null,
+ val endAddress: String? = null,
+ val endLat: Double? = null,
+ val endLon: Double? = null,
+ val driverUniqueId: Int? = null,
+ val driverName: String? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt
index d2ea44e..0c1e790 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt
@@ -11,6 +11,7 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonPrimitive
@@ -34,6 +35,7 @@ import kotlinx.serialization.json.JsonPrimitive
* @param coordinateFormat
* @param attributes
*/
+@Serializable
data class Server (
val id: Int? = null,
@@ -45,8 +47,8 @@ data class Server (
val bingKey: String? = null,
val mapUrl: String? = null,
val poiLayer: String? = null,
- val latitude: java.math.BigDecimal? = null,
- val longitude: java.math.BigDecimal? = null,
+ val latitude: Double? = null,
+ val longitude: Double? = null,
val zoom: Int? = null,
val twelveHourFormat: Boolean? = null,
val version: String? = null,
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt
index 32027b9..4ad71ce 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.Serializable
+
/**
*
@@ -21,14 +23,15 @@ package mx.trackermap.TrackerMap.client.models
* @param messagesReceived
* @param messagesStored
*/
+@Serializable
data class Statistics (
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val captureTime: java.time.LocalDateTime? = null,
- val activeUsers: kotlin.Int? = null,
- val activeDevices: kotlin.Int? = null,
- val requests: kotlin.Int? = null,
- val messagesReceived: kotlin.Int? = null,
- val messagesStored: kotlin.Int? = null
+ val captureTime: String? = null,
+ val activeUsers: Int? = null,
+ val activeDevices: Int? = null,
+ val requests: Int? = null,
+ val messagesReceived: Int? = null,
+ val messagesStored: Int? = null
) {
} \ No newline at end of file