POST, GET | /api/GetTeeSlots |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class BaseRequest implements IConvertible
{
/**
* This is your AIM API Key provided by Tri-Tech
*/
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
String? ApiKey;
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
String? OAuthToken;
BaseRequest({this.ApiKey,this.OAuthToken});
BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
OAuthToken = json['OAuthToken'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'OAuthToken': OAuthToken
};
getTypeName() => "BaseRequest";
TypeContext? context = _ctx;
}
// @DataContract
class BaseSecureRequest extends BaseRequest implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
String? Token;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
String? DeviceId;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
String? AppId;
BaseSecureRequest({this.Token,this.DeviceId,this.AppId});
BaseSecureRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Token = json['Token'];
DeviceId = json['DeviceId'];
AppId = json['AppId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Token': Token,
'DeviceId': DeviceId,
'AppId': AppId
});
getTypeName() => "BaseSecureRequest";
TypeContext? context = _ctx;
}
// @DataContract
class BaseResponseResult implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
String? StatusCode;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
String? Login;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
String? ErrorCode;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
String? ErrorDisplayText;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
String? ErrorMessage;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
String? DomainName;
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
String? IpAddress;
BaseResponseResult({this.StatusCode,this.Login,this.ErrorCode,this.ErrorDisplayText,this.ErrorMessage,this.DomainName,this.IpAddress});
BaseResponseResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
StatusCode = json['StatusCode'];
Login = json['Login'];
ErrorCode = json['ErrorCode'];
ErrorDisplayText = json['ErrorDisplayText'];
ErrorMessage = json['ErrorMessage'];
DomainName = json['DomainName'];
IpAddress = json['IpAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'StatusCode': StatusCode,
'Login': Login,
'ErrorCode': ErrorCode,
'ErrorDisplayText': ErrorDisplayText,
'ErrorMessage': ErrorMessage,
'DomainName': DomainName,
'IpAddress': IpAddress
};
getTypeName() => "BaseResponseResult";
TypeContext? context = _ctx;
}
// @DataContract
class BaseResponse implements IConvertible
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
BaseResponseResult? Status;
BaseResponse({this.Status});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Status = JsonConverters.fromJson(json['Status'],'BaseResponseResult',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Status': JsonConverters.toJson(Status,'BaseResponseResult',context!)
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
// @DataContract
class TeeSlotGeneric implements IConvertible
{
// @DataMember
int? Id;
// @DataMember
DateTime? DateTime;
// @DataMember
double? Cost;
// @DataMember
double? Cost2;
// @DataMember
double? Cost3;
// @DataMember
int? SlotsOpen;
// @DataMember
int? MinSlots;
// @DataMember
String? Course;
// @DataMember
String? CourseTopic;
// @DataMember
String? Location;
// @DataMember
String? Note;
// @DataMember
bool? Has18Holes;
// @DataMember
String? WebId;
// @DataMember
bool? StartingOnBack9;
TeeSlotGeneric({this.Id,this.DateTime,this.Cost,this.Cost2,this.Cost3,this.SlotsOpen,this.MinSlots,this.Course,this.CourseTopic,this.Location,this.Note,this.Has18Holes,this.WebId,this.StartingOnBack9});
TeeSlotGeneric.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
DateTime = JsonConverters.fromJson(json['DateTime'],'DateTime',context!);
Cost = JsonConverters.toDouble(json['Cost']);
Cost2 = JsonConverters.toDouble(json['Cost2']);
Cost3 = JsonConverters.toDouble(json['Cost3']);
SlotsOpen = json['SlotsOpen'];
MinSlots = json['MinSlots'];
Course = json['Course'];
CourseTopic = json['CourseTopic'];
Location = json['Location'];
Note = json['Note'];
Has18Holes = json['Has18Holes'];
WebId = json['WebId'];
StartingOnBack9 = json['StartingOnBack9'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'DateTime': JsonConverters.toJson(DateTime,'DateTime',context!),
'Cost': Cost,
'Cost2': Cost2,
'Cost3': Cost3,
'SlotsOpen': SlotsOpen,
'MinSlots': MinSlots,
'Course': Course,
'CourseTopic': CourseTopic,
'Location': Location,
'Note': Note,
'Has18Holes': Has18Holes,
'WebId': WebId,
'StartingOnBack9': StartingOnBack9
};
getTypeName() => "TeeSlotGeneric";
TypeContext? context = _ctx;
}
// @DataContract
class GetTeeSlotsResponse extends BaseResponse implements IConvertible
{
// @DataMember
List<TeeSlotGeneric>? TeeSlots;
GetTeeSlotsResponse({this.TeeSlots});
GetTeeSlotsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
TeeSlots = JsonConverters.fromJson(json['TeeSlots'],'List<TeeSlotGeneric>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'TeeSlots': JsonConverters.toJson(TeeSlots,'List<TeeSlotGeneric>',context!)
});
getTypeName() => "GetTeeSlotsResponse";
TypeContext? context = _ctx;
}
/**
* GetTeeSlotsRequires active-e Tee-Sheet Service
*/
// @DataContract
class GetTeeSlotsRequest extends BaseSecureRequest implements IConvertible
{
// @DataMember
DateTime? DateFrom;
// @DataMember
DateTime? DateTo;
// @DataMember
DateTime? TimeFrom;
// @DataMember
DateTime? TimeTo;
// @DataMember
String? Course;
// @DataMember
String? Location;
// @DataMember
String? WebId;
// @DataMember
int? SlotsRequired;
// @DataMember
bool? ShowOpenSlots;
// @DataMember
bool? ShowReservedSlots;
// @DataMember
bool? Show9HoleSlots;
// @DataMember
bool? Show18HoleSlots;
// @DataMember
bool? ShowFront9;
// @DataMember
bool? ShowBack9;
GetTeeSlotsRequest({this.DateFrom,this.DateTo,this.TimeFrom,this.TimeTo,this.Course,this.Location,this.WebId,this.SlotsRequired,this.ShowOpenSlots,this.ShowReservedSlots,this.Show9HoleSlots,this.Show18HoleSlots,this.ShowFront9,this.ShowBack9});
GetTeeSlotsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
DateFrom = JsonConverters.fromJson(json['DateFrom'],'DateTime',context!);
DateTo = JsonConverters.fromJson(json['DateTo'],'DateTime',context!);
TimeFrom = JsonConverters.fromJson(json['TimeFrom'],'DateTime',context!);
TimeTo = JsonConverters.fromJson(json['TimeTo'],'DateTime',context!);
Course = json['Course'];
Location = json['Location'];
WebId = json['WebId'];
SlotsRequired = json['SlotsRequired'];
ShowOpenSlots = json['ShowOpenSlots'];
ShowReservedSlots = json['ShowReservedSlots'];
Show9HoleSlots = json['Show9HoleSlots'];
Show18HoleSlots = json['Show18HoleSlots'];
ShowFront9 = json['ShowFront9'];
ShowBack9 = json['ShowBack9'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'DateFrom': JsonConverters.toJson(DateFrom,'DateTime',context!),
'DateTo': JsonConverters.toJson(DateTo,'DateTime',context!),
'TimeFrom': JsonConverters.toJson(TimeFrom,'DateTime',context!),
'TimeTo': JsonConverters.toJson(TimeTo,'DateTime',context!),
'Course': Course,
'Location': Location,
'WebId': WebId,
'SlotsRequired': SlotsRequired,
'ShowOpenSlots': ShowOpenSlots,
'ShowReservedSlots': ShowReservedSlots,
'Show9HoleSlots': Show9HoleSlots,
'Show18HoleSlots': Show18HoleSlots,
'ShowFront9': ShowFront9,
'ShowBack9': ShowBack9
});
getTypeName() => "GetTeeSlotsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'active_ewebservice.biz', types: <String, TypeInfo> {
'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
'BaseSecureRequest': TypeInfo(TypeOf.Class, create:() => BaseSecureRequest()),
'BaseResponseResult': TypeInfo(TypeOf.Class, create:() => BaseResponseResult()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'TeeSlotGeneric': TypeInfo(TypeOf.Class, create:() => TeeSlotGeneric()),
'GetTeeSlotsResponse': TypeInfo(TypeOf.Class, create:() => GetTeeSlotsResponse()),
'List<TeeSlotGeneric>': TypeInfo(TypeOf.Class, create:() => <TeeSlotGeneric>[]),
'GetTeeSlotsRequest': TypeInfo(TypeOf.Class, create:() => GetTeeSlotsRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/GetTeeSlots HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetTeeSlotsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<AppId>String</AppId>
<DeviceId>String</DeviceId>
<Token>String</Token>
<Course>String</Course>
<DateFrom>0001-01-01T00:00:00</DateFrom>
<DateTo>0001-01-01T00:00:00</DateTo>
<Location>String</Location>
<Show18HoleSlots>false</Show18HoleSlots>
<Show9HoleSlots>false</Show9HoleSlots>
<ShowBack9>false</ShowBack9>
<ShowFront9>false</ShowFront9>
<ShowOpenSlots>false</ShowOpenSlots>
<ShowReservedSlots>false</ShowReservedSlots>
<SlotsRequired>0</SlotsRequired>
<TimeFrom>0001-01-01T00:00:00</TimeFrom>
<TimeTo>0001-01-01T00:00:00</TimeTo>
<WebId>String</WebId>
</GetTeeSlotsRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetTeeSlotsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> <TeeSlots xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM"> <d2p1:TeeSlotGeneric> <d2p1:Cost>0</d2p1:Cost> <d2p1:Cost2>0</d2p1:Cost2> <d2p1:Cost3>0</d2p1:Cost3> <d2p1:Course>String</d2p1:Course> <d2p1:CourseTopic>String</d2p1:CourseTopic> <d2p1:DateTime>0001-01-01T00:00:00</d2p1:DateTime> <d2p1:Has18Holes>false</d2p1:Has18Holes> <d2p1:Id>0</d2p1:Id> <d2p1:Location>String</d2p1:Location> <d2p1:MinSlots>0</d2p1:MinSlots> <d2p1:Note>String</d2p1:Note> <d2p1:SlotsOpen>0</d2p1:SlotsOpen> <d2p1:StartingOnBack9>false</d2p1:StartingOnBack9> <d2p1:WebId>String</d2p1:WebId> </d2p1:TeeSlotGeneric> </TeeSlots> </GetTeeSlotsResponse>