public BookingResponseSettingsBase( CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata) { CarrierSchema = carrierSchema; LocationSchema = locationSchema; }
public BookingQuerySettings(BookingRequestSettingsBase requestSettings, CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata) { BookingRequest = requestSettings; BookingResponse = new BookingResponseSettingsBase(carrierSchema, locationSchema); }
public BookingResponseSettings(Itinerary itinerary, CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata) { FlightResponse = itinerary.FlightResponse; CarrierSchema = carrierSchema; LocationSchema = locationSchema; Itinerary = itinerary; }
public BookingResponseSettings(Itinerary itinerary, CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata) : base(carrierSchema, locationSchema) { FlightResponse = itinerary.FlightResponse; Itinerary = itinerary; }
public async Task <BookingResponseBase> QueryBooking(string sessionKey, string outboundLegId, string inboundLegId, CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata, CancellationToken cancellationToken = default(CancellationToken)) { var settings = new BookingQuerySettings( new BookingRequestSettingsBase(sessionKey, outboundLegId, inboundLegId), carrierSchema, locationSchema); return(await QueryBooking(settings, cancellationToken)); }
/// <summary> /// Initializes a new instance of the FlightResponseSettings with the specified parameters /// </summary> /// <param name="sortType">The property to sort on</param> /// <param name="sortOrder">Sort direction</param> /// <param name="maxStops">Filter for maximum number of stops. Between 0 and 3</param> /// <param name="maxDuration">Filter for maximum duration in minutes</param> /// <param name="outboundDepartureTime">Filter for outbound departure time by time period of the day </param> /// <param name="outboundDepartureStartTime">Filter for start of range for outbound departure time</param> /// <param name="outboundDepartureEndTime">Filter for end of range for outbound departure time</param> /// <param name="inboundDepartureTime">Filter for inbound departure time by time period of the day </param> /// <param name="inboundDepartureStartTime">Filter for start of range for inbound departure time</param> /// <param name="inboundDepartureEndTime">Filter for end of range for inbound departure time</param> /// <param name="originAirports">Origin airports to filter on. List of airport codes</param> /// <param name="destinationAirports">Destination airports to filter on. List of airport codes</param> /// <param name="includeCarriers">Filter flights by the specified carriers. Must be Iata carrier codes</param> /// <param name="excludeCarriers">Filter flights by any but the specified carriers. Must be Iata carrier codes</param> /// <param name="carrierSchema">The code schema to use for carriers</param> /// <param name="locationSchema">The code schema used for locations</param> public FlightResponseSettings( SortType sortType = SortType.Price, SortOrder sortOrder = SortOrder.Ascending, int?maxStops = null, int?maxDuration = null, DayTimePeriod?outboundDepartureTime = null, LocalTime?outboundDepartureStartTime = null, LocalTime?outboundDepartureEndTime = null, DayTimePeriod?inboundDepartureTime = null, LocalTime?inboundDepartureStartTime = null, LocalTime?inboundDepartureEndTime = null, IEnumerable <string> originAirports = null, IEnumerable <string> destinationAirports = null, IEnumerable <string> includeCarriers = null, IEnumerable <string> excludeCarriers = null, CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata) { if (maxStops.HasValue && (maxStops.Value < 0 || maxStops.Value > 3)) { throw new ArgumentException("The filter for maximum number of stops must be between 0 and 3", nameof(maxStops)); } if (maxDuration.HasValue && (maxDuration.Value < 0 || maxDuration.Value > 1800)) { throw new ArgumentException("The filter for maximum duration must be between 0 and 1800", nameof(maxDuration)); } MaxDuration = maxDuration; MaxStops = maxStops; SortOrder = sortOrder; SortType = sortType; CarrierSchema = carrierSchema; LocationSchema = locationSchema; OriginAirports = originAirports; DestinationAirports = destinationAirports; IncludeCarriers = includeCarriers; ExcludeCarriers = excludeCarriers; OutboundDepartureTime = outboundDepartureTime; OutboundDepartureStartTime = outboundDepartureStartTime; OutboundDepartureEndTime = outboundDepartureEndTime; InboundDepartureTime = inboundDepartureTime; InboundDepartureStartTime = inboundDepartureStartTime; InboundDepartureEndTime = inboundDepartureEndTime; }
/// <summary> /// Initializes a new instance of the FlightResponseSettings with the specified parameters /// </summary> /// <param name="sortType">The property to sort on</param> /// <param name="sortOrder">Sort direction</param> /// <param name="maxStops">Filter for maximum number of stops. Between 0 and 3</param> /// <param name="maxDuration">Filter for maximum duration in minutes</param> /// <param name="outboundDepartureTime">Filter for outbound departure time by time period of the day </param> /// <param name="outboundDepartureStartTime">Filter for start of range for outbound departure time</param> /// <param name="outboundDepartureEndTime">Filter for end of range for outbound departure time</param> /// <param name="inboundDepartureTime">Filter for inbound departure time by time period of the day </param> /// <param name="inboundDepartureStartTime">Filter for start of range for inbound departure time</param> /// <param name="inboundDepartureEndTime">Filter for end of range for inbound departure time</param> /// <param name="originAirports">Origin airports to filter on. List of airport codes</param> /// <param name="destinationAirports">Destination airports to filter on. List of airport codes</param> /// <param name="includeCarriers">Filter flights by the specified carriers. Must be Iata carrier codes</param> /// <param name="excludeCarriers">Filter flights by any but the specified carriers. Must be Iata carrier codes</param> /// <param name="carrierSchema">The code schema to use for carriers</param> /// <param name="locationSchema">The code schema used for locations</param> public FlightResponseSettings( SortType sortType = SortType.Price, SortOrder sortOrder = SortOrder.Ascending, int? maxStops = null, int? maxDuration = null, DayTimePeriod? outboundDepartureTime = null, LocalTime? outboundDepartureStartTime = null, LocalTime? outboundDepartureEndTime = null, DayTimePeriod? inboundDepartureTime = null, LocalTime? inboundDepartureStartTime = null, LocalTime? inboundDepartureEndTime = null, IEnumerable<string> originAirports = null, IEnumerable<string> destinationAirports = null, IEnumerable<string> includeCarriers = null, IEnumerable<string> excludeCarriers = null, CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata) { if (maxStops.HasValue && (maxStops.Value < 0 || maxStops.Value > 3)) { throw new ArgumentException("The filter for maximum number of stops must be between 0 and 3", nameof(maxStops)); } if (maxDuration.HasValue && (maxDuration.Value < 0 || maxDuration.Value > 1800)) { throw new ArgumentException("The filter for maximum duration must be between 0 and 1800", nameof(maxDuration)); } MaxDuration = maxDuration; MaxStops = maxStops; SortOrder = sortOrder; SortType = sortType; CarrierSchema = carrierSchema; LocationSchema = locationSchema; OriginAirports = originAirports; DestinationAirports = destinationAirports; IncludeCarriers = includeCarriers; ExcludeCarriers = excludeCarriers; OutboundDepartureTime = outboundDepartureTime; OutboundDepartureStartTime = outboundDepartureStartTime; OutboundDepartureEndTime = outboundDepartureEndTime; InboundDepartureTime = inboundDepartureTime; InboundDepartureStartTime = inboundDepartureStartTime; InboundDepartureEndTime = inboundDepartureEndTime; }