| Required role: | API |
| All Verbs | /api/Query/Staff |
|---|
import Foundation
import ServiceStack
// @AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Staff")
public class FindStaff : QueryDb<StaffInstance>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class StaffInstance : Codable
{
public var staffId:Int?
public var name:String?
public var schedule:ScheduleInstance?
// @References(typeof(ScheduleInstance))
public var scheduleId:Int?
public var deleted:Bool?
public var demo:Bool?
public var group:String?
public var profile:String?
public var firstAidTrained:Bool?
public var dbsCheck:Date?
public var insuranceExpires:Date?
required public init(){}
}
public class ScheduleInstance : Codable
{
public var scheduleId:Int?
public var name:String?
public var Description:String?
@TimeSpan public var mondayFrom:TimeInterval?
@TimeSpan public var mondayTo:TimeInterval?
@TimeSpan public var tuesdayFrom:TimeInterval?
@TimeSpan public var tuesdayTo:TimeInterval?
@TimeSpan public var wednesdayFrom:TimeInterval?
@TimeSpan public var wednesdayTo:TimeInterval?
@TimeSpan public var thursdayFrom:TimeInterval?
@TimeSpan public var thursdayTo:TimeInterval?
@TimeSpan public var fridayFrom:TimeInterval?
@TimeSpan public var fridayTo:TimeInterval?
@TimeSpan public var saturdayFrom:TimeInterval?
@TimeSpan public var saturdayTo:TimeInterval?
@TimeSpan public var sundayFrom:TimeInterval?
@TimeSpan public var sundayTo:TimeInterval?
public var scheduleType:Int?
public var deleted:Bool?
public var demo:Bool?
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
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: text/jsv
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-01,
InsuranceExpires: 0001-01-01
}
],
Meta:
{
String: String
},
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}