GET | /AgencyReviews |
---|
import Foundation
import ServiceStack
// @DataContract(Namespace="schemas.agentivity.com/types")
public class AgencyReviews : CompanyLevelRequestBase, IRequestConsultantID
{
/**
* Account
*/
// @DataMember
public var account:String
/**
* Date in format YYYYMMDD
*/
// @DataMember
public var pnrCreationDateStart:String
/**
* Date in format YYYYMMDD
*/
// @DataMember
public var pnrCreationDateEnd:String
/**
* Comma Delimited List of PCCs
*/
// @DataMember
public var owningAgencyLocationID:[String]
/**
* Load options
*/
// @DataMember
public var loadOptions:AgencyReviewOptions
/**
* Airline support format style
*/
// @DataMember
public var airlineSupportFormatStyle:FormattingStyle
/**
* Car support format style
*/
// @DataMember
public var carSupportFormatStyle:FormattingStyle
/**
* Hotel support format style
*/
// @DataMember
public var hotelSupportFormatStyle:FormattingStyle
/**
* Excluded carrier code
*/
// @DataMember
public var excludedCarrierCode:String
/**
* Mode
*/
// @DataMember
public var mode:AgencyReviewMode
/**
* Top car items
*/
// @DataMember
public var topCarItems:Int?
/**
* Top hotel items
*/
// @DataMember
public var topHotelItems:Int?
/**
* Includes AfterHours Servicing in results
*/
// @DataMember
public var includeAfterHoursServicingFields:Bool
/**
* Request Consultant ID (sign on)
*/
// @DataMember
public var requestConsultantID:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case account
case pnrCreationDateStart
case pnrCreationDateEnd
case owningAgencyLocationID
case loadOptions
case airlineSupportFormatStyle
case carSupportFormatStyle
case hotelSupportFormatStyle
case excludedCarrierCode
case mode
case topCarItems
case topHotelItems
case includeAfterHoursServicingFields
case requestConsultantID
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
account = try container.decodeIfPresent(String.self, forKey: .account)
pnrCreationDateStart = try container.decodeIfPresent(String.self, forKey: .pnrCreationDateStart)
pnrCreationDateEnd = try container.decodeIfPresent(String.self, forKey: .pnrCreationDateEnd)
owningAgencyLocationID = try container.decodeIfPresent([String].self, forKey: .owningAgencyLocationID) ?? []
loadOptions = try container.decodeIfPresent(AgencyReviewOptions.self, forKey: .loadOptions)
airlineSupportFormatStyle = try container.decodeIfPresent(FormattingStyle.self, forKey: .airlineSupportFormatStyle)
carSupportFormatStyle = try container.decodeIfPresent(FormattingStyle.self, forKey: .carSupportFormatStyle)
hotelSupportFormatStyle = try container.decodeIfPresent(FormattingStyle.self, forKey: .hotelSupportFormatStyle)
excludedCarrierCode = try container.decodeIfPresent(String.self, forKey: .excludedCarrierCode)
mode = try container.decodeIfPresent(AgencyReviewMode.self, forKey: .mode)
topCarItems = try container.decodeIfPresent(Int.self, forKey: .topCarItems)
topHotelItems = try container.decodeIfPresent(Int.self, forKey: .topHotelItems)
includeAfterHoursServicingFields = try container.decodeIfPresent(Bool.self, forKey: .includeAfterHoursServicingFields)
requestConsultantID = try container.decodeIfPresent(String.self, forKey: .requestConsultantID)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if account != nil { try container.encode(account, forKey: .account) }
if pnrCreationDateStart != nil { try container.encode(pnrCreationDateStart, forKey: .pnrCreationDateStart) }
if pnrCreationDateEnd != nil { try container.encode(pnrCreationDateEnd, forKey: .pnrCreationDateEnd) }
if owningAgencyLocationID != nil { try container.encode(owningAgencyLocationID, forKey: .owningAgencyLocationID) }
if loadOptions != nil { try container.encode(loadOptions, forKey: .loadOptions) }
if airlineSupportFormatStyle != nil { try container.encode(airlineSupportFormatStyle, forKey: .airlineSupportFormatStyle) }
if carSupportFormatStyle != nil { try container.encode(carSupportFormatStyle, forKey: .carSupportFormatStyle) }
if hotelSupportFormatStyle != nil { try container.encode(hotelSupportFormatStyle, forKey: .hotelSupportFormatStyle) }
if excludedCarrierCode != nil { try container.encode(excludedCarrierCode, forKey: .excludedCarrierCode) }
if mode != nil { try container.encode(mode, forKey: .mode) }
if topCarItems != nil { try container.encode(topCarItems, forKey: .topCarItems) }
if topHotelItems != nil { try container.encode(topHotelItems, forKey: .topHotelItems) }
if includeAfterHoursServicingFields != nil { try container.encode(includeAfterHoursServicingFields, forKey: .includeAfterHoursServicingFields) }
if requestConsultantID != nil { try container.encode(requestConsultantID, forKey: .requestConsultantID) }
}
}
// @DataContract(Namespace="schemas.agentivity.com/types")
public class CompanyLevelRequestBase : PagingMetadata, IMemberUsername, IMemberOwningCompanyCode
{
/**
* Comma Delimited List of Owning Company Codes
*/
// @DataMember
public var owningCompanyCode:[String]
/**
* UserName in form of an email address
*/
// @DataMember
public var userName:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case owningCompanyCode
case userName
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
owningCompanyCode = try container.decodeIfPresent([String].self, forKey: .owningCompanyCode) ?? []
userName = try container.decodeIfPresent(String.self, forKey: .userName)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if owningCompanyCode != nil { try container.encode(owningCompanyCode, forKey: .owningCompanyCode) }
if userName != nil { try container.encode(userName, forKey: .userName) }
}
}
// @DataContract(Name="Metadata", Namespace="schemas.agentivity.com/types")
public class PagingMetadata : Codable
{
/**
* Starting Record
*/
// @DataMember
// @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
public var offset:String
/**
* Number of records to return (PageSize)
*/
// @DataMember
// @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
public var limit:String
/**
* Total Number of Records in a Full Reponse (if no paging)
*/
// @DataMember
// @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
public var totalRecords:Int
/**
* Total Number of Records in this Reponse (on this page)
*/
// @DataMember
// @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
public var responseRecords:Int
required public init(){}
}
// @Flags()
public enum AgencyReviewOptions : Int, Codable
{
case None = 0
case Summary = 1
case AirlineSupport = 2
case SummaryAirlineSupport = 3
case CarSupport = 4
case HotelSupport = 8
case All = 15
}
// @Flags()
public enum FormattingStyle : Int, Codable
{
case None = 0
case Html = 1
case Charting = 2
}
// @Flags()
public enum AgencyReviewMode : Int, Codable
{
case Account = 0
case Pcc = 1
}
// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
public class AgencyReviewsResponse : CollectionResponse<AgencyReview>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
public class CollectionResponse<TItem : Codable> : Codable
{
// @DataMember(Order=1)
public var responseMetadata:ResponseMetadata
// @DataMember(Order=2, EmitDefaultValue=false)
public var responseReport:[ApiRequestPerHour]
// @DataMember(Order=3, EmitDefaultValue=false)
public var responseError:AgentivityError
required public init(){}
}
// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
public class ResponseMetadata : Codable
{
// @DataMember(Order=0)
public var success:Bool
// @DataMember(Order=1)
public var hasCache:Bool
// @DataMember(Order=2)
public var hasPaging:Bool
// @DataMember(Order=3, EmitDefaultValue=false)
public var cacheMetadata:CacheMetadata
// @DataMember(Order=4, EmitDefaultValue=false)
public var pagingMetadata:PagingMetadata
required public init(){}
}
// @DataContract(Name="CacheMetadata", Namespace="schemas.agentivity.com/types")
public class CacheMetadata : Codable
{
// @DataMember(Order=1)
public var cachedAt:Date
// @DataMember(Order=2)
public var cacheExpiresAt:Date
// @DataMember(Order=0)
public var isFromCache:Bool
required public init(){}
}
// @DataContract(Name="ApiRequestPerHour", Namespace="schemas.agentivity.com/types")
public class ApiRequestPerHour : Codable
{
// @DataMember(Order=10)
public var requestDate:Date
// @DataMember(Order=100)
public var hour0:Int
// @DataMember(Order=110)
public var hour1:Int
// @DataMember(Order=120)
public var hour2:Int
// @DataMember(Order=130)
public var hour3:Int
// @DataMember(Order=140)
public var hour4:Int
// @DataMember(Order=150)
public var hour5:Int
// @DataMember(Order=160)
public var hour6:Int
// @DataMember(Order=170)
public var hour7:Int
// @DataMember(Order=180)
public var hour8:Int
// @DataMember(Order=190)
public var hour9:Int
// @DataMember(Order=200)
public var hour10:Int
// @DataMember(Order=210)
public var hour11:Int
// @DataMember(Order=220)
public var hour12:Int
// @DataMember(Order=230)
public var hour13:Int
// @DataMember(Order=240)
public var hour14:Int
// @DataMember(Order=250)
public var hour15:Int
// @DataMember(Order=260)
public var hour16:Int
// @DataMember(Order=270)
public var hour17:Int
// @DataMember(Order=280)
public var hour18:Int
// @DataMember(Order=290)
public var hour19:Int
// @DataMember(Order=300)
public var hour20:Int
// @DataMember(Order=310)
public var hour21:Int
// @DataMember(Order=320)
public var hour22:Int
// @DataMember(Order=330)
public var hour23:Int
required public init(){}
}
// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
public class AgentivityError : Codable
{
// @DataMember
public var errorCode:String
// @DataMember
public var message:String
// @DataMember
public var statusCode:String
// @DataMember
public var verboseMessage:String
required public init(){}
}
// @DataContract(Name="AgencyReview", Namespace="schemas.agentivity.com/types")
public class AgencyReview : Codable
{
// @DataMember(Order=10)
public var summary:AgencyReviewSummary
// @DataMember(Order=20)
public var airlineSupport:AirlineSupport
// @DataMember(Order=30)
public var carSupport:CarSupport
// @DataMember(Order=40)
public var hotelSupport:HotelSupport
required public init(){}
}
// @DataContract(Name="AgencyReviewSummary", Namespace="schemas.agentivity.com/types")
public class AgencyReviewSummary : ICarbonTonnage, ICarbonEmissionDto, Codable
{
// @DataMember(Order=10)
public var ticketedBookings:Int
// @DataMember(Order=20)
public var lccTktBookings:Int
// @DataMember(Order=25)
public var assumedTicketedBookings:Int
// @DataMember(Order=30)
public var nonTicketedBookings:Int
// @DataMember(Order=40)
public var ticketedBookingsPerc:Int
// @DataMember(Order=50)
public var nonTicketedBookingsPerc:Int
// @DataMember(Order=60)
public var onlineBookings:Int
// @DataMember(Order=70)
public var offlineBookings:Int
// @DataMember(Order=80)
public var cxlBookings:Int
// @DataMember(Order=90)
public var offLineHtlBookings:Int
// @DataMember(Order=100)
public var bookingsWithHotelSegments:Int
// @DataMember(Order=110)
public var bookingsWithCarSegments:Int
// @DataMember(Order=120)
public var nonAirBookings:Int
// @DataMember(Order=130)
public var totalBookings:Int
// @DataMember(Order=140)
public var aeroTouches:Int?
// @DataMember(Order=145)
public var aeroTouchesAuto:Int
// @DataMember(Order=150)
public var averageItineraryChanges:Double
// @DataMember(Order=160)
public var averageAccountBookingToTravelTime:Double
// @DataMember(Order=170)
public var totalItineraryChangesBeforeTicketing:Int?
// @DataMember(Order=180)
public var totalItineraryChangesAfterTicketing:Int?
// @DataMember(Order=190)
public var totalItineraryChanges:Double
// @DataMember(Order=230)
public var bookingsWithNdcContent:Int
// @DataMember(Order=210)
public var carbonEmissionValue:Double?
// @DataMember(Order=220)
public var carbonEmissionUnitId:Int16?
// @DataMember(Order=200)
public var carbonTonnage:Double?
required public init(){}
}
// @DataContract(Name="AirlineSupport", Namespace="schemas.agentivity.com/types")
public class AirlineSupport : Codable
{
// @DataMember(Order=10)
public var airlinesStats:[AirlineStats]
// @DataMember(Order=20)
public var totalSegments:Int
// @DataMember(Order=30)
public var formattedAirlineSupport:String
required public init(){}
}
// @DataContract(Name="AirlineStats", Namespace="schemas.agentivity.com/types")
public class AirlineStats : Codable
{
// @DataMember(Order=10)
public var carrierCode:String
// @DataMember(Order=20)
public var carrier:String
// @DataMember(Order=30)
public var totalSegments:Int
required public init(){}
}
// @DataContract(Name="CarSupport", Namespace="schemas.agentivity.com/types")
public class CarSupport : Codable
{
// @DataMember(Order=10)
public var stats:[CarStats]
// @DataMember(Order=20)
public var totalSegments:Int
// @DataMember(Order=30)
public var formattedCarSupport:String
required public init(){}
}
// @DataContract(Name="CarStats", Namespace="schemas.agentivity.com/types")
public class CarStats : Codable
{
// @DataMember(Order=10)
public var vendorCode:String
// @DataMember(Order=20)
public var vendorName:String
// @DataMember(Order=30)
public var totalSegments:Int
required public init(){}
}
// @DataContract(Name="HotelSupport", Namespace="schemas.agentivity.com/types")
public class HotelSupport : Codable
{
// @DataMember(Order=10)
public var stats:[HotelStats]
// @DataMember(Order=20)
public var totalSegments:Int
// @DataMember(Order=30)
public var formattedHotelSupport:String
required public init(){}
}
// @DataContract(Name="HotelStats", Namespace="schemas.agentivity.com/types")
public class HotelStats : Codable
{
// @DataMember(Order=10)
public var vendorCode:String
// @DataMember(Order=20)
public var vendorName:String
// @DataMember(Order=30)
public var totalSegments:Int
// @DataMember(Order=40)
public var totalNights:Int
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 /AgencyReviews HTTP/1.1 Host: api.agentivity.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AgentivityResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="schemas.agentivity.com/types"> <ResponseMetadata> <Success>false</Success> <HasCache>false</HasCache> <HasPaging>false</HasPaging> <CacheMetadata> <IsFromCache>false</IsFromCache> <CachedAt>0001-01-01T00:00:00</CachedAt> <CacheExpiresAt>0001-01-01T00:00:00</CacheExpiresAt> </CacheMetadata> <PagingMetadata> <Limit>String</Limit> <Offset>String</Offset> <ResponseRecords>0</ResponseRecords> <TotalRecords>0</TotalRecords> </PagingMetadata> </ResponseMetadata> <ResponseReport> <AgencyReview> <Summary> <TicketedBookings>0</TicketedBookings> <LCCTktBookings>0</LCCTktBookings> <AssumedTicketedBookings>0</AssumedTicketedBookings> <NonTicketedBookings>0</NonTicketedBookings> <TicketedBookingsPerc>0</TicketedBookingsPerc> <NonTicketedBookingsPerc>0</NonTicketedBookingsPerc> <OnlineBookings>0</OnlineBookings> <OfflineBookings>0</OfflineBookings> <CxlBookings>0</CxlBookings> <OffLineHtlBookings>0</OffLineHtlBookings> <BookingsWithHotelSegments>0</BookingsWithHotelSegments> <BookingsWithCarSegments>0</BookingsWithCarSegments> <NonAirBookings>0</NonAirBookings> <TotalBookings>0</TotalBookings> <AeroTouches>0</AeroTouches> <AeroTouchesAuto>0</AeroTouchesAuto> <AverageItineraryChanges>0</AverageItineraryChanges> <AverageAccountBookingToTravelTime>0</AverageAccountBookingToTravelTime> <TotalItineraryChangesBeforeTicketing>0</TotalItineraryChangesBeforeTicketing> <TotalItineraryChangesAfterTicketing>0</TotalItineraryChangesAfterTicketing> <TotalItineraryChanges>0</TotalItineraryChanges> <CarbonTonnage>0</CarbonTonnage> <CarbonEmissionValue>0</CarbonEmissionValue> <CarbonEmissionUnitId>0</CarbonEmissionUnitId> <BookingsWithNdcContent>0</BookingsWithNdcContent> </Summary> <AirlineSupport> <AirlinesStats> <AirlineStats> <CarrierCode>String</CarrierCode> <Carrier>String</Carrier> <TotalSegments>0</TotalSegments> </AirlineStats> </AirlinesStats> <TotalSegments>0</TotalSegments> <FormattedAirlineSupport>String</FormattedAirlineSupport> </AirlineSupport> <CarSupport> <Stats> <CarStats> <VendorCode>String</VendorCode> <VendorName>String</VendorName> <TotalSegments>0</TotalSegments> </CarStats> </Stats> <TotalSegments>0</TotalSegments> <FormattedCarSupport>String</FormattedCarSupport> </CarSupport> <HotelSupport> <Stats> <HotelStats> <VendorCode>String</VendorCode> <VendorName>String</VendorName> <TotalSegments>0</TotalSegments> <TotalNights>0</TotalNights> </HotelStats> </Stats> <TotalSegments>0</TotalSegments> <FormattedHotelSupport>String</FormattedHotelSupport> </HotelSupport> </AgencyReview> </ResponseReport> <ResponseError> <ErrorCode>String</ErrorCode> <Message>String</Message> <StatusCode>String</StatusCode> <VerboseMessage>String</VerboseMessage> </ResponseError> </AgentivityResponse>