| 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 .xml suffix or ?format=xml
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/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ResSummaryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
<PageNumber>0</PageNumber>
<PageSize>0</PageSize>
<RecordsAvailable>0</RecordsAvailable>
<RecordsReturned>0</RecordsReturned>
<Status>Success</Status>
<StatusMessage>String</StatusMessage>
<Records xmlns:d2p1="http://schemas.datacontract.org/2004/07/Cendyn.CenRes.DataLib.ViewModels">
<d2p1:ReservationSummary>
<d2p1:CancellationDate>0001-01-01T00:00:00</d2p1:CancellationDate>
<d2p1:CancellationID>String</d2p1:CancellationID>
<d2p1:CendynPropertyId>String</d2p1:CendynPropertyId>
<d2p1:CentralResNum>String</d2p1:CentralResNum>
<d2p1:CompanyName>String</d2p1:CompanyName>
<d2p1:ConfirmationNum>String</d2p1:ConfirmationNum>
<d2p1:ExternalProfileId>String</d2p1:ExternalProfileId>
<d2p1:ExternalProfileId2>String</d2p1:ExternalProfileId2>
<d2p1:ExternalResID1>String</d2p1:ExternalResID1>
<d2p1:ExternalResID2>String</d2p1:ExternalResID2>
<d2p1:FirstName>String</d2p1:FirstName>
<d2p1:LastName>String</d2p1:LastName>
<d2p1:LastUpdated>0001-01-01T00:00:00</d2p1:LastUpdated>
<d2p1:MarketCodeCategory>String</d2p1:MarketCodeCategory>
<d2p1:MarketRegionCode>String</d2p1:MarketRegionCode>
<d2p1:MarketSegmentCode>String</d2p1:MarketSegmentCode>
<d2p1:NumAdults>0</d2p1:NumAdults>
<d2p1:NumChildren>0</d2p1:NumChildren>
<d2p1:NumRooms>0</d2p1:NumRooms>
<d2p1:NumYouths>0</d2p1:NumYouths>
<d2p1:PropertyName>String</d2p1:PropertyName>
<d2p1:RateCode>String</d2p1:RateCode>
<d2p1:ResArriveDate>0001-01-01T00:00:00</d2p1:ResArriveDate>
<d2p1:ResDepartDate>0001-01-01T00:00:00</d2p1:ResDepartDate>
<d2p1:ResStatusCode>String</d2p1:ResStatusCode>
<d2p1:ResTypeCode>String</d2p1:ResTypeCode>
<d2p1:RoomNumber>String</d2p1:RoomNumber>
<d2p1:RoomTypeCode>String</d2p1:RoomTypeCode>
<d2p1:TotalOtherRevenue>0</d2p1:TotalOtherRevenue>
<d2p1:TotalRevenue>0</d2p1:TotalRevenue>
<d2p1:TotalRoomNights>0</d2p1:TotalRoomNights>
<d2p1:TotalRoomRevenue>0</d2p1:TotalRoomRevenue>
<d2p1:TotalTax>0</d2p1:TotalTax>
</d2p1:ReservationSummary>
</Records>
</ResSummaryResponse>