// Path: src/main/java/com/rmn/testrail/parameters/ApiFilterValue.java
// public class ApiFilterValue {
//     private ApiFilter apiFilter;
//     private String value;
//     public ApiFilterValue(ApiFilter apiFilter, String value) {
//         this.apiFilter = apiFilter;
//         this.value = value;
//     }
// 
//     public String append() {
//         return "&" + this.apiFilter.getFilter() + "=" + value;
//     }
// }
// 
// Path: src/main/java/com/rmn/testrail/parameters/GetResultsFilter.java
// public enum GetResultsFilter implements ApiFilter {
//     //Request filters for get_results
//     LIMIT("limit"),
//     OFFSET("offset"),
//     STATUS_ID("status_id");
// 
//     private String filter;
//     GetResultsFilter(String filter) { this.filter = filter; }
// 
//     public String getFilter() {
//         return filter;
//     }
// }


import com.rmn.testrail.parameters.ApiFilterValue;
import com.rmn.testrail.parameters.GetResultsFilter;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import java.util.List;
    private Integer assignedtoId;
    public Integer getAssignedtoId() { return assignedtoId; }
    public void setAssignedtoId(Integer assignedtoId) { this.assignedtoId = assignedtoId; }

    @JsonProperty("run_id")
    private Integer runId;
    public Integer getRunId() { return runId; }
    public void setRunId(Integer runId) { this.runId = runId; }

    @JsonProperty("case_id")
    private Integer caseId;
    public Integer getCaseId() { return caseId; }
    public void setCaseId(Integer caseId) { this.caseId = caseId; }

    @JsonProperty("milestone_id")
    private Integer milestoneId;
    public Integer getMilestoneId() { return milestoneId; }
    public void setMilestoneId(Integer milestoneId) { this.milestoneId = milestoneId; }

    @JsonProperty("refs")
    private String refs;
    public String getRefs() { return refs; }
    public void setRefs(String refs) { this.refs = refs; }

    /**
     * Returns the list of test results (most recent first) associated with this TestInstance
     * @param limit A limit to the number of results you want to see (1 will give you the single most recent)
     * @return The number of TestResults specified by the limit, in descending chron order (i.e. newest to oldest)
     */
    public List<TestResult> getResults(int limit) {
// Path: src/main/java/com/rmn/testrail/parameters/ApiFilterValue.java
// public class ApiFilterValue {
//     private ApiFilter apiFilter;
//     private String value;
//     public ApiFilterValue(ApiFilter apiFilter, String value) {
//         this.apiFilter = apiFilter;
//         this.value = value;
//     }
// 
//     public String append() {
//         return "&" + this.apiFilter.getFilter() + "=" + value;
//     }
// }
// 
// Path: src/main/java/com/rmn/testrail/parameters/GetResultsFilter.java
// public enum GetResultsFilter implements ApiFilter {
//     //Request filters for get_results
//     LIMIT("limit"),
//     OFFSET("offset"),
//     STATUS_ID("status_id");
// 
//     private String filter;
//     GetResultsFilter(String filter) { this.filter = filter; }
// 
//     public String getFilter() {
//         return filter;
//     }
// }


// Path: src/main/java/com/rmn/testrail/entity/TestInstance.java
import com.rmn.testrail.parameters.ApiFilterValue;
import com.rmn.testrail.parameters.GetResultsFilter;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import java.util.List;

    private Integer assignedtoId;
    public Integer getAssignedtoId() { return assignedtoId; }
    public void setAssignedtoId(Integer assignedtoId) { this.assignedtoId = assignedtoId; }

    @JsonProperty("run_id")
    private Integer runId;
    public Integer getRunId() { return runId; }
    public void setRunId(Integer runId) { this.runId = runId; }

    @JsonProperty("case_id")
    private Integer caseId;
    public Integer getCaseId() { return caseId; }
    public void setCaseId(Integer caseId) { this.caseId = caseId; }

    @JsonProperty("milestone_id")
    private Integer milestoneId;
    public Integer getMilestoneId() { return milestoneId; }
    public void setMilestoneId(Integer milestoneId) { this.milestoneId = milestoneId; }

    @JsonProperty("refs")
    private String refs;
    public String getRefs() { return refs; }
    public void setRefs(String refs) { this.refs = refs; }

    /**
     * Returns the list of test results (most recent first) associated with this TestInstance
     * @param limit A limit to the number of results you want to see (1 will give you the single most recent)
     * @return The number of TestResults specified by the limit, in descending chron order (i.e. newest to oldest)
     */
    public List<TestResult> getResults(int limit) {
        return getTestRailService().getTestResults(this.getId(), new ApiFilterValue(GetResultsFilter.LIMIT, Integer.toString(limit)));