import 'package:servicestack/servicestack.dart';
class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, IConvertible
{
/**
* The API Key required for authentication
*/
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
String? apiKey;
/**
* Latitude of the user making this request
*/
// @ApiMember(DataType="double", Description="Latitude of the user making this request")
double? latitude;
/**
* Longitude of the user making this request
*/
// @ApiMember(DataType="double", Description="Longitude of the user making this request")
double? longitude;
ApiServiceRequest({this.apiKey,this.latitude,this.longitude});
ApiServiceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
apiKey = json['apiKey'];
latitude = JsonConverters.toDouble(json['latitude']);
longitude = JsonConverters.toDouble(json['longitude']);
return this;
}
Map<String, dynamic> toJson() => {
'apiKey': apiKey,
'latitude': latitude,
'longitude': longitude
};
getTypeName() => "ApiServiceRequest";
TypeContext? context = _ctx;
}
class ApiServiceResponse implements IServiceResponse, IConvertible
{
String? description;
String? heading;
bool? wasSuccessful;
dynamic? modelState;
ApiServiceResponse({this.description,this.heading,this.wasSuccessful,this.modelState});
ApiServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
description = json['description'];
heading = json['heading'];
wasSuccessful = json['wasSuccessful'];
modelState = JsonConverters.fromJson(json['modelState'],'dynamic',context!);
return this;
}
Map<String, dynamic> toJson() => {
'description': description,
'heading': heading,
'wasSuccessful': wasSuccessful,
'modelState': JsonConverters.toJson(modelState,'dynamic',context!)
};
getTypeName() => "ApiServiceResponse";
TypeContext? context = _ctx;
}
class SlotStatus
{
static const SlotStatus Available = const SlotStatus._(0);
static const SlotStatus Closed = const SlotStatus._(1);
static const SlotStatus Booked = const SlotStatus._(2);
static const SlotStatus UserBooked = const SlotStatus._(3);
static const SlotStatus GroupBooked = const SlotStatus._(4);
static const SlotStatus ToBook = const SlotStatus._(5);
final int _value;
const SlotStatus._(this._value);
int get value => _value;
static List<SlotStatus> get values => const [Available,Closed,Booked,UserBooked,GroupBooked,ToBook];
}
class UserCustomFieldData implements IConvertible
{
String? id;
String? value;
String? name;
bool? optional;
UserCustomFieldData({this.id,this.value,this.name,this.optional});
UserCustomFieldData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
value = json['value'];
name = json['name'];
optional = json['optional'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'value': value,
'name': name,
'optional': optional
};
getTypeName() => "UserCustomFieldData";
TypeContext? context = _ctx;
}
class GuestData implements IConvertible
{
String? name;
String? emailAddress;
String? mobileNumber;
List<UserCustomFieldData>? userCustomFields;
bool? isAlreadyUser;
int? systemUserId;
GuestData({this.name,this.emailAddress,this.mobileNumber,this.userCustomFields,this.isAlreadyUser,this.systemUserId});
GuestData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
emailAddress = json['emailAddress'];
mobileNumber = json['mobileNumber'];
userCustomFields = JsonConverters.fromJson(json['userCustomFields'],'List<UserCustomFieldData>',context!);
isAlreadyUser = json['isAlreadyUser'];
systemUserId = json['systemUserId'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'emailAddress': emailAddress,
'mobileNumber': mobileNumber,
'userCustomFields': JsonConverters.toJson(userCustomFields,'List<UserCustomFieldData>',context!),
'isAlreadyUser': isAlreadyUser,
'systemUserId': systemUserId
};
getTypeName() => "GuestData";
TypeContext? context = _ctx;
}
class SlotData implements IConvertible
{
String? start;
String? end;
SlotStatus? status;
int? bookingId;
bool? remindStart;
bool? remind30Mins;
bool? remind1Hour;
bool? remind6Hours;
bool? remind12Hours;
bool? remind1Day;
bool? remind1Week;
double? billableAmount;
String? bookedByName;
double? billableHours;
double? slotLength;
GuestData? userData;
String? extraRequirements;
SlotData({this.start,this.end,this.status,this.bookingId,this.remindStart,this.remind30Mins,this.remind1Hour,this.remind6Hours,this.remind12Hours,this.remind1Day,this.remind1Week,this.billableAmount,this.bookedByName,this.billableHours,this.slotLength,this.userData,this.extraRequirements});
SlotData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
start = json['start'];
end = json['end'];
status = JsonConverters.fromJson(json['status'],'SlotStatus',context!);
bookingId = json['bookingId'];
remindStart = json['remindStart'];
remind30Mins = json['remind30Mins'];
remind1Hour = json['remind1Hour'];
remind6Hours = json['remind6Hours'];
remind12Hours = json['remind12Hours'];
remind1Day = json['remind1Day'];
remind1Week = json['remind1Week'];
billableAmount = JsonConverters.toDouble(json['billableAmount']);
bookedByName = json['bookedByName'];
billableHours = JsonConverters.toDouble(json['billableHours']);
slotLength = JsonConverters.toDouble(json['slotLength']);
userData = JsonConverters.fromJson(json['userData'],'GuestData',context!);
extraRequirements = json['extraRequirements'];
return this;
}
Map<String, dynamic> toJson() => {
'start': start,
'end': end,
'status': JsonConverters.toJson(status,'SlotStatus',context!),
'bookingId': bookingId,
'remindStart': remindStart,
'remind30Mins': remind30Mins,
'remind1Hour': remind1Hour,
'remind6Hours': remind6Hours,
'remind12Hours': remind12Hours,
'remind1Day': remind1Day,
'remind1Week': remind1Week,
'billableAmount': billableAmount,
'bookedByName': bookedByName,
'billableHours': billableHours,
'slotLength': slotLength,
'userData': JsonConverters.toJson(userData,'GuestData',context!),
'extraRequirements': extraRequirements
};
getTypeName() => "SlotData";
TypeContext? context = _ctx;
}
class ScheduleDayData implements IConvertible
{
String? date;
List<SlotData>? slots;
ScheduleDayData({this.date,this.slots});
ScheduleDayData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
date = json['date'];
slots = JsonConverters.fromJson(json['slots'],'List<SlotData>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'date': date,
'slots': JsonConverters.toJson(slots,'List<SlotData>',context!)
};
getTypeName() => "ScheduleDayData";
TypeContext? context = _ctx;
}
class RatesItem implements IConvertible
{
double? rate;
int? minutes;
RatesItem({this.rate,this.minutes});
RatesItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
rate = JsonConverters.toDouble(json['rate']);
minutes = json['minutes'];
return this;
}
Map<String, dynamic> toJson() => {
'rate': rate,
'minutes': minutes
};
getTypeName() => "RatesItem";
TypeContext? context = _ctx;
}
class FacilityData implements IConvertible
{
int? facilityId;
String? facilityGuid;
String? name;
String? description;
String? nextAvailable;
bool? hasNextAvailable;
List<RatesItem>? rates;
String? themeColor;
String? bookingNotes;
int? leadTime;
int? venueId;
bool? allowExtraRequirements;
FacilityData({this.facilityId,this.facilityGuid,this.name,this.description,this.nextAvailable,this.hasNextAvailable,this.rates,this.themeColor,this.bookingNotes,this.leadTime,this.venueId,this.allowExtraRequirements});
FacilityData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
facilityId = json['facilityId'];
facilityGuid = json['facilityGuid'];
name = json['name'];
description = json['description'];
nextAvailable = json['nextAvailable'];
hasNextAvailable = json['hasNextAvailable'];
rates = JsonConverters.fromJson(json['rates'],'List<RatesItem>',context!);
themeColor = json['themeColor'];
bookingNotes = json['bookingNotes'];
leadTime = json['leadTime'];
venueId = json['venueId'];
allowExtraRequirements = json['allowExtraRequirements'];
return this;
}
Map<String, dynamic> toJson() => {
'facilityId': facilityId,
'facilityGuid': facilityGuid,
'name': name,
'description': description,
'nextAvailable': nextAvailable,
'hasNextAvailable': hasNextAvailable,
'rates': JsonConverters.toJson(rates,'List<RatesItem>',context!),
'themeColor': themeColor,
'bookingNotes': bookingNotes,
'leadTime': leadTime,
'venueId': venueId,
'allowExtraRequirements': allowExtraRequirements
};
getTypeName() => "FacilityData";
TypeContext? context = _ctx;
}
class GetFacilityScheduleResponse extends ApiServiceResponse implements IConvertible
{
List<ScheduleDayData>? schedule;
String? bookAheadMaxDate;
int? openHour;
int? closeHour;
int? duration;
bool? isCoordinator;
int? facilityTimeOffset;
FacilityData? facility;
String? venueName;
bool? allowGuests;
bool? allowExtraRequirements;
bool? allowBookingInProgress;
GetFacilityScheduleResponse({this.schedule,this.bookAheadMaxDate,this.openHour,this.closeHour,this.duration,this.isCoordinator,this.facilityTimeOffset,this.facility,this.venueName,this.allowGuests,this.allowExtraRequirements,this.allowBookingInProgress});
GetFacilityScheduleResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
schedule = JsonConverters.fromJson(json['schedule'],'List<ScheduleDayData>',context!);
bookAheadMaxDate = json['bookAheadMaxDate'];
openHour = json['openHour'];
closeHour = json['closeHour'];
duration = json['duration'];
isCoordinator = json['isCoordinator'];
facilityTimeOffset = json['facilityTimeOffset'];
facility = JsonConverters.fromJson(json['facility'],'FacilityData',context!);
venueName = json['venueName'];
allowGuests = json['allowGuests'];
allowExtraRequirements = json['allowExtraRequirements'];
allowBookingInProgress = json['allowBookingInProgress'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'schedule': JsonConverters.toJson(schedule,'List<ScheduleDayData>',context!),
'bookAheadMaxDate': bookAheadMaxDate,
'openHour': openHour,
'closeHour': closeHour,
'duration': duration,
'isCoordinator': isCoordinator,
'facilityTimeOffset': facilityTimeOffset,
'facility': JsonConverters.toJson(facility,'FacilityData',context!),
'venueName': venueName,
'allowGuests': allowGuests,
'allowExtraRequirements': allowExtraRequirements,
'allowBookingInProgress': allowBookingInProgress
});
getTypeName() => "GetFacilityScheduleResponse";
TypeContext? context = _ctx;
}
class GetFacilitySchedule extends ApiServiceRequest implements IConvertible
{
int? facilityId;
DateTime? start;
DateTime? end;
GetFacilitySchedule({this.facilityId,this.start,this.end});
GetFacilitySchedule.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
facilityId = json['facilityId'];
start = JsonConverters.fromJson(json['start'],'DateTime',context!);
end = JsonConverters.fromJson(json['end'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'facilityId': facilityId,
'start': JsonConverters.toJson(start,'DateTime',context!),
'end': JsonConverters.toJson(end,'DateTime',context!)
});
getTypeName() => "GetFacilitySchedule";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'reservation.api.dev.86degrees.com', types: <String, TypeInfo> {
'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
'SlotStatus': TypeInfo(TypeOf.Enum, enumValues:SlotStatus.values),
'UserCustomFieldData': TypeInfo(TypeOf.Class, create:() => UserCustomFieldData()),
'GuestData': TypeInfo(TypeOf.Class, create:() => GuestData()),
'List<UserCustomFieldData>': TypeInfo(TypeOf.Class, create:() => <UserCustomFieldData>[]),
'SlotData': TypeInfo(TypeOf.Class, create:() => SlotData()),
'ScheduleDayData': TypeInfo(TypeOf.Class, create:() => ScheduleDayData()),
'List<SlotData>': TypeInfo(TypeOf.Class, create:() => <SlotData>[]),
'RatesItem': TypeInfo(TypeOf.Class, create:() => RatesItem()),
'FacilityData': TypeInfo(TypeOf.Class, create:() => FacilityData()),
'List<RatesItem>': TypeInfo(TypeOf.Class, create:() => <RatesItem>[]),
'GetFacilityScheduleResponse': TypeInfo(TypeOf.Class, create:() => GetFacilityScheduleResponse()),
'List<ScheduleDayData>': TypeInfo(TypeOf.Class, create:() => <ScheduleDayData>[]),
'GetFacilitySchedule': TypeInfo(TypeOf.Class, create:() => GetFacilitySchedule()),
});
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 /json/reply/GetFacilitySchedule HTTP/1.1
Host: reservation.api.dev.86degrees.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"facilityId":0,"start":"0001-01-01T00:00:00.0000000","end":"0001-01-01T00:00:00.0000000","apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"schedule":[{"date":"String","slots":[{"start":"String","end":"String","status":0,"bookingId":0,"remindStart":false,"remind30Mins":false,"remind1Hour":false,"remind6Hours":false,"remind12Hours":false,"remind1Day":false,"remind1Week":false,"billableAmount":0,"bookedByName":"String","billableHours":0,"slotLength":0,"extraRequirements":"String"}]}],"bookAheadMaxDate":"String","openHour":0,"closeHour":0,"duration":0,"isCoordinator":false,"facilityTimeOffset":0,"venueName":"String","allowGuests":false,"allowExtraRequirements":false,"allowBookingInProgress":false,"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}