-
Notifications
You must be signed in to change notification settings - Fork 164
/
kotlin.kt
82 lines (56 loc) · 1.75 KB
/
kotlin.kt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// To parse the JSON, install Klaxon and do:
//
// val bank = Bank.fromJson(jsonString)
package br.com.stracini.guilherme.bancosbrasileiros
import com.beust.klaxon.*
private val klaxon = Klaxon()
class Bank(elements: Collection<BankElement>) : ArrayList<BankElement>(elements) {
public fun toJson() = klaxon.toJsonString(this)
companion object {
public fun fromJson(json: String) = Bank(klaxon.parseArray<BankElement>(json)!!)
}
}
data class BankElement (
@Json(name = "COMPE")
val compe: String,
@Json(name = "ISPB")
val ispb: String,
@Json(name = "Document")
val document: String,
@Json(name = "LongName")
val longName: String,
@Json(name = "ShortName")
val shortName: String,
@Json(name = "Network")
val network: String,
@Json(name = "Type")
val type: String,
@Json(name = "PixType")
val pixType: String,
@Json(name = "Charge")
val charge: Boolean? = null,
@Json("CreditDocument")
val creditDocument: Boolean? = null,
@Json("LegalCheque")
val legalCheque: Boolean,
@Json("DetectaFLow")
val detectaFlow: Boolean,
@Json("Pcr")
val pcr: Boolean,
@Json("Pcrp")
val pcrp: Boolean,
@Json("SalaryPortability")
val salaryPortability: String? = null,
@Json("Products")
val products: ArrayList<String> = arrayListOf(),
@Json(name = "Url")
val url: String? = null,
@Json(name = "DateOperationStarted")
val dateOperationStarted: String
@Json(name = "DatePixStarted")
val datePixStarted: String
@Json(name = "DateRegistered")
val dateRegistered: String,
@Json(name = "DateUpdated")
val dateUpdated: String
)