| GET | /v2/reservation/summary/{Query} | ||
|---|---|---|---|
| GET | /v2/reservation/summary/{Query}/{CendynPropertyId} |
import 'package:servicestack/servicestack.dart';
enum RequestStatus
{
Success,
Warning,
Error,
NotAuthorized,
Failure,
}
class CenResResponse implements IConvertible
{
RequestStatus? status;
String? statusMessage;
int? recordsReturned;
int? recordsAvailable;
int? pageNumber;
int? pageSize;
CenResResponse({this.status,this.statusMessage,this.recordsReturned,this.recordsAvailable,this.pageNumber,this.pageSize});
CenResResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
status = JsonConverters.fromJson(json['status'],'RequestStatus',context!);
statusMessage = json['statusMessage'];
recordsReturned = json['recordsReturned'];
recordsAvailable = json['recordsAvailable'];
pageNumber = json['pageNumber'];
pageSize = json['pageSize'];
return this;
}
Map<String, dynamic> toJson() => {
'status': JsonConverters.toJson(status,'RequestStatus',context!),
'statusMessage': statusMessage,
'recordsReturned': recordsReturned,
'recordsAvailable': recordsAvailable,
'pageNumber': pageNumber,
'pageSize': pageSize
};
getTypeName() => "CenResResponse";
TypeContext? context = _ctx;
}
class ReservationSummary implements IConvertible
{
String? firstName;
String? lastName;
String? externalProfileId;
String? externalProfileId2;
String? externalResID1;
String? externalResID2;
String? cendynPropertyId;
String? propertyName;
String? resTypeCode;
String? resStatusCode;
String? confirmationNum;
String? centralResNum;
DateTime? resArriveDate;
DateTime? resDepartDate;
int? numRooms;
String? roomTypeCode;
String? roomNumber;
String? rateCode;
String? marketSegmentCode;
String? marketCodeCategory;
String? marketRegionCode;
String? companyName;
int? numAdults;
int? numYouths;
int? numChildren;
int? totalRoomNights;
String? cancellationID;
DateTime? cancellationDate;
double? totalOtherRevenue;
double? totalRoomRevenue;
double? totalTax;
double? totalRevenue;
DateTime? lastUpdated;
ReservationSummary({this.firstName,this.lastName,this.externalProfileId,this.externalProfileId2,this.externalResID1,this.externalResID2,this.cendynPropertyId,this.propertyName,this.resTypeCode,this.resStatusCode,this.confirmationNum,this.centralResNum,this.resArriveDate,this.resDepartDate,this.numRooms,this.roomTypeCode,this.roomNumber,this.rateCode,this.marketSegmentCode,this.marketCodeCategory,this.marketRegionCode,this.companyName,this.numAdults,this.numYouths,this.numChildren,this.totalRoomNights,this.cancellationID,this.cancellationDate,this.totalOtherRevenue,this.totalRoomRevenue,this.totalTax,this.totalRevenue,this.lastUpdated});
ReservationSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
externalProfileId = json['externalProfileId'];
externalProfileId2 = json['externalProfileId2'];
externalResID1 = json['externalResID1'];
externalResID2 = json['externalResID2'];
cendynPropertyId = json['cendynPropertyId'];
propertyName = json['propertyName'];
resTypeCode = json['resTypeCode'];
resStatusCode = json['resStatusCode'];
confirmationNum = json['confirmationNum'];
centralResNum = json['centralResNum'];
resArriveDate = JsonConverters.fromJson(json['resArriveDate'],'DateTime',context!);
resDepartDate = JsonConverters.fromJson(json['resDepartDate'],'DateTime',context!);
numRooms = json['numRooms'];
roomTypeCode = json['roomTypeCode'];
roomNumber = json['roomNumber'];
rateCode = json['rateCode'];
marketSegmentCode = json['marketSegmentCode'];
marketCodeCategory = json['marketCodeCategory'];
marketRegionCode = json['marketRegionCode'];
companyName = json['companyName'];
numAdults = json['numAdults'];
numYouths = json['numYouths'];
numChildren = json['numChildren'];
totalRoomNights = json['totalRoomNights'];
cancellationID = json['cancellationID'];
cancellationDate = JsonConverters.fromJson(json['cancellationDate'],'DateTime',context!);
totalOtherRevenue = JsonConverters.toDouble(json['totalOtherRevenue']);
totalRoomRevenue = JsonConverters.toDouble(json['totalRoomRevenue']);
totalTax = JsonConverters.toDouble(json['totalTax']);
totalRevenue = JsonConverters.toDouble(json['totalRevenue']);
lastUpdated = JsonConverters.fromJson(json['lastUpdated'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName,
'externalProfileId': externalProfileId,
'externalProfileId2': externalProfileId2,
'externalResID1': externalResID1,
'externalResID2': externalResID2,
'cendynPropertyId': cendynPropertyId,
'propertyName': propertyName,
'resTypeCode': resTypeCode,
'resStatusCode': resStatusCode,
'confirmationNum': confirmationNum,
'centralResNum': centralResNum,
'resArriveDate': JsonConverters.toJson(resArriveDate,'DateTime',context!),
'resDepartDate': JsonConverters.toJson(resDepartDate,'DateTime',context!),
'numRooms': numRooms,
'roomTypeCode': roomTypeCode,
'roomNumber': roomNumber,
'rateCode': rateCode,
'marketSegmentCode': marketSegmentCode,
'marketCodeCategory': marketCodeCategory,
'marketRegionCode': marketRegionCode,
'companyName': companyName,
'numAdults': numAdults,
'numYouths': numYouths,
'numChildren': numChildren,
'totalRoomNights': totalRoomNights,
'cancellationID': cancellationID,
'cancellationDate': JsonConverters.toJson(cancellationDate,'DateTime',context!),
'totalOtherRevenue': totalOtherRevenue,
'totalRoomRevenue': totalRoomRevenue,
'totalTax': totalTax,
'totalRevenue': totalRevenue,
'lastUpdated': JsonConverters.toJson(lastUpdated,'DateTime',context!)
};
getTypeName() => "ReservationSummary";
TypeContext? context = _ctx;
}
class ResSummaryResponse extends CenResResponse implements IConvertible
{
List<ReservationSummary>? records;
ResSummaryResponse({this.records});
ResSummaryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
records = JsonConverters.fromJson(json['records'],'List<ReservationSummary>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'records': JsonConverters.toJson(records,'List<ReservationSummary>',context!)
});
getTypeName() => "ResSummaryResponse";
TypeContext? context = _ctx;
}
enum ReservationQueryType
{
ResId,
ProfileId,
Name,
LastUpdated,
ArrivalDate,
DepartureDate,
StayDate,
DatePMSResUpdated,
}
class ResSummaryRequest implements IConvertible
{
String? cendynPropertyId;
ReservationQueryType? query;
String? id;
String? firstName;
String? lastName;
DateTime? startDate;
DateTime? endDate;
// @DataMember(Name="Limit")
int? pageSize;
// @DataMember(Name="Page")
int? pageNumber;
ResSummaryRequest({this.cendynPropertyId,this.query,this.id,this.firstName,this.lastName,this.startDate,this.endDate,this.pageSize,this.pageNumber});
ResSummaryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
cendynPropertyId = json['cendynPropertyId'];
query = JsonConverters.fromJson(json['query'],'ReservationQueryType',context!);
id = json['id'];
firstName = json['firstName'];
lastName = json['lastName'];
startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
endDate = JsonConverters.fromJson(json['endDate'],'DateTime',context!);
pageSize = json['pageSize'];
pageNumber = json['pageNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'cendynPropertyId': cendynPropertyId,
'query': JsonConverters.toJson(query,'ReservationQueryType',context!),
'id': id,
'firstName': firstName,
'lastName': lastName,
'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
'endDate': JsonConverters.toJson(endDate,'DateTime',context!),
'pageSize': pageSize,
'pageNumber': pageNumber
};
getTypeName() => "ResSummaryRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'cert.cendyn.com', types: <String, TypeInfo> {
'RequestStatus': TypeInfo(TypeOf.Enum, enumValues:RequestStatus.values),
'CenResResponse': TypeInfo(TypeOf.Class, create:() => CenResResponse()),
'ReservationSummary': TypeInfo(TypeOf.Class, create:() => ReservationSummary()),
'ResSummaryResponse': TypeInfo(TypeOf.Class, create:() => ResSummaryResponse()),
'List<ReservationSummary>': TypeInfo(TypeOf.Class, create:() => <ReservationSummary>[]),
'ReservationQueryType': TypeInfo(TypeOf.Enum, enumValues:ReservationQueryType.values),
'ResSummaryRequest': TypeInfo(TypeOf.Class, create:() => ResSummaryRequest()),
});
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.
GET /v2/reservation/summary/{Query} HTTP/1.1
Host: cert.cendyn.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"records":[{"firstName":"String","lastName":"String","externalProfileId":"String","externalProfileId2":"String","externalResID1":"String","externalResID2":"String","cendynPropertyId":"String","propertyName":"String","resTypeCode":"String","resStatusCode":"String","confirmationNum":"String","centralResNum":"String","resArriveDate":"0001-01-01T00:00:00.0000000","resDepartDate":"0001-01-01T00:00:00.0000000","numRooms":0,"roomTypeCode":"String","roomNumber":"String","rateCode":"String","marketSegmentCode":"String","marketCodeCategory":"String","marketRegionCode":"String","companyName":"String","numAdults":0,"numYouths":0,"numChildren":0,"totalRoomNights":0,"cancellationID":"String","cancellationDate":"0001-01-01T00:00:00.0000000","totalOtherRevenue":0,"totalRoomRevenue":0,"totalTax":0,"totalRevenue":0,"lastUpdated":"0001-01-01T00:00:00.0000000"}],"status":"Success","statusMessage":"String","recordsReturned":0,"recordsAvailable":0,"pageNumber":0,"pageSize":0}