Created
February 17, 2019 23:39
-
-
Save CostaFot/9220e5e048fcc539567978c99b5a895a to your computer and use it in GitHub Desktop.
The cat model
This file contains hidden or 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
/** | |
* The class representing the Json response. Use http://www.jsonschema2pojo.org/ to get this. | |
* Or you can add this plugin for AS here https://plugins.jetbrains.com/plugin/9960-json-to-kotlin-class-jsontokotlinclass- | |
* It will create your data class from JSON to kotlin. | |
*/ | |
data class NetCat( | |
@SerializedName("id") val id: String, | |
@SerializedName("url") val url: String, | |
@SerializedName("breeds") val breeds: List<Any>, | |
@SerializedName("categories") val categories: List<Any> | |
) { | |
override fun toString(): String { | |
return "NetCat(id='$id', url='$url', breeds=$breeds, categories=$categories)" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment