| GET | /v2/stayhistory/{Query}/{CendynPropertyId} | ||
|---|---|---|---|
| GET | /v2/stayhistory/{Query} |
import Foundation
import ServiceStack
public class StayHistoryRequest : Codable
{
public var cendynPropertyId:String?
public var query:StayHistoryQueryType?
public var id:String?
required public init(){}
}
public enum StayHistoryQueryType : String, Codable
{
case ProfileId
case ResId
}
public class StayHistoryResponse : CenResResponse
{
public var records:[StayHistory] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case records
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
records = try container.decodeIfPresent([StayHistory].self, forKey: .records) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if records.count > 0 { try container.encode(records, forKey: .records) }
}
}
public class CenResResponse : Codable
{
public var status:RequestStatus?
public var statusMessage:String?
public var recordsReturned:Int?
public var recordsAvailable:Int?
public var pageNumber:Int?
public var pageSize:Int?
required public init(){}
}
public enum RequestStatus : String, Codable
{
case Success
case Warning
case Error
case NotAuthorized
case Failure
}
public class StayHistory : Codable
{
public var cendynPropertyID:String?
public var resortID:String?
public var externalProfileID1:String?
public var externalResId1:String?
public var crsBookNo:String?
public var resortBookNo:String?
public var resortLegNo:Int?
public var confirmationID:String?
public var reservationStatus:String?
public var hasDailyRooms:Bool?
public var rateRoomType:String?
public var actualArrivalDate:Date?
public var actualDepartureDate:Date?
public var bookDate:Date?
public var bookedArrivalDate:Date?
public var bookedDepartureDate:Date?
public var compYN:String?
public var adults:Int?
public var children:Int?
public var roomCategory:String?
public var roomNumber:String?
public var rateAmount:Double?
public var rateCode:String?
public var rateAmountCurrencyCode:String?
public var currencyCode:String?
public var sourceCode:String?
public var marketCode:String?
public var travelAgentID:String?
public var companyID:String?
public var channel:String?
public var paymentMethod:String?
public var rateCurrencyCode:String?
public var totalRevenue:Double?
public var roomRevenue:Double?
public var fbRevenue:Double?
public var membershipType:String?
public var membershipID:String?
public var transactionID:String?
public var transactionStatus:String?
public var uniqueIDs:[UniqueIDType] = []
public var stayHistoryRevenueCollection:[StayHistoryRevenue] = []
public var stayHistoryDailyRateCollection:[StayHistoryDailyRate] = []
required public init(){}
}
public class UniqueIDType : Codable
{
public var id:String?
public var type:String?
public var context:String?
required public init(){}
}
public class StayHistoryRevenue : Codable
{
public var recordStatus:String?
// @DataMember(IsRequired=true)
public var revenueGroup:String?
// @DataMember(IsRequired=true)
public var revenueType:String?
// @DataMember(IsRequired=true)
public var amount:Double?
public var currencyCode:String?
public var folioWindow:String?
public var transactionDate:Date?
public var inactiveDate:Date?
required public init(){}
}
public class StayHistoryDailyRate : Codable
{
public var recordStatus:String?
public var transactionDate:Date?
public var rateCode:String?
public var marketCode:String?
public var amount:Double?
public var currencyCode:String?
public var roomNumber:String?
public var resourceID:String?
public var pseudoRoom:String?
public var roomCategory:String?
public var rateRoomType:String?
public var inactiveDate:Date?
required public init(){}
}
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
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/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"records":[{"cendynPropertyID":"String","resortID":"String","externalProfileID1":"String","externalResId1":"String","crsBookNo":"String","resortBookNo":"String","resortLegNo":0,"confirmationID":"String","reservationStatus":"String","hasDailyRooms":false,"rateRoomType":"String","actualArrivalDate":"0001-01-01T00:00:00.0000000","actualDepartureDate":"0001-01-01T00:00:00.0000000","bookDate":"0001-01-01T00:00:00.0000000","bookedArrivalDate":"0001-01-01T00:00:00.0000000","bookedDepartureDate":"0001-01-01T00:00:00.0000000","compYN":"String","adults":0,"children":0,"roomCategory":"String","roomNumber":"String","rateAmount":0,"rateCode":"String","rateAmountCurrencyCode":"String","currencyCode":"String","sourceCode":"String","marketCode":"String","travelAgentID":"String","companyID":"String","channel":"String","paymentMethod":"String","rateCurrencyCode":"String","totalRevenue":0,"roomRevenue":0,"fbRevenue":0,"membershipType":"String","membershipID":"String","transactionID":"String","transactionStatus":"String","uniqueIDs":[{"id":"String","type":"String","context":"String"}],"stayHistoryRevenueCollection":[{"recordStatus":"String","revenueGroup":"String","revenueType":"String","amount":0,"currencyCode":"String","folioWindow":"String","transactionDate":"0001-01-01T00:00:00.0000000","inactiveDate":"0001-01-01T00:00:00.0000000"}],"stayHistoryDailyRateCollection":[{"recordStatus":"String","transactionDate":"0001-01-01T00:00:00.0000000","rateCode":"String","marketCode":"String","amount":0,"currencyCode":"String","roomNumber":"String","resourceID":"String","pseudoRoom":"String","roomCategory":"String","rateRoomType":"String","inactiveDate":"0001-01-01T00:00:00.0000000"}]}],"status":"Success","statusMessage":"String","recordsReturned":0,"recordsAvailable":0,"pageNumber":0,"pageSize":0}