Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Created February 17, 2019 23:39
Show Gist options
  • Save CostaFot/9220e5e048fcc539567978c99b5a895a to your computer and use it in GitHub Desktop.
Save CostaFot/9220e5e048fcc539567978c99b5a895a to your computer and use it in GitHub Desktop.
The cat model
/**
* 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