forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModels.kt
More file actions
60 lines (43 loc) · 1.21 KB
/
Models.kt
File metadata and controls
60 lines (43 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// To parse the JSON, install Klaxon and do:
//
// val welcome4 = Welcome4.fromJson(jsonString)
package com.httpsms
import com.beust.klaxon.Json
import com.beust.klaxon.Klaxon
private val klaxon = Klaxon()
data class ResponseMessage (
val data: Message,
val message: String,
val status: String
) {
companion object {
fun fromJson(json: String) = klaxon.parse<ResponseMessage>(json)
}
}
data class Message (
val contact: String,
val content: String,
val sim: String,
@Json(name = "created_at")
val createdAt: String,
@Json(name = "failure_reason")
val failureReason: String?,
val id: String,
@Json(name = "last_attempted_at")
val lastAttemptedAt: String?,
@Json(name = "order_timestamp")
val orderTimestamp: String,
val owner: String,
@Json(name = "received_at")
val receivedAt: String?,
@Json(name = "request_received_at")
val requestReceivedAt: String,
@Json(name = "send_time")
val sendTime: Long?,
@Json(name = "sent_at")
val sentAt: String?,
val status: String,
val type: String,
@Json(name = "updated_at")
val updatedAt: String
)