public async Task EnhancedAirBookTest() { { //var odi = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegment //{ // DepartureDateTime = "2019-02-21T09:30", // FlightNumber = "1815", // NumberInParty = "1", // ResBookDesigCode = "Y", // Status = "NN", // InstantPurchase = false, // DestinationLocation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentDestinationLocation { LocationCode = "JFK" }, // MarketingAirline = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentMarketingAirline { Code = "DL", FlightNumber = "1815" }, // OriginLocation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentOriginLocation { LocationCode = "LAS" } //}; } var sessionManager = new SessionManager(_logger); var session = await sessionManager.CreateSession(_credentials, "SessionCreateRQ"); var odi = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegment { DepartureDateTime = "2019-04-16T11:02:00", FlightNumber = "1366", NumberInParty = "1", ResBookDesigCode = "Y", Status = "NN", InstantPurchase = false, DestinationLocation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentDestinationLocation { LocationCode = "LAX" }, MarketingAirline = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentMarketingAirline { Code = "AA", FlightNumber = "1366" }, OperatingAirline = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentOperatingAirline { Code = "AA" }, OriginLocation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentOriginLocation { LocationCode = "LAS" } }; var client = new SabreApi(_logger); var enhacnedReq = new Enh.EnhancedAirBookRQ { version = "3.9.0", HaltOnError = true, IgnoreOnError = true, OTA_AirBookRQ = new Enh.EnhancedAirBookRQOTA_AirBookRQ { HaltOnStatus = new Enh.EnhancedAirBookRQOTA_AirBookRQHaltOnStatus[] { new Enh.EnhancedAirBookRQOTA_AirBookRQHaltOnStatus { Code = "UC" } }, RetryRebook = new Enh.EnhancedAirBookRQOTA_AirBookRQRetryRebook { Option = true }, RedisplayReservation = new Enh.EnhancedAirBookRQOTA_AirBookRQRedisplayReservation { NumAttempts = "5", WaitInterval = "2000" }, OriginDestinationInformation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegment[] { odi } }, PostProcessing = new Enh.EnhancedAirBookRQPostProcessing { IgnoreAfter = false, RedisplayReservation = new Enh.EnhancedAirBookRQPostProcessingRedisplayReservation { WaitInterval = "5000" } }, PreProcessing = new Enh.EnhancedAirBookRQPreProcessing { IgnoreBefore = false, UniqueID = new Enh.EnhancedAirBookRQPreProcessingUniqueID { ID = "PCOLDH" } }, //OTA_AirPriceRQ = new Enh.EnhancedAirBookRQOTA_AirPriceRQ[] //{ // new Enh.EnhancedAirBookRQOTA_AirPriceRQ // { // PriceRequestInformation = new Enh.EnhancedAirBookRQOTA_AirPriceRQPriceRequestInformation // { // OptionalQualifiers=new Enh.EnhancedAirBookRQOTA_AirPriceRQPriceRequestInformationOptionalQualifiers // { // PricingQualifiers = new Enh.EnhancedAirBookRQOTA_AirPriceRQPriceRequestInformationOptionalQualifiersPricingQualifiers // { // CurrencyCode = "USD", // PassengerType = new Enh.EnhancedAirBookRQOTA_AirPriceRQPriceRequestInformationOptionalQualifiersPricingQualifiersPassengerType[] // { // new Enh.EnhancedAirBookRQOTA_AirPriceRQPriceRequestInformationOptionalQualifiersPricingQualifiersPassengerType // { // Code="ADT", // Quantity="1", // Force=true // } // } // } // } // } // } //} }; var schedule = await client.GetEnhancedAirBook(session, enhacnedReq); schedule.Should().NotBeNull(); var resp = JsonConvert.SerializeObject(schedule.EnhancedAirBookRS); _logger.Debug(resp); var response = await sessionManager.CloseSession(session); response.Should().Be("Approved"); }
private Enh.EnhancedAirBookRQ GetEnhancedRequest(string pnr, IList <FlightDescription> flightDescriptions) { var segments = flightDescriptions.Select(i => new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegment { DepartureDateTime = i.DepartureDateTime, FlightNumber = i.FlightNumber, NumberInParty = i.NumberInParty, ResBookDesigCode = i.ResBookDesigCode, Status = i.Status, InstantPurchase = i.InstantPurchase, DestinationLocation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentDestinationLocation { LocationCode = i.DestinationLocation }, OriginLocation = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentOriginLocation { LocationCode = i.OriginLocation }, MarketingAirline = new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentMarketingAirline { Code = i.MarketingAirline, FlightNumber = i.FlightNumber }, OperatingAirline = string.IsNullOrWhiteSpace(i.OperatingAirline) ? null : new Enh.EnhancedAirBookRQOTA_AirBookRQFlightSegmentOperatingAirline { Code = i.OperatingAirline } }).ToArray(); var preProcessing = new Enh.EnhancedAirBookRQPreProcessing { }; var enhacnedReq = new Enh.EnhancedAirBookRQ { version = "3.9.0", HaltOnError = true, IgnoreOnError = true, OTA_AirBookRQ = new Enh.EnhancedAirBookRQOTA_AirBookRQ { HaltOnStatus = new Enh.EnhancedAirBookRQOTA_AirBookRQHaltOnStatus[] { new Enh.EnhancedAirBookRQOTA_AirBookRQHaltOnStatus { Code = "UC" } }, RetryRebook = new Enh.EnhancedAirBookRQOTA_AirBookRQRetryRebook { Option = true }, RedisplayReservation = new Enh.EnhancedAirBookRQOTA_AirBookRQRedisplayReservation { NumAttempts = "5", WaitInterval = "2000" }, OriginDestinationInformation = segments }, PostProcessing = new Enh.EnhancedAirBookRQPostProcessing { IgnoreAfter = false, RedisplayReservation = new Enh.EnhancedAirBookRQPostProcessingRedisplayReservation { UnmaskCreditCard = true, WaitInterval = "5000" } }, PreProcessing = new Enh.EnhancedAirBookRQPreProcessing { IgnoreBeforeSpecified = true, IgnoreBefore = false, UniqueID = string.IsNullOrWhiteSpace(pnr) ? null : new Enh.EnhancedAirBookRQPreProcessingUniqueID { ID = pnr } } //PreProcessing = new Enh.EnhancedAirBookRQPreProcessing { IgnoreBefore = true/*, UniqueID = new Enh.EnhancedAirBookRQPreProcessingUniqueID { ID = "JEGYLT" } */} }; return(enhacnedReq); }