Skip to content

Instantly share code, notes, and snippets.

@aindong
Created March 27, 2018 11:56
Show Gist options
  • Save aindong/fe67610a0b8fe7c1ca3f6196900c61e0 to your computer and use it in GitHub Desktop.
Save aindong/fe67610a0b8fe7c1ca3f6196900c61e0 to your computer and use it in GitHub Desktop.
Sample response
@GET("/v1/categories")
void getMessages(Callback<BaseResponse<CategoriesResponse>> callback);
public class CategoriesResponse extends BaseResponse<List<Message>> {
@SerializedName("categories") List<Category> categories;
}
public class Category {
private String id;
private String name;
private String color;
private String icon;
}
public class BaseResponse<T> {
@SerializedName("data") public T data;
}
{
"data": [
{
"object": "Category",
"id": "zekYVdBgoA",
"name": "Spaghetti",
"color": "#00ff0c",
"icon": "http://192.168.1.127:8000/storage/icons/5aa787271dd44.png",
"created_at": {
"date": "2018-03-13 08:09:11.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2018-03-13 08:09:11.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"readable_created_at": "2 weeks ago",
"readable_updated_at": "2 weeks ago"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment