CenResService

<back to all web services

HotelInventorySnapshot

The following routes are available for this service:
POST/hotelinventorysnapshot/{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 InventoryRoom implements IConvertible
{
    String? roomType;
    int? physicalRooms;
    int? outOfOrder;
    int? definitiveAvailable;
    int? definitiveSold;
    int? blockCount;
    double? expectedBlockRevenue;
    int? casinoBlockCount;
    double? expectedCasinoRevenue;

    InventoryRoom({this.roomType,this.physicalRooms,this.outOfOrder,this.definitiveAvailable,this.definitiveSold,this.blockCount,this.expectedBlockRevenue,this.casinoBlockCount,this.expectedCasinoRevenue});
    InventoryRoom.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        roomType = json['roomType'];
        physicalRooms = json['physicalRooms'];
        outOfOrder = json['outOfOrder'];
        definitiveAvailable = json['definitiveAvailable'];
        definitiveSold = json['definitiveSold'];
        blockCount = json['blockCount'];
        expectedBlockRevenue = JsonConverters.toDouble(json['expectedBlockRevenue']);
        casinoBlockCount = json['casinoBlockCount'];
        expectedCasinoRevenue = JsonConverters.toDouble(json['expectedCasinoRevenue']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'roomType': roomType,
        'physicalRooms': physicalRooms,
        'outOfOrder': outOfOrder,
        'definitiveAvailable': definitiveAvailable,
        'definitiveSold': definitiveSold,
        'blockCount': blockCount,
        'expectedBlockRevenue': expectedBlockRevenue,
        'casinoBlockCount': casinoBlockCount,
        'expectedCasinoRevenue': expectedCasinoRevenue
    };

    getTypeName() => "InventoryRoom";
    TypeContext? context = _ctx;
}

class InventorySnapshot implements IConvertible
{
    String? cendynPropertyID;
    String? hotelCode;
    DateTime? inventoryDay;
    int? physicalRooms;
    int? outOfOrder;
    int? definitiveSold;
    int? blockCount;
    double? expectedBlockRevenue;
    int? casinoBlockCount;
    double? expectedCasinoRevenue;
    String? sourceName;
    String? sourceID;
    List<InventoryRoom>? inventoryRooms;

    InventorySnapshot({this.cendynPropertyID,this.hotelCode,this.inventoryDay,this.physicalRooms,this.outOfOrder,this.definitiveSold,this.blockCount,this.expectedBlockRevenue,this.casinoBlockCount,this.expectedCasinoRevenue,this.sourceName,this.sourceID,this.inventoryRooms});
    InventorySnapshot.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        cendynPropertyID = json['cendynPropertyID'];
        hotelCode = json['hotelCode'];
        inventoryDay = JsonConverters.fromJson(json['inventoryDay'],'DateTime',context!);
        physicalRooms = json['physicalRooms'];
        outOfOrder = json['outOfOrder'];
        definitiveSold = json['definitiveSold'];
        blockCount = json['blockCount'];
        expectedBlockRevenue = JsonConverters.toDouble(json['expectedBlockRevenue']);
        casinoBlockCount = json['casinoBlockCount'];
        expectedCasinoRevenue = JsonConverters.toDouble(json['expectedCasinoRevenue']);
        sourceName = json['sourceName'];
        sourceID = json['sourceID'];
        inventoryRooms = JsonConverters.fromJson(json['inventoryRooms'],'List<InventoryRoom>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'cendynPropertyID': cendynPropertyID,
        'hotelCode': hotelCode,
        'inventoryDay': JsonConverters.toJson(inventoryDay,'DateTime',context!),
        'physicalRooms': physicalRooms,
        'outOfOrder': outOfOrder,
        'definitiveSold': definitiveSold,
        'blockCount': blockCount,
        'expectedBlockRevenue': expectedBlockRevenue,
        'casinoBlockCount': casinoBlockCount,
        'expectedCasinoRevenue': expectedCasinoRevenue,
        'sourceName': sourceName,
        'sourceID': sourceID,
        'inventoryRooms': JsonConverters.toJson(inventoryRooms,'List<InventoryRoom>',context!)
    };

    getTypeName() => "InventorySnapshot";
    TypeContext? context = _ctx;
}

class HotelInventorySnapshot implements IConvertible
{
    InventorySnapshot? inventorySnapshot;
    String? subscriptionId;
    String? cendynPropertyId;

    HotelInventorySnapshot({this.inventorySnapshot,this.subscriptionId,this.cendynPropertyId});
    HotelInventorySnapshot.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        inventorySnapshot = JsonConverters.fromJson(json['inventorySnapshot'],'InventorySnapshot',context!);
        subscriptionId = json['subscriptionId'];
        cendynPropertyId = json['cendynPropertyId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'inventorySnapshot': JsonConverters.toJson(inventorySnapshot,'InventorySnapshot',context!),
        'subscriptionId': subscriptionId,
        'cendynPropertyId': cendynPropertyId
    };

    getTypeName() => "HotelInventorySnapshot";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'cert.cendyn.com', types: <String, TypeInfo> {
    'Response': TypeInfo(TypeOf.Class, create:() => Response()),
    'InventoryRoom': TypeInfo(TypeOf.Class, create:() => InventoryRoom()),
    'InventorySnapshot': TypeInfo(TypeOf.Class, create:() => InventorySnapshot()),
    'List<InventoryRoom>': TypeInfo(TypeOf.Class, create:() => <InventoryRoom>[]),
    'HotelInventorySnapshot': TypeInfo(TypeOf.Class, create:() => HotelInventorySnapshot()),
});

Dart HotelInventorySnapshot DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /hotelinventorysnapshot/{SubscriptionId}/{CendynPropertyId} HTTP/1.1 
Host: cert.cendyn.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<HotelInventorySnapshot xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CenResSS.ServiceModel">
  <CendynPropertyId>String</CendynPropertyId>
  <InventorySnapshot>
    <BlockCount>0</BlockCount>
    <CasinoBlockCount>0</CasinoBlockCount>
    <CendynPropertyID>String</CendynPropertyID>
    <DefinitiveSold>0</DefinitiveSold>
    <ExpectedBlockRevenue>0</ExpectedBlockRevenue>
    <ExpectedCasinoRevenue>0</ExpectedCasinoRevenue>
    <HotelCode>String</HotelCode>
    <InventoryDay>0001-01-01T00:00:00</InventoryDay>
    <InventoryRooms>
      <InventoryRoom>
        <BlockCount>0</BlockCount>
        <CasinoBlockCount>0</CasinoBlockCount>
        <DefinitiveAvailable>0</DefinitiveAvailable>
        <DefinitiveSold>0</DefinitiveSold>
        <ExpectedBlockRevenue>0</ExpectedBlockRevenue>
        <ExpectedCasinoRevenue>0</ExpectedCasinoRevenue>
        <OutOfOrder>0</OutOfOrder>
        <PhysicalRooms>0</PhysicalRooms>
        <RoomType>String</RoomType>
      </InventoryRoom>
    </InventoryRooms>
    <OutOfOrder>0</OutOfOrder>
    <PhysicalRooms>0</PhysicalRooms>
    <SourceID>String</SourceID>
    <SourceName>String</SourceName>
  </InventorySnapshot>
  <SubscriptionId>String</SubscriptionId>
</HotelInventorySnapshot>
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>