| POST | /HotelPackage/{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 PackageDetail implements IConvertible
{
DateTime? startDate;
DateTime? endDate;
double? priceAmount;
double? posAllowance;
int? pointsTotal;
String? action;
double? amountBeforeTax;
double? amountAfterTax;
String? itemName;
int? quantity;
String? code;
String? itemId;
bool? showInReservation;
bool? useInCRS;
bool? addToRate;
bool? isFixedCharge;
String? recurrence;
String? relation;
bool? monday;
bool? tuesday;
bool? wednesday;
bool? thursday;
bool? friday;
bool? saturday;
bool? sunday;
PackageDetail({this.startDate,this.endDate,this.priceAmount,this.posAllowance,this.pointsTotal,this.action,this.amountBeforeTax,this.amountAfterTax,this.itemName,this.quantity,this.code,this.itemId,this.showInReservation,this.useInCRS,this.addToRate,this.isFixedCharge,this.recurrence,this.relation,this.monday,this.tuesday,this.wednesday,this.thursday,this.friday,this.saturday,this.sunday});
PackageDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
endDate = JsonConverters.fromJson(json['endDate'],'DateTime',context!);
priceAmount = JsonConverters.toDouble(json['priceAmount']);
posAllowance = JsonConverters.toDouble(json['posAllowance']);
pointsTotal = json['pointsTotal'];
action = json['action'];
amountBeforeTax = JsonConverters.toDouble(json['amountBeforeTax']);
amountAfterTax = JsonConverters.toDouble(json['amountAfterTax']);
itemName = json['itemName'];
quantity = json['quantity'];
code = json['code'];
itemId = json['itemId'];
showInReservation = json['showInReservation'];
useInCRS = json['useInCRS'];
addToRate = json['addToRate'];
isFixedCharge = json['isFixedCharge'];
recurrence = json['recurrence'];
relation = json['relation'];
monday = json['monday'];
tuesday = json['tuesday'];
wednesday = json['wednesday'];
thursday = json['thursday'];
friday = json['friday'];
saturday = json['saturday'];
sunday = json['sunday'];
return this;
}
Map<String, dynamic> toJson() => {
'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
'endDate': JsonConverters.toJson(endDate,'DateTime',context!),
'priceAmount': priceAmount,
'posAllowance': posAllowance,
'pointsTotal': pointsTotal,
'action': action,
'amountBeforeTax': amountBeforeTax,
'amountAfterTax': amountAfterTax,
'itemName': itemName,
'quantity': quantity,
'code': code,
'itemId': itemId,
'showInReservation': showInReservation,
'useInCRS': useInCRS,
'addToRate': addToRate,
'isFixedCharge': isFixedCharge,
'recurrence': recurrence,
'relation': relation,
'monday': monday,
'tuesday': tuesday,
'wednesday': wednesday,
'thursday': thursday,
'friday': friday,
'saturday': saturday,
'sunday': sunday
};
getTypeName() => "PackageDetail";
TypeContext? context = _ctx;
}
class PackageItem implements IConvertible
{
String? itemName;
int? quantity;
PackageItem({this.itemName,this.quantity});
PackageItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
itemName = json['itemName'];
quantity = json['quantity'];
return this;
}
Map<String, dynamic> toJson() => {
'itemName': itemName,
'quantity': quantity
};
getTypeName() => "PackageItem";
TypeContext? context = _ctx;
}
class Package implements IConvertible
{
String? externalID;
String? cendynPropertyID;
String? hotelCode;
String? packageCode;
String? packageDescription;
String? shortDescription;
String? forecastGroup;
bool? printSeparately;
bool? addToRate;
double? priceAmount;
bool? taxIncluded;
String? currencyCode;
bool? sellSeparate;
bool? postNextDay;
bool? forecastNextDay;
bool? cateringPackage;
bool? redemption;
bool? overrideFixedRate;
String? calculationRule;
String? postingRhythm;
String? packageElement;
String? addToRateMode;
bool? isActive;
DateTime? inactiveDate;
String? sourceName;
String? sourceID;
String? action;
List<PackageDetail>? packageDetails;
List<PackageItem>? packageItems;
Package({this.externalID,this.cendynPropertyID,this.hotelCode,this.packageCode,this.packageDescription,this.shortDescription,this.forecastGroup,this.printSeparately,this.addToRate,this.priceAmount,this.taxIncluded,this.currencyCode,this.sellSeparate,this.postNextDay,this.forecastNextDay,this.cateringPackage,this.redemption,this.overrideFixedRate,this.calculationRule,this.postingRhythm,this.packageElement,this.addToRateMode,this.isActive,this.inactiveDate,this.sourceName,this.sourceID,this.action,this.packageDetails,this.packageItems});
Package.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
externalID = json['externalID'];
cendynPropertyID = json['cendynPropertyID'];
hotelCode = json['hotelCode'];
packageCode = json['packageCode'];
packageDescription = json['packageDescription'];
shortDescription = json['shortDescription'];
forecastGroup = json['forecastGroup'];
printSeparately = json['printSeparately'];
addToRate = json['addToRate'];
priceAmount = JsonConverters.toDouble(json['priceAmount']);
taxIncluded = json['taxIncluded'];
currencyCode = json['currencyCode'];
sellSeparate = json['sellSeparate'];
postNextDay = json['postNextDay'];
forecastNextDay = json['forecastNextDay'];
cateringPackage = json['cateringPackage'];
redemption = json['redemption'];
overrideFixedRate = json['overrideFixedRate'];
calculationRule = json['calculationRule'];
postingRhythm = json['postingRhythm'];
packageElement = json['packageElement'];
addToRateMode = json['addToRateMode'];
isActive = json['isActive'];
inactiveDate = JsonConverters.fromJson(json['inactiveDate'],'DateTime',context!);
sourceName = json['sourceName'];
sourceID = json['sourceID'];
action = json['action'];
packageDetails = JsonConverters.fromJson(json['packageDetails'],'List<PackageDetail>',context!);
packageItems = JsonConverters.fromJson(json['packageItems'],'List<PackageItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'externalID': externalID,
'cendynPropertyID': cendynPropertyID,
'hotelCode': hotelCode,
'packageCode': packageCode,
'packageDescription': packageDescription,
'shortDescription': shortDescription,
'forecastGroup': forecastGroup,
'printSeparately': printSeparately,
'addToRate': addToRate,
'priceAmount': priceAmount,
'taxIncluded': taxIncluded,
'currencyCode': currencyCode,
'sellSeparate': sellSeparate,
'postNextDay': postNextDay,
'forecastNextDay': forecastNextDay,
'cateringPackage': cateringPackage,
'redemption': redemption,
'overrideFixedRate': overrideFixedRate,
'calculationRule': calculationRule,
'postingRhythm': postingRhythm,
'packageElement': packageElement,
'addToRateMode': addToRateMode,
'isActive': isActive,
'inactiveDate': JsonConverters.toJson(inactiveDate,'DateTime',context!),
'sourceName': sourceName,
'sourceID': sourceID,
'action': action,
'packageDetails': JsonConverters.toJson(packageDetails,'List<PackageDetail>',context!),
'packageItems': JsonConverters.toJson(packageItems,'List<PackageItem>',context!)
};
getTypeName() => "Package";
TypeContext? context = _ctx;
}
class HotelPackage implements IConvertible
{
Package? package;
String? subscriptionId;
String? cendynPropertyId;
HotelPackage({this.package,this.subscriptionId,this.cendynPropertyId});
HotelPackage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
package = JsonConverters.fromJson(json['package'],'Package',context!);
subscriptionId = json['subscriptionId'];
cendynPropertyId = json['cendynPropertyId'];
return this;
}
Map<String, dynamic> toJson() => {
'package': JsonConverters.toJson(package,'Package',context!),
'subscriptionId': subscriptionId,
'cendynPropertyId': cendynPropertyId
};
getTypeName() => "HotelPackage";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'cert.cendyn.com', types: <String, TypeInfo> {
'Response': TypeInfo(TypeOf.Class, create:() => Response()),
'PackageDetail': TypeInfo(TypeOf.Class, create:() => PackageDetail()),
'PackageItem': TypeInfo(TypeOf.Class, create:() => PackageItem()),
'Package': TypeInfo(TypeOf.Class, create:() => Package()),
'List<PackageDetail>': TypeInfo(TypeOf.Class, create:() => <PackageDetail>[]),
'List<PackageItem>': TypeInfo(TypeOf.Class, create:() => <PackageItem>[]),
'HotelPackage': TypeInfo(TypeOf.Class, create:() => HotelPackage()),
});
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 /HotelPackage/{SubscriptionId}/{CendynPropertyId} HTTP/1.1
Host: cert.cendyn.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<HotelPackage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
<CendynPropertyId>String</CendynPropertyId>
<Package>
<Action>String</Action>
<AddToRate>false</AddToRate>
<AddToRateMode>String</AddToRateMode>
<CalculationRule>String</CalculationRule>
<CateringPackage>false</CateringPackage>
<CendynPropertyID>String</CendynPropertyID>
<CurrencyCode>String</CurrencyCode>
<ExternalID>String</ExternalID>
<ForecastGroup>String</ForecastGroup>
<ForecastNextDay>false</ForecastNextDay>
<HotelCode>String</HotelCode>
<InactiveDate>0001-01-01T00:00:00</InactiveDate>
<IsActive>false</IsActive>
<OverrideFixedRate>false</OverrideFixedRate>
<PackageCode>String</PackageCode>
<PackageDescription>String</PackageDescription>
<PackageDetails>
<PackageDetail>
<Action>String</Action>
<AddToRate>false</AddToRate>
<AmountAfterTax>0</AmountAfterTax>
<AmountBeforeTax>0</AmountBeforeTax>
<Code>String</Code>
<EndDate>0001-01-01T00:00:00</EndDate>
<Friday>false</Friday>
<IsFixedCharge>false</IsFixedCharge>
<ItemId>String</ItemId>
<ItemName>String</ItemName>
<Monday>false</Monday>
<POSAllowance>0</POSAllowance>
<PointsTotal>0</PointsTotal>
<PriceAmount>0</PriceAmount>
<Quantity>0</Quantity>
<Recurrence>String</Recurrence>
<Relation>String</Relation>
<Saturday>false</Saturday>
<ShowInReservation>false</ShowInReservation>
<StartDate>0001-01-01T00:00:00</StartDate>
<Sunday>false</Sunday>
<Thursday>false</Thursday>
<Tuesday>false</Tuesday>
<UseInCRS>false</UseInCRS>
<Wednesday>false</Wednesday>
</PackageDetail>
</PackageDetails>
<PackageElement>String</PackageElement>
<PackageItems>
<PackageItem>
<ItemName>String</ItemName>
<Quantity>0</Quantity>
</PackageItem>
</PackageItems>
<PostNextDay>false</PostNextDay>
<PostingRhythm>String</PostingRhythm>
<PriceAmount>0</PriceAmount>
<PrintSeparately>false</PrintSeparately>
<Redemption>false</Redemption>
<SellSeparate>false</SellSeparate>
<ShortDescription>String</ShortDescription>
<SourceID>String</SourceID>
<SourceName>String</SourceName>
<TaxIncluded>false</TaxIncluded>
</Package>
<SubscriptionId>String</SubscriptionId>
</HotelPackage>
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>