Last active
April 26, 2018 17:34
-
-
Save candidosales/3f0d2cdb0c953183c9e3142d6609c35e to your computer and use it in GitHub Desktop.
Como tratar os erros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// { | |
// "id": 4, | |
// "name": "Nikola Tesla", | |
// "branch": "0001", | |
// "branchVerificationDigit": "string", | |
// "account": "1256720", | |
// "accountVerificationDigit": 3, | |
// "phone": "11 95555-5555", | |
// "email": "[email protected]", | |
// "apiMetadata": { | |
// "type": "AccountInfo", | |
// "meta": {}, | |
// "jsonapi": { | |
// "version": "1.0" | |
// }, | |
// "errors": [ | |
// { | |
// "type": "ConstraintViolationException", | |
// "message": "You must fill the 'name' field", | |
// "meta": "accountInfo.name" | |
// } | |
// ], | |
// "included": {}, | |
// "timestamp": "2018-04-04T11:32:16.497Z" | |
// } | |
// } | |
class ResponseError(val type: String = "", | |
val message: String = "", | |
val meta: String = "") | |
class ApiMetadata(val type: String = "", | |
val errors: MutableList<ResponseError>, | |
val timestamp: String = "") | |
open class Response(val apiMetadata: ApiMetadata? = null) | |
// O que sera colocado no service do Retrofit | |
data class ExtractRaw(val balance: Int): Response() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment