Required role: | API |
All Verbs | /api/Query/Staff |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
@AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Staff")
open class FindStaff : QueryDb<StaffInstance>()
{
}
open class QueryDb<T> : QueryBase()
{
}
@DataContract
open class QueryBase
{
@DataMember(Order=1)
var Skip:Int? = null
@DataMember(Order=2)
var Take:Int? = null
@DataMember(Order=3)
var OrderBy:String? = null
@DataMember(Order=4)
var OrderByDesc:String? = null
@DataMember(Order=5)
var Include:String? = null
@DataMember(Order=6)
var Fields:String? = null
@DataMember(Order=7)
var Meta:HashMap<String,String> = HashMap<String,String>()
}
open class StaffInstance
{
var StaffId:Int? = null
var Name:String? = null
var Schedule:ScheduleInstance? = null
@References(ScheduleInstance.class)
var ScheduleId:Int? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
var Group:String? = null
var Profile:String? = null
var FirstAidTrained:Boolean? = null
var DBSCheck:Date? = null
var InsuranceExpires:Date? = null
}
open class ScheduleInstance
{
var ScheduleId:Int? = null
var Name:String? = null
var Description:String? = null
var MondayFrom:TimeSpan? = null
var MondayTo:TimeSpan? = null
var TuesdayFrom:TimeSpan? = null
var TuesdayTo:TimeSpan? = null
var WednesdayFrom:TimeSpan? = null
var WednesdayTo:TimeSpan? = null
var ThursdayFrom:TimeSpan? = null
var ThursdayTo:TimeSpan? = null
var FridayFrom:TimeSpan? = null
var FridayTo:TimeSpan? = null
var SaturdayFrom:TimeSpan? = null
var SaturdayTo:TimeSpan? = null
var SundayFrom:TimeSpan? = null
var SundayTo:TimeSpan? = null
var ScheduleType:Int? = null
var Deleted:Boolean? = null
var Demo:Boolean? = null
}
@DataContract
open class QueryResponse<T>
{
@DataMember(Order=1)
var Offset:Int? = null
@DataMember(Order=2)
var Total:Int? = null
@DataMember(Order=3)
var Results:ArrayList<T> = ArrayList<T>()
@DataMember(Order=4)
var Meta:HashMap<String,String> = HashMap<String,String>()
@DataMember(Order=5)
var ResponseStatus:ResponseStatus? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/Query/Staff HTTP/1.1
Host: api.clubmanagercentral.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Skip":0,"Take":0,"OrderBy":"String","OrderByDesc":"String","Include":"String","Fields":"String","Meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Offset":0,"Total":0,"Results":[{"StaffId":0,"Name":"String","Schedule":{"ScheduleId":0,"Name":"String","Description":"String","MondayFrom":"PT0S","MondayTo":"PT0S","TuesdayFrom":"PT0S","TuesdayTo":"PT0S","WednesdayFrom":"PT0S","WednesdayTo":"PT0S","ThursdayFrom":"PT0S","ThursdayTo":"PT0S","FridayFrom":"PT0S","FridayTo":"PT0S","SaturdayFrom":"PT0S","SaturdayTo":"PT0S","SundayFrom":"PT0S","SundayTo":"PT0S","ScheduleType":0,"Deleted":false,"Demo":false},"ScheduleId":0,"Deleted":false,"Demo":false,"Group":"String","Profile":"String","FirstAidTrained":false,"DBSCheck":"0001-01-01T00:00:00.0000000","InsuranceExpires":"0001-01-01T00:00:00.0000000"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}