Retrofit multiple JSON Response

Why can’t I assign a value to status during JSON response. How to read the integer status? Thanks for help !

Model:
public class JsonResponse {
    public String code;
    public Integer status;

    public String getCode() { return code; }
    public Integer getStatus() { return status; }

}

Response JSON:
{
    "code": "jwt_auth_valid_token",
    "data": {
        "status": 200
    }
}

Result: getStatus(): Null

Answer

Because status is inside object called data so you should create data class that will save the status for example

public class Data {
    public int status;
}

public class JsonResponse {
    public String code;
    public Data data;

    public String getCode() { return code; }
    public Integer getStatus() { return data.status;}

}