CenResService

<back to all web services

StayHistoryRequest

The following routes are available for this service:
GET/v2/stayhistory/{Query}/{CendynPropertyId}
GET/v2/stayhistory/{Query}
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 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 StayHistoryResponse extends CenResResponse implements IConvertible
{
    List<StayHistory>? records;

    StayHistoryResponse({this.records});
    StayHistoryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        records = JsonConverters.fromJson(json['records'],'List<StayHistory>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'records': JsonConverters.toJson(records,'List<StayHistory>',context!)
    });

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

enum StayHistoryQueryType
{
    ProfileId,
    ResId,
}

class StayHistoryRequest implements IConvertible
{
    String? cendynPropertyId;
    StayHistoryQueryType? query;
    String? id;

    StayHistoryRequest({this.cendynPropertyId,this.query,this.id});
    StayHistoryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'cendynPropertyId': cendynPropertyId,
        'query': JsonConverters.toJson(query,'StayHistoryQueryType',context!),
        'id': id
    };

    getTypeName() => "StayHistoryRequest";
    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()),
    '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>[]),
    'StayHistoryResponse': TypeInfo(TypeOf.Class, create:() => StayHistoryResponse()),
    'List<StayHistory>': TypeInfo(TypeOf.Class, create:() => <StayHistory>[]),
    'StayHistoryQueryType': TypeInfo(TypeOf.Enum, enumValues:StayHistoryQueryType.values),
    'StayHistoryRequest': TypeInfo(TypeOf.Class, create:() => StayHistoryRequest()),
});

Dart StayHistoryRequest 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.

GET /v2/stayhistory/{Query}/{CendynPropertyId} HTTP/1.1 
Host: cert.cendyn.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<StayHistoryResponse 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>
    <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>
  </Records>
</StayHistoryResponse>