Class: SabreDevStudio::Flight::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/sabre_dev_studio-flight/api.rb

Class Method Summary collapse

Class Method Details

.airports_at_cities_lookup(options) ⇒ Object

Airports At Cities Lookup

Documentation:

developer.sabre.com/docs/read/rest_apis/airports_at_cities_lookup

Example:

options = { :city => 'NYC' }
city_pairs = SabreDevStudio::Flight::Api.airports_at_cities_lookup(options)


203
204
205
206
# File 'lib/sabre_dev_studio-flight/api.rb', line 203

def self.airports_at_cities_lookup(options)
  endpoint = '/v1/lists/airports'
  SabreDevStudio::Flight::AirportsAtCitiesLookup.new(endpoint, options)
end

.city_pairs_lookup(options) ⇒ Object

City Pairs Lookup

Documentation:

developer.sabre.com/docs/read/rest_apis/city_pairs_lookup

Example:

options = {
  :origincountry       => 'US',
  :destinationcountry  => 'US'
}
city_pairs = SabreDevStudio::Flight::Api.city_pairs_lookup


175
176
177
178
# File 'lib/sabre_dev_studio-flight/api.rb', line 175

def self.city_pairs_lookup(options)
  endpoint = '/v1/lists/airports/supported/origins-destinations'
  SabreDevStudio::Flight::CityPairsLookup.new(endpoint, options)
end

.destination_finder(options) ⇒ Object Also known as: destination_air_shop

Shop for a destination (from a list of generalized destinations) given a date range

Documentation:

developer.sabre.com/docs/read/rest_apis/destination_finder

Note: Timezones are specific to the departure and arrival airports (but not specified).

Example:

options = {
  :origin        => 'LAS',
  :departuredate => '2014-06-22',
  :returndate    => '2014-06-23',
  :theme         => 'MOUNTAINS'
}
fares = SabreDevStudio::Flight::Api.destination_finder(options)


59
60
61
62
# File 'lib/sabre_dev_studio-flight/api.rb', line 59

def self.destination_finder(options)
  endpoint = '/v1/shop/flights/fares'
  SabreDevStudio::Flight::DestinationFinder.new(endpoint, options)
end

.fare_range(options) ⇒ Object

Fare Range

Documentation:

developer.sabre.com/docs/read/rest_apis/fare_range

Example:

options = {
  :origin                => 'JFK',
  :destination           => 'LAX',
  :earliestdeparturedate => '2014-06-01',
  :latestdeparturedate   => '2014-06-01',
  :lengthofstay          => 4
}
fare_range = SabreDevStudio::Flight::Api.fare_range(options)


145
146
147
148
# File 'lib/sabre_dev_studio-flight/api.rb', line 145

def self.fare_range(options)
  endpoint = '/v1/historical/flights/fares'
  SabreDevStudio::Flight::FareRange.new(endpoint, options)
end

.instaflights_search(options) ⇒ Object Also known as: single_date_air_shop

Shop for a fare with an origin for a destination with departure and return dates

Documentation:

developer.sabre.com/docs/read/rest_apis/instaflights_search

Example:

options = {
  :origin        => 'ATL',
  :destination   => 'LAS',
  :departuredate => '2014-06-22',
  :returndate    => '2014-06-23',
  :limit         => 10,
  :sortby        => 'totalfare',
  :order         => 'asc',
  :sortby2       => 'departuretime',
  :order2        => 'dsc'
}
itineraries = SabreDevStudio::Flight::Api.instaflights_search(options); nil


105
106
107
108
# File 'lib/sabre_dev_studio-flight/api.rb', line 105

def self.instaflights_search(options)
  endpoint = '/v1/shop/flights'
  SabreDevStudio::Flight::InstaflightsSearch.new(endpoint, options)
end

.lead_price_calendar(options) ⇒ Object Also known as: future_dates_lead_fare_shop

Future Dates Lead Fare Search, aka “Calendar Lead”

Documentation:

developer.sabre.com/docs/read/rest_apis/lead_price_calendar

Note: Timezones are specific to the departure and arrival airports (but not specified).

Example:

options = {
  :origin        => 'ATL',
  :destination   => 'LAS',
  :lengthofstay  => 5
}
fares = SabreDevStudio::Flight::Api.lead_price_calendar(options)


80
81
82
83
# File 'lib/sabre_dev_studio-flight/api.rb', line 80

def self.lead_price_calendar(options)
  endpoint = '/v1/shop/flights/fares'
  SabreDevStudio::Flight::LeadPriceCalendar.new(endpoint, options)
end

.low_fare_forecast(options) ⇒ Object

Low Fare Forecast

Documentation:

developer.sabre.com/docs/rest_apis/low_fare_forecast

Example:

options = {
  :origin        => 'JFK',
  :destination   => 'LAX',
  :departuredate => '2014-10-01',
  :returndate    => '2014-10-05'
}
forecast = SabreDevStudio::Flight::Api.low_fare_forecast(options)


125
126
127
128
# File 'lib/sabre_dev_studio-flight/api.rb', line 125

def self.low_fare_forecast(options)
  endpoint = '/v1/forecast/flights/fares'
  SabreDevStudio::Flight::LowFareForecast.new(endpoint, options)
end

.multiairport_city_lookup(options) ⇒ Object

Multi-Airport City Lookup

Documentation:

developer.sabre.com/docs/read/rest_apis/multiairport_city_lookup

Example:

options = { :country => 'US' }
city_pairs = SabreDevStudio::Flight::Api.multiairport_city_lookup(options)


189
190
191
192
# File 'lib/sabre_dev_studio-flight/api.rb', line 189

def self.multiairport_city_lookup(options)
  endpoint = '/v1/lists/cities'
  SabreDevStudio::Flight::MultiairportCityLookup.new(endpoint, options)
end

.theme_airport_lookup(theme) ⇒ Object

Theme Airport Lookup

Documentation:

developer.sabre.com/docs/read/rest_apis/theme_airport_lookup

Example:

airports = SabreDevStudio::Flight::Api.theme_airport_lookup('BEACH')


38
39
40
41
# File 'lib/sabre_dev_studio-flight/api.rb', line 38

def self.theme_airport_lookup(theme)
  endpoint = "/v1/shop/themes/#{theme}"
  SabreDevStudio::Flight::ThemeAirportLookup.new(endpoint)
end

.travel_seasonality(destination) ⇒ Object

Travel Seasonality

Documentation:

developer.sabre.com/docs/read/rest_apis/travel_seasonality

Example:

travel_seasonality = SabreDevStudio::Flight::Api.travel_seasonality('DFW')


158
159
160
161
# File 'lib/sabre_dev_studio-flight/api.rb', line 158

def self.travel_seasonality(destination)
  endpoint = "/v1/historical/flights/#{destination}/seasonality"
  SabreDevStudio::Flight::TravelSeasonality.new(endpoint)
end

.travel_theme_lookupObject Also known as: air_shopping_themes

List of Air Shopping Themes

Documentation:

developer.sabre.com/docs/read/rest_apis/travel_theme_lookup

Example:

air_shopping_themes = SabreDevStudio::Flight::Api.travel_theme_lookup


24
25
26
27
# File 'lib/sabre_dev_studio-flight/api.rb', line 24

def self.travel_theme_lookup
  endpoint = '/v1/shop/themes'
  SabreDevStudio::Flight::TravelThemeLookup.new(endpoint)
end