Skip to content

Instantly share code, notes, and snippets.

View ajailani4's full-sized avatar

Ahmad Jailani ajailani4

View GitHub Profile
data class PhoneSearchDataResponse(
@field:Json(name = "page")
val page: Int,
@field:Json(name = "limit")
val limit: Int,
@field:Json(name = "last_page")
val lastPage: Int,
@field:Json(name = "phones")
val phones: List<PhoneSearch>
)
data class PhoneSearchResponse(
@Json(name = "status")
val status: Boolean,
@Json(name = "data")
val data: PhoneSearchDataResponse
)
{
"status": true,
"data": {
"page": 1,
"limit": 10,
"last_page": 4,
"phones": [
{
"phone_name": "Galaxy Note9",
"phone_name_slug": "galaxy-note9",
data class PhoneSubSpecs(
@field:Json(name = "key")
val subTitle: String,
@field:Json(name = "val")
val subSpecs: List<String>
)
data class PhoneSpecs(
@field:Json(name = "title")
val title: String,
@field:Json(name = "specs")
val specs: List<PhoneSubSpecs>
)
data class PhoneSpecsDataResponse(
@field:Json(name = "brand")
val brandName: String,
@field:Json(name = "phone_name")
val name: String,
@field:Json(name = "phone_name_slug")
val slug: String,
@field:Json(name = "phone_img_url")
val image: String,
@field:Json(name = "specifications")
data class PhoneSpecsResponse(
@Json(name = "status")
val status: Boolean,
@Json(name = "data")
val data: PhoneSpecsDataResponse
)
{
"status": true,
"data": {
"brand": "Apple",
"phone_name": "iPhone SE (2020)",
"phone_name_slug": "iphone-se-2020",
"phone_img_url": "https://fdn2.gsmarena.com/vv/bigpic/apple-iphone-se-2020.jpg",
"specifications": [
{
"title": "Launch",
data class Phone(
@field:Json(name = "phone_name")
val name: String,
@field:Json(name = "phone_name_slug")
val slug: String,
@field:Json(name = "brand")
val brandName: String,
@field:Json(name = "phone_img_url")
val image: String
)
data class PhoneDataResponse(
@field:Json(name = "page")
val page: Int,
@field:Json(name = "limit")
val limit: Int,
@field:Json(name = "last_page")
val lastPage: Int,
@field:Json(name = "phones")
val phones: List<Phone>
)