POST, GET | /api/GetTimeSlots |
---|
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 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 TimeSlotGeneric implements IConvertible
{
// @DataMember
int? Id;
// @DataMember
DateTime? DateTime;
// @DataMember
int? SlotsOpen;
// @DataMember
String? Location;
// @DataMember
String? Type;
TimeSlotGeneric({this.Id,this.DateTime,this.SlotsOpen,this.Location,this.Type});
TimeSlotGeneric.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
DateTime = JsonConverters.fromJson(json['DateTime'],'DateTime',context!);
SlotsOpen = json['SlotsOpen'];
Location = json['Location'];
Type = json['Type'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'DateTime': JsonConverters.toJson(DateTime,'DateTime',context!),
'SlotsOpen': SlotsOpen,
'Location': Location,
'Type': Type
};
getTypeName() => "TimeSlotGeneric";
TypeContext? context = _ctx;
}
// @DataContract
class GetTimeSlotsResponse extends BaseResponse implements IConvertible
{
// @DataMember
List<TimeSlotGeneric>? TimeSlots;
GetTimeSlotsResponse({this.TimeSlots});
GetTimeSlotsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
TimeSlots = JsonConverters.fromJson(json['TimeSlots'],'List<TimeSlotGeneric>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'TimeSlots': JsonConverters.toJson(TimeSlots,'List<TimeSlotGeneric>',context!)
});
getTypeName() => "GetTimeSlotsResponse";
TypeContext? context = _ctx;
}
/**
* GetTimeSlotsRequires active-e Contracts Service, active-e Service Ticket Service, active-e Lesson Scheduling Service, active-e Vortx E-Commerce Service, or active-e 3rd Party E-Commerce Service
*/
// @DataContract
class GetTimeSlotsRequest extends BaseRequest implements IConvertible
{
// @DataMember
DateTime? DateFrom;
// @DataMember
DateTime? DateTo;
// @DataMember
DateTime? TimeFrom;
// @DataMember
DateTime? TimeTo;
// @DataMember
String? Location;
// @DataMember
bool? ShowOpenSlots;
// @DataMember
bool? ShowReservedSlots;
/**
* If sent, only Time Slots of the sent type are returned. Valid options are STORE and DELIVERY.
*/
// @DataMember
// @ApiMember(DataType="string", Description="If sent, only Time Slots of the sent type are returned. Valid options are STORE and DELIVERY.", Name="Type", ParameterType="query")
String? Type;
GetTimeSlotsRequest({this.DateFrom,this.DateTo,this.TimeFrom,this.TimeTo,this.Location,this.ShowOpenSlots,this.ShowReservedSlots,this.Type});
GetTimeSlotsRequest.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!);
Location = json['Location'];
ShowOpenSlots = json['ShowOpenSlots'];
ShowReservedSlots = json['ShowReservedSlots'];
Type = json['Type'];
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!),
'Location': Location,
'ShowOpenSlots': ShowOpenSlots,
'ShowReservedSlots': ShowReservedSlots,
'Type': Type
});
getTypeName() => "GetTimeSlotsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'active_ewebservice.biz', types: <String, TypeInfo> {
'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
'BaseResponseResult': TypeInfo(TypeOf.Class, create:() => BaseResponseResult()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'TimeSlotGeneric': TypeInfo(TypeOf.Class, create:() => TimeSlotGeneric()),
'GetTimeSlotsResponse': TypeInfo(TypeOf.Class, create:() => GetTimeSlotsResponse()),
'List<TimeSlotGeneric>': TypeInfo(TypeOf.Class, create:() => <TimeSlotGeneric>[]),
'GetTimeSlotsRequest': TypeInfo(TypeOf.Class, create:() => GetTimeSlotsRequest()),
});
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/GetTimeSlots HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetTimeSlotsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<DateFrom>0001-01-01T00:00:00</DateFrom>
<DateTo>0001-01-01T00:00:00</DateTo>
<Location>String</Location>
<ShowOpenSlots>false</ShowOpenSlots>
<ShowReservedSlots>false</ShowReservedSlots>
<TimeFrom>0001-01-01T00:00:00</TimeFrom>
<TimeTo>0001-01-01T00:00:00</TimeTo>
<Type>String</Type>
</GetTimeSlotsRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetTimeSlotsResponse 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> <TimeSlots xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM"> <d2p1:TimeSlotGeneric> <d2p1:DateTime>0001-01-01T00:00:00</d2p1:DateTime> <d2p1:Id>0</d2p1:Id> <d2p1:Location>String</d2p1:Location> <d2p1:SlotsOpen>0</d2p1:SlotsOpen> <d2p1:Type>String</d2p1:Type> </d2p1:TimeSlotGeneric> </TimeSlots> </GetTimeSlotsResponse>