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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"inventorySnapshot":{"cendynPropertyID":"String","hotelCode":"String","inventoryDay":"0001-01-01T00:00:00.0000000","physicalRooms":0,"outOfOrder":0,"definitiveSold":0,"blockCount":0,"expectedBlockRevenue":0,"casinoBlockCount":0,"expectedCasinoRevenue":0,"sourceName":"String","sourceID":"String","inventoryRooms":[{"roomType":"String","physicalRooms":0,"outOfOrder":0,"definitiveAvailable":0,"definitiveSold":0,"blockCount":0,"expectedBlockRevenue":0,"casinoBlockCount":0,"expectedCasinoRevenue":0}]},"subscriptionId":"String","cendynPropertyId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"statusCode":"String","recordCount":0,"errorCount":0}