| POST | /stayhistory/{SubscriptionId}/{CendynPropertyId} |
|---|
import 'package:servicestack/servicestack.dart';
class Response implements IConvertible
{
String? statusCode;
int? recordCount;
int? errorCount;
Response({this.statusCode,this.recordCount,this.errorCount});
Response.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
statusCode = json['statusCode'];
recordCount = json['recordCount'];
errorCount = json['errorCount'];
return this;
}
Map<String, dynamic> toJson() => {
'statusCode': statusCode,
'recordCount': recordCount,
'errorCount': errorCount
};
getTypeName() => "Response";
TypeContext? context = _ctx;
}
class UniqueIDType implements IConvertible
{
String? id;
String? type;
String? Context;
UniqueIDType({this.id,this.type,this.Context});
UniqueIDType.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
Context = json['context'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'type': type,
'context': Context
};
getTypeName() => "UniqueIDType";
TypeContext? context = _ctx;
}
class StayHistoryRevenue implements IConvertible
{
String? recordStatus;
// @DataMember(IsRequired=true)
String? revenueGroup;
// @DataMember(IsRequired=true)
String? revenueType;
// @DataMember(IsRequired=true)
double? amount;
String? currencyCode;
String? folioWindow;
DateTime? transactionDate;
DateTime? inactiveDate;
StayHistoryRevenue({this.recordStatus,this.revenueGroup,this.revenueType,this.amount,this.currencyCode,this.folioWindow,this.transactionDate,this.inactiveDate});
StayHistoryRevenue.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
recordStatus = json['recordStatus'];
revenueGroup = json['revenueGroup'];
revenueType = json['revenueType'];
amount = JsonConverters.toDouble(json['amount']);
currencyCode = json['currencyCode'];
folioWindow = json['folioWindow'];
transactionDate = JsonConverters.fromJson(json['transactionDate'],'DateTime',context!);
inactiveDate = JsonConverters.fromJson(json['inactiveDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'recordStatus': recordStatus,
'revenueGroup': revenueGroup,
'revenueType': revenueType,
'amount': amount,
'currencyCode': currencyCode,
'folioWindow': folioWindow,
'transactionDate': JsonConverters.toJson(transactionDate,'DateTime',context!),
'inactiveDate': JsonConverters.toJson(inactiveDate,'DateTime',context!)
};
getTypeName() => "StayHistoryRevenue";
TypeContext? context = _ctx;
}
class StayHistoryDailyRate implements IConvertible
{
String? recordStatus;
DateTime? transactionDate;
String? rateCode;
String? marketCode;
double? amount;
String? currencyCode;
String? roomNumber;
String? resourceID;
String? pseudoRoom;
String? roomCategory;
String? rateRoomType;
DateTime? inactiveDate;
StayHistoryDailyRate({this.recordStatus,this.transactionDate,this.rateCode,this.marketCode,this.amount,this.currencyCode,this.roomNumber,this.resourceID,this.pseudoRoom,this.roomCategory,this.rateRoomType,this.inactiveDate});
StayHistoryDailyRate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
recordStatus = json['recordStatus'];
transactionDate = JsonConverters.fromJson(json['transactionDate'],'DateTime',context!);
rateCode = json['rateCode'];
marketCode = json['marketCode'];
amount = JsonConverters.toDouble(json['amount']);
currencyCode = json['currencyCode'];
roomNumber = json['roomNumber'];
resourceID = json['resourceID'];
pseudoRoom = json['pseudoRoom'];
roomCategory = json['roomCategory'];
rateRoomType = json['rateRoomType'];
inactiveDate = JsonConverters.fromJson(json['inactiveDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'recordStatus': recordStatus,
'transactionDate': JsonConverters.toJson(transactionDate,'DateTime',context!),
'rateCode': rateCode,
'marketCode': marketCode,
'amount': amount,
'currencyCode': currencyCode,
'roomNumber': roomNumber,
'resourceID': resourceID,
'pseudoRoom': pseudoRoom,
'roomCategory': roomCategory,
'rateRoomType': rateRoomType,
'inactiveDate': JsonConverters.toJson(inactiveDate,'DateTime',context!)
};
getTypeName() => "StayHistoryDailyRate";
TypeContext? context = _ctx;
}
class StayHistory implements IConvertible
{
String? cendynPropertyID;
String? resortID;
String? externalProfileID1;
String? externalResId1;
String? crsBookNo;
String? resortBookNo;
int? resortLegNo;
String? confirmationID;
String? reservationStatus;
bool? hasDailyRooms;
String? rateRoomType;
DateTime? actualArrivalDate;
DateTime? actualDepartureDate;
DateTime? bookDate;
DateTime? bookedArrivalDate;
DateTime? bookedDepartureDate;
String? compYN;
int? adults;
int? children;
String? roomCategory;
String? roomNumber;
double? rateAmount;
String? rateCode;
String? rateAmountCurrencyCode;
String? currencyCode;
String? sourceCode;
String? marketCode;
String? travelAgentID;
String? companyID;
String? channel;
String? paymentMethod;
String? rateCurrencyCode;
double? totalRevenue;
double? roomRevenue;
double? fbRevenue;
String? membershipType;
String? membershipID;
String? transactionID;
String? transactionStatus;
List<UniqueIDType>? uniqueIDs;
List<StayHistoryRevenue>? stayHistoryRevenueCollection;
List<StayHistoryDailyRate>? stayHistoryDailyRateCollection;
StayHistory({this.cendynPropertyID,this.resortID,this.externalProfileID1,this.externalResId1,this.crsBookNo,this.resortBookNo,this.resortLegNo,this.confirmationID,this.reservationStatus,this.hasDailyRooms,this.rateRoomType,this.actualArrivalDate,this.actualDepartureDate,this.bookDate,this.bookedArrivalDate,this.bookedDepartureDate,this.compYN,this.adults,this.children,this.roomCategory,this.roomNumber,this.rateAmount,this.rateCode,this.rateAmountCurrencyCode,this.currencyCode,this.sourceCode,this.marketCode,this.travelAgentID,this.companyID,this.channel,this.paymentMethod,this.rateCurrencyCode,this.totalRevenue,this.roomRevenue,this.fbRevenue,this.membershipType,this.membershipID,this.transactionID,this.transactionStatus,this.uniqueIDs,this.stayHistoryRevenueCollection,this.stayHistoryDailyRateCollection});
StayHistory.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
cendynPropertyID = json['cendynPropertyID'];
resortID = json['resortID'];
externalProfileID1 = json['externalProfileID1'];
externalResId1 = json['externalResId1'];
crsBookNo = json['crsBookNo'];
resortBookNo = json['resortBookNo'];
resortLegNo = json['resortLegNo'];
confirmationID = json['confirmationID'];
reservationStatus = json['reservationStatus'];
hasDailyRooms = json['hasDailyRooms'];
rateRoomType = json['rateRoomType'];
actualArrivalDate = JsonConverters.fromJson(json['actualArrivalDate'],'DateTime',context!);
actualDepartureDate = JsonConverters.fromJson(json['actualDepartureDate'],'DateTime',context!);
bookDate = JsonConverters.fromJson(json['bookDate'],'DateTime',context!);
bookedArrivalDate = JsonConverters.fromJson(json['bookedArrivalDate'],'DateTime',context!);
bookedDepartureDate = JsonConverters.fromJson(json['bookedDepartureDate'],'DateTime',context!);
compYN = json['compYN'];
adults = json['adults'];
children = json['children'];
roomCategory = json['roomCategory'];
roomNumber = json['roomNumber'];
rateAmount = JsonConverters.toDouble(json['rateAmount']);
rateCode = json['rateCode'];
rateAmountCurrencyCode = json['rateAmountCurrencyCode'];
currencyCode = json['currencyCode'];
sourceCode = json['sourceCode'];
marketCode = json['marketCode'];
travelAgentID = json['travelAgentID'];
companyID = json['companyID'];
channel = json['channel'];
paymentMethod = json['paymentMethod'];
rateCurrencyCode = json['rateCurrencyCode'];
totalRevenue = JsonConverters.toDouble(json['totalRevenue']);
roomRevenue = JsonConverters.toDouble(json['roomRevenue']);
fbRevenue = JsonConverters.toDouble(json['fbRevenue']);
membershipType = json['membershipType'];
membershipID = json['membershipID'];
transactionID = json['transactionID'];
transactionStatus = json['transactionStatus'];
uniqueIDs = JsonConverters.fromJson(json['uniqueIDs'],'List<UniqueIDType>',context!);
stayHistoryRevenueCollection = JsonConverters.fromJson(json['stayHistoryRevenueCollection'],'List<StayHistoryRevenue>',context!);
stayHistoryDailyRateCollection = JsonConverters.fromJson(json['stayHistoryDailyRateCollection'],'List<StayHistoryDailyRate>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'cendynPropertyID': cendynPropertyID,
'resortID': resortID,
'externalProfileID1': externalProfileID1,
'externalResId1': externalResId1,
'crsBookNo': crsBookNo,
'resortBookNo': resortBookNo,
'resortLegNo': resortLegNo,
'confirmationID': confirmationID,
'reservationStatus': reservationStatus,
'hasDailyRooms': hasDailyRooms,
'rateRoomType': rateRoomType,
'actualArrivalDate': JsonConverters.toJson(actualArrivalDate,'DateTime',context!),
'actualDepartureDate': JsonConverters.toJson(actualDepartureDate,'DateTime',context!),
'bookDate': JsonConverters.toJson(bookDate,'DateTime',context!),
'bookedArrivalDate': JsonConverters.toJson(bookedArrivalDate,'DateTime',context!),
'bookedDepartureDate': JsonConverters.toJson(bookedDepartureDate,'DateTime',context!),
'compYN': compYN,
'adults': adults,
'children': children,
'roomCategory': roomCategory,
'roomNumber': roomNumber,
'rateAmount': rateAmount,
'rateCode': rateCode,
'rateAmountCurrencyCode': rateAmountCurrencyCode,
'currencyCode': currencyCode,
'sourceCode': sourceCode,
'marketCode': marketCode,
'travelAgentID': travelAgentID,
'companyID': companyID,
'channel': channel,
'paymentMethod': paymentMethod,
'rateCurrencyCode': rateCurrencyCode,
'totalRevenue': totalRevenue,
'roomRevenue': roomRevenue,
'fbRevenue': fbRevenue,
'membershipType': membershipType,
'membershipID': membershipID,
'transactionID': transactionID,
'transactionStatus': transactionStatus,
'uniqueIDs': JsonConverters.toJson(uniqueIDs,'List<UniqueIDType>',context!),
'stayHistoryRevenueCollection': JsonConverters.toJson(stayHistoryRevenueCollection,'List<StayHistoryRevenue>',context!),
'stayHistoryDailyRateCollection': JsonConverters.toJson(stayHistoryDailyRateCollection,'List<StayHistoryDailyRate>',context!)
};
getTypeName() => "StayHistory";
TypeContext? context = _ctx;
}
class StayHistoryContainer implements IConvertible
{
String? echoToken;
List<StayHistory>? stayHistoryList;
StayHistoryContainer({this.echoToken,this.stayHistoryList});
StayHistoryContainer.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
echoToken = json['echoToken'];
stayHistoryList = JsonConverters.fromJson(json['stayHistoryList'],'List<StayHistory>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'echoToken': echoToken,
'stayHistoryList': JsonConverters.toJson(stayHistoryList,'List<StayHistory>',context!)
};
getTypeName() => "StayHistoryContainer";
TypeContext? context = _ctx;
}
class StayHistoryPost implements IConvertible
{
StayHistoryContainer? stayHistoryContainer;
String? subscriptionId;
String? cendynPropertyId;
StayHistoryPost({this.stayHistoryContainer,this.subscriptionId,this.cendynPropertyId});
StayHistoryPost.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
stayHistoryContainer = JsonConverters.fromJson(json['stayHistoryContainer'],'StayHistoryContainer',context!);
subscriptionId = json['subscriptionId'];
cendynPropertyId = json['cendynPropertyId'];
return this;
}
Map<String, dynamic> toJson() => {
'stayHistoryContainer': JsonConverters.toJson(stayHistoryContainer,'StayHistoryContainer',context!),
'subscriptionId': subscriptionId,
'cendynPropertyId': cendynPropertyId
};
getTypeName() => "StayHistoryPost";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'cert.cendyn.com', types: <String, TypeInfo> {
'Response': TypeInfo(TypeOf.Class, create:() => Response()),
'UniqueIDType': TypeInfo(TypeOf.Class, create:() => UniqueIDType()),
'StayHistoryRevenue': TypeInfo(TypeOf.Class, create:() => StayHistoryRevenue()),
'StayHistoryDailyRate': TypeInfo(TypeOf.Class, create:() => StayHistoryDailyRate()),
'StayHistory': TypeInfo(TypeOf.Class, create:() => StayHistory()),
'List<UniqueIDType>': TypeInfo(TypeOf.Class, create:() => <UniqueIDType>[]),
'List<StayHistoryRevenue>': TypeInfo(TypeOf.Class, create:() => <StayHistoryRevenue>[]),
'List<StayHistoryDailyRate>': TypeInfo(TypeOf.Class, create:() => <StayHistoryDailyRate>[]),
'StayHistoryContainer': TypeInfo(TypeOf.Class, create:() => StayHistoryContainer()),
'List<StayHistory>': TypeInfo(TypeOf.Class, create:() => <StayHistory>[]),
'StayHistoryPost': TypeInfo(TypeOf.Class, create:() => StayHistoryPost()),
});
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 /stayhistory/{SubscriptionId}/{CendynPropertyId} HTTP/1.1
Host: cert.cendyn.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<StayHistoryPost xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
<CendynPropertyId>String</CendynPropertyId>
<StayHistoryContainer>
<EchoToken>String</EchoToken>
<StayHistoryList>
<StayHistory>
<ActualArrivalDate>0001-01-01T00:00:00</ActualArrivalDate>
<ActualDepartureDate>0001-01-01T00:00:00</ActualDepartureDate>
<Adults>0</Adults>
<BookDate>0001-01-01T00:00:00</BookDate>
<BookedArrivalDate>0001-01-01T00:00:00</BookedArrivalDate>
<BookedDepartureDate>0001-01-01T00:00:00</BookedDepartureDate>
<CRSBookNo>String</CRSBookNo>
<CendynPropertyID>String</CendynPropertyID>
<Channel>String</Channel>
<Children>0</Children>
<CompYN>String</CompYN>
<CompanyID>String</CompanyID>
<ConfirmationID>String</ConfirmationID>
<CurrencyCode>String</CurrencyCode>
<ExternalProfileID1>String</ExternalProfileID1>
<ExternalResId1>String</ExternalResId1>
<FbRevenue>0</FbRevenue>
<HasDailyRooms>false</HasDailyRooms>
<MarketCode>String</MarketCode>
<MembershipID>String</MembershipID>
<MembershipType>String</MembershipType>
<PaymentMethod>String</PaymentMethod>
<RateAmount>0</RateAmount>
<RateAmountCurrencyCode>String</RateAmountCurrencyCode>
<RateCode>String</RateCode>
<RateCurrencyCode>String</RateCurrencyCode>
<RateRoomType>String</RateRoomType>
<ReservationStatus>String</ReservationStatus>
<ResortBookNo>String</ResortBookNo>
<ResortID>String</ResortID>
<ResortLegNo>0</ResortLegNo>
<RoomCategory>String</RoomCategory>
<RoomNumber>String</RoomNumber>
<RoomRevenue>0</RoomRevenue>
<SourceCode>String</SourceCode>
<StayHistoryDailyRateCollection>
<StayHistoryDailyRate>
<Amount>0</Amount>
<CurrencyCode>String</CurrencyCode>
<InactiveDate>0001-01-01T00:00:00</InactiveDate>
<MarketCode>String</MarketCode>
<PseudoRoom>String</PseudoRoom>
<RateCode>String</RateCode>
<RateRoomType>String</RateRoomType>
<RecordStatus>String</RecordStatus>
<ResourceID>String</ResourceID>
<RoomCategory>String</RoomCategory>
<RoomNumber>String</RoomNumber>
<TransactionDate>0001-01-01T00:00:00</TransactionDate>
</StayHistoryDailyRate>
</StayHistoryDailyRateCollection>
<StayHistoryRevenueCollection>
<StayHistoryRevenue>
<Amount>0</Amount>
<CurrencyCode>String</CurrencyCode>
<FolioWindow>String</FolioWindow>
<InactiveDate>0001-01-01T00:00:00</InactiveDate>
<RecordStatus>String</RecordStatus>
<RevenueGroup>String</RevenueGroup>
<RevenueType>String</RevenueType>
<TransactionDate>0001-01-01T00:00:00</TransactionDate>
</StayHistoryRevenue>
</StayHistoryRevenueCollection>
<TotalRevenue>0</TotalRevenue>
<TransactionID>String</TransactionID>
<TransactionStatus>String</TransactionStatus>
<TravelAgentID>String</TravelAgentID>
<UniqueIDs>
<UniqueIDType>
<Context>String</Context>
<ID>String</ID>
<Type>String</Type>
</UniqueIDType>
</UniqueIDs>
</StayHistory>
</StayHistoryList>
</StayHistoryContainer>
<SubscriptionId>String</SubscriptionId>
</StayHistoryPost>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel"> <ErrorCount>0</ErrorCount> <RecordCount>0</RecordCount> <StatusCode>String</StatusCode> </Response>