Required role: | API |
All Verbs | /api/Query/Staff |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubManager.Api.Services.Query;
namespace ClubManager.Api.Services.Query
{
[AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Staff")]
public partial class FindStaff
: QueryDb<StaffInstance>
{
}
public partial class ScheduleInstance
{
public virtual int ScheduleId { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual TimeSpan? MondayFrom { get; set; }
public virtual TimeSpan? MondayTo { get; set; }
public virtual TimeSpan? TuesdayFrom { get; set; }
public virtual TimeSpan? TuesdayTo { get; set; }
public virtual TimeSpan? WednesdayFrom { get; set; }
public virtual TimeSpan? WednesdayTo { get; set; }
public virtual TimeSpan? ThursdayFrom { get; set; }
public virtual TimeSpan? ThursdayTo { get; set; }
public virtual TimeSpan? FridayFrom { get; set; }
public virtual TimeSpan? FridayTo { get; set; }
public virtual TimeSpan? SaturdayFrom { get; set; }
public virtual TimeSpan? SaturdayTo { get; set; }
public virtual TimeSpan? SundayFrom { get; set; }
public virtual TimeSpan? SundayTo { get; set; }
public virtual int ScheduleType { get; set; }
public virtual bool Deleted { get; set; }
public virtual bool Demo { get; set; }
}
public partial class StaffInstance
{
public virtual int StaffId { get; set; }
public virtual string Name { get; set; }
public virtual ScheduleInstance Schedule { get; set; }
[References(typeof(ClubManager.Api.Services.Query.ScheduleInstance))]
public virtual int? ScheduleId { get; set; }
public virtual bool Deleted { get; set; }
public virtual bool Demo { get; set; }
public virtual string Group { get; set; }
public virtual string Profile { get; set; }
public virtual bool FirstAidTrained { get; set; }
public virtual DateTime? DBSCheck { get; set; }
public virtual DateTime? InsuranceExpires { get; set; }
}
}
namespace ServiceStack
{
[DataContract]
public partial class QueryBase
{
public QueryBase()
{
Meta = new Dictionary<string, string>{};
}
[DataMember(Order=1)]
public virtual int? Skip { get; set; }
[DataMember(Order=2)]
public virtual int? Take { get; set; }
[DataMember(Order=3)]
public virtual string OrderBy { get; set; }
[DataMember(Order=4)]
public virtual string OrderByDesc { get; set; }
[DataMember(Order=5)]
public virtual string Include { get; set; }
[DataMember(Order=6)]
public virtual string Fields { get; set; }
[DataMember(Order=7)]
public virtual Dictionary<string, string> Meta { get; set; }
}
public partial class QueryDb<T>
: QueryBase
{
}
[DataContract]
public partial class QueryResponse<T>
{
public QueryResponse()
{
Results = new List<T>{};
Meta = new Dictionary<string, string>{};
}
[DataMember(Order=1)]
public virtual int Offset { get; set; }
[DataMember(Order=2)]
public virtual int Total { get; set; }
[DataMember(Order=3)]
public virtual List<T> Results { get; set; }
[DataMember(Order=4)]
public virtual Dictionary<string, string> Meta { get; set; }
[DataMember(Order=5)]
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
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"}}}