FighterDataModel.kt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package com.sambath.kunkhmer.remote
  2. import com.squareup.moshi.Json
  3. import com.squareup.moshi.JsonClass
  4. @JsonClass(generateAdapter = true)
  5. data class MatchesResponse(
  6. @Json(name = "code")
  7. val resultCode: Int,
  8. @Json(name = "message")
  9. val message: ResponseMessage,
  10. @Json(name = "data")
  11. val data: MatchesData?
  12. )
  13. @JsonClass(generateAdapter = true)
  14. data class ResponseMessage(
  15. @Json(name = "code")
  16. val code: String,
  17. @Json(name = "description")
  18. val description: String = "NA",
  19. )
  20. @JsonClass(generateAdapter = true)
  21. data class MatchesData(
  22. @Json(name = "object")
  23. val obj: List<Matches>,
  24. )
  25. @JsonClass(generateAdapter = true)
  26. data class Matches(
  27. @Json(name = "_id")
  28. val matchInfo: MatchInfo,
  29. @Json(name = "fighters")
  30. val fighters: List<Fighters>,
  31. )
  32. @JsonClass(generateAdapter = true)
  33. data class MatchInfo(
  34. @Json(name = "_id")
  35. val id: String,
  36. @Json(name = "desc")
  37. val desc: String,
  38. @Json(name = "date")
  39. val date: String,
  40. @Json(name = "title")
  41. val title: String,
  42. @Json(name = "createdAt")
  43. val createdAt: String,
  44. )
  45. @JsonClass(generateAdapter = true)
  46. data class Fighters(
  47. @Json(name = "_id")
  48. val id: String,
  49. @Json(name = "name")
  50. val name: String,
  51. @Json(name = "desc")
  52. val desc: String,
  53. @Json(name = "weight")
  54. val weight: String,
  55. @Json(name = "high")
  56. val high: String,
  57. @Json(name = "nationality")
  58. val nationality: String,
  59. @Json(name = "filename")
  60. val filename: String,
  61. )