| GET | /v2/reservation/summary/{Query} | ||
|---|---|---|---|
| GET | /v2/reservation/summary/{Query}/{CendynPropertyId} |
import Foundation
import ServiceStack
public class ResSummaryRequest : Codable
{
public var cendynPropertyId:String?
public var query:ReservationQueryType?
public var id:String?
public var firstName:String?
public var lastName:String?
public var startDate:Date?
public var endDate:Date?
// @DataMember(Name="Limit")
public var pageSize:Int?
// @DataMember(Name="Page")
public var pageNumber:Int?
required public init(){}
}
public enum ReservationQueryType : String, Codable
{
case ResId
case ProfileId
case Name
case LastUpdated
case ArrivalDate
case DepartureDate
case StayDate
case DatePMSResUpdated
}
public class ResSummaryResponse : CenResResponse
{
public var records:[ReservationSummary] = []
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([ReservationSummary].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 ReservationSummary : Codable
{
public var firstName:String?
public var lastName:String?
public var externalProfileId:String?
public var externalProfileId2:String?
public var externalResID1:String?
public var externalResID2:String?
public var cendynPropertyId:String?
public var propertyName:String?
public var resTypeCode:String?
public var resStatusCode:String?
public var confirmationNum:String?
public var centralResNum:String?
public var resArriveDate:Date?
public var resDepartDate:Date?
public var numRooms:Int?
public var roomTypeCode:String?
public var roomNumber:String?
public var rateCode:String?
public var marketSegmentCode:String?
public var marketCodeCategory:String?
public var marketRegionCode:String?
public var companyName:String?
public var numAdults:Int?
public var numYouths:Int?
public var numChildren:Int?
public var totalRoomNights:Int?
public var cancellationID:String?
public var cancellationDate:Date?
public var totalOtherRevenue:Double?
public var totalRoomRevenue:Double?
public var totalTax:Double?
public var totalRevenue:Double?
public var lastUpdated:Date?
required public init(){}
}
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.
GET /v2/reservation/summary/{Query} HTTP/1.1
Host: cert.cendyn.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ResSummaryResponse 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 xmlns:d2p1="http://schemas.datacontract.org/2004/07/Cendyn.CenRes.DataLib.ViewModels">
<d2p1:ReservationSummary>
<d2p1:CancellationDate>0001-01-01T00:00:00</d2p1:CancellationDate>
<d2p1:CancellationID>String</d2p1:CancellationID>
<d2p1:CendynPropertyId>String</d2p1:CendynPropertyId>
<d2p1:CentralResNum>String</d2p1:CentralResNum>
<d2p1:CompanyName>String</d2p1:CompanyName>
<d2p1:ConfirmationNum>String</d2p1:ConfirmationNum>
<d2p1:ExternalProfileId>String</d2p1:ExternalProfileId>
<d2p1:ExternalProfileId2>String</d2p1:ExternalProfileId2>
<d2p1:ExternalResID1>String</d2p1:ExternalResID1>
<d2p1:ExternalResID2>String</d2p1:ExternalResID2>
<d2p1:FirstName>String</d2p1:FirstName>
<d2p1:LastName>String</d2p1:LastName>
<d2p1:LastUpdated>0001-01-01T00:00:00</d2p1:LastUpdated>
<d2p1:MarketCodeCategory>String</d2p1:MarketCodeCategory>
<d2p1:MarketRegionCode>String</d2p1:MarketRegionCode>
<d2p1:MarketSegmentCode>String</d2p1:MarketSegmentCode>
<d2p1:NumAdults>0</d2p1:NumAdults>
<d2p1:NumChildren>0</d2p1:NumChildren>
<d2p1:NumRooms>0</d2p1:NumRooms>
<d2p1:NumYouths>0</d2p1:NumYouths>
<d2p1:PropertyName>String</d2p1:PropertyName>
<d2p1:RateCode>String</d2p1:RateCode>
<d2p1:ResArriveDate>0001-01-01T00:00:00</d2p1:ResArriveDate>
<d2p1:ResDepartDate>0001-01-01T00:00:00</d2p1:ResDepartDate>
<d2p1:ResStatusCode>String</d2p1:ResStatusCode>
<d2p1:ResTypeCode>String</d2p1:ResTypeCode>
<d2p1:RoomNumber>String</d2p1:RoomNumber>
<d2p1:RoomTypeCode>String</d2p1:RoomTypeCode>
<d2p1:TotalOtherRevenue>0</d2p1:TotalOtherRevenue>
<d2p1:TotalRevenue>0</d2p1:TotalRevenue>
<d2p1:TotalRoomNights>0</d2p1:TotalRoomNights>
<d2p1:TotalRoomRevenue>0</d2p1:TotalRoomRevenue>
<d2p1:TotalTax>0</d2p1:TotalTax>
</d2p1:ReservationSummary>
</Records>
</ResSummaryResponse>