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 FindBookingRateResponse extends ApiServiceResponse implements IConvertible
{
List<SlotData>? updatedSlot;
List<double>? rates;
bool? wasMerge;
FindBookingRateResponse({this.updatedSlot,this.rates,this.wasMerge});
FindBookingRateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
updatedSlot = JsonConverters.fromJson(json['updatedSlot'],'List<SlotData>',context!);
rates = JsonConverters.fromJson(json['rates'],'List<double>',context!);
wasMerge = json['wasMerge'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'updatedSlot': JsonConverters.toJson(updatedSlot,'List<SlotData>',context!),
'rates': JsonConverters.toJson(rates,'List<double>',context!),
'wasMerge': wasMerge
});
getTypeName() => "FindBookingRateResponse";
TypeContext? context = _ctx;
}
class FindBookingRate extends ApiServiceRequest implements IConvertible
{
int? facilityId;
int? bookingUserId;
List<SlotData>? requestedSlots;
bool? isNew;
bool? isGuest;
FindBookingRate({this.facilityId,this.bookingUserId,this.requestedSlots,this.isNew,this.isGuest});
FindBookingRate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
facilityId = json['facilityId'];
bookingUserId = json['bookingUserId'];
requestedSlots = JsonConverters.fromJson(json['requestedSlots'],'List<SlotData>',context!);
isNew = json['isNew'];
isGuest = json['isGuest'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'facilityId': facilityId,
'bookingUserId': bookingUserId,
'requestedSlots': JsonConverters.toJson(requestedSlots,'List<SlotData>',context!),
'isNew': isNew,
'isGuest': isGuest
});
getTypeName() => "FindBookingRate";
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()),
'FindBookingRateResponse': TypeInfo(TypeOf.Class, create:() => FindBookingRateResponse()),
'List<SlotData>': TypeInfo(TypeOf.Class, create:() => <SlotData>[]),
'FindBookingRate': TypeInfo(TypeOf.Class, create:() => FindBookingRate()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsonl/reply/FindBookingRate HTTP/1.1
Host: reservation.api.dev.86degrees.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"facilityId":0,"bookingUserId":0,"requestedSlots":[{"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"}],"isNew":false,"isGuest":false,"apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"updatedSlot":[{"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"}],"rates":[0],"wasMerge":false,"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}