Class: Amadeus::Namespaces::Shopping::FlightOffersSearch

Inherits:
Client::Decorator
  • Object
show all
Defined in:
lib/amadeus/namespaces/shopping/flight_offers_search.rb,
lib/amadeus/namespaces/shopping/flight_offers_search/prediction.rb

Overview

A namespaced client for the /v2/shopping/flight-offers endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.shopping.flight_offers_search

Defined Under Namespace

Classes: Prediction

Instance Method Summary collapse

Instance Method Details

#get(params = {}) ⇒ Amadeus::Response

Find the cheapest bookable flights.

Examples:

Find the cheapest flight offers from New-York to Madrid,

for the first of October 2020
amadeus.shopping.flight_offers_search.get(
  originLocationCode: 'NYC',
  destinationLocationCode: 'MAD',
  departureDate: '2020-10-01',
  adults: 1
)

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :origin (String)

    City/Airport IATA code from which the flight will depart. BOS, for example.

  • :destination (String)

    City/Airport IATA code to which the traveler is going. PAR, for example

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



42
43
44
# File 'lib/amadeus/namespaces/shopping/flight_offers_search.rb', line 42

def get(params = {})
  client.get('/v2/shopping/flight-offers', params)
end

#post(params = {}) ⇒ Amadeus::Response

Find the cheapest bookable flights.

Examples:

amadeus.shopping.flight_offers_search.post(body)

Parameters:

  • body (Hash)

    a customizable set of options

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



55
56
57
# File 'lib/amadeus/namespaces/shopping/flight_offers_search.rb', line 55

def post(params = {})
  client.post('/v2/shopping/flight-offers', params)
end

#predictionAmadeus::Namespaces::Shopping::FlightOffersSearch::Prediction

The namespace for the Prediction API:

Examples:

amadeus.shopping.flight_offers_search.prediction

Returns:



21
22
23
# File 'lib/amadeus/namespaces/shopping/flight_offers_search.rb', line 21

def prediction
  Amadeus::Namespaces::Shopping::FlightOffersSearch::Prediction.new(client)
end