| 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 .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/reservation/summary/{Query} HTTP/1.1
Host: cert.cendyn.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"records":[{"firstName":"String","lastName":"String","externalProfileId":"String","externalProfileId2":"String","externalResID1":"String","externalResID2":"String","cendynPropertyId":"String","propertyName":"String","resTypeCode":"String","resStatusCode":"String","confirmationNum":"String","centralResNum":"String","resArriveDate":"0001-01-01T00:00:00.0000000","resDepartDate":"0001-01-01T00:00:00.0000000","numRooms":0,"roomTypeCode":"String","roomNumber":"String","rateCode":"String","marketSegmentCode":"String","marketCodeCategory":"String","marketRegionCode":"String","companyName":"String","numAdults":0,"numYouths":0,"numChildren":0,"totalRoomNights":0,"cancellationID":"String","cancellationDate":"0001-01-01T00:00:00.0000000","totalOtherRevenue":0,"totalRoomRevenue":0,"totalTax":0,"totalRevenue":0,"lastUpdated":"0001-01-01T00:00:00.0000000"}],"status":"Success","statusMessage":"String","recordsReturned":0,"recordsAvailable":0,"pageNumber":0,"pageSize":0}