Class: Amadeus::Namespaces::Travel::Predictions::FlightDelay

Inherits:
Client::Decorator
  • Object
show all
Defined in:
lib/amadeus/namespaces/travel/predictions/flight_delay.rb

Overview

A namespaced client for the /v1/travel/predictions/flight_delay endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.travel.predictions.flight_delay

Instance Method Summary collapse

Instance Method Details

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

Forecast the chances for a flight to be delayed

Examples:

amadeus.travel.predictions.flight_delay.get(originLocationCode: 'NCE',
                                            destinationLocationCode: 'IST',
                                             departureDate: '2020-08-01',
                                             departureTime: '18:20:00',
                                             arrivalDate: '2020-08-01',
                                             arrivalTime: '22:15:00',
                                             aircraftCode: '321',
                                             carrierCode: 'TK',
                                             flightNumber: '1816',
                                             duration: 'PT31H10M')

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :originLocationCode (String)

    the Airport IATA code from which the flight will depart. ““NYC”“, for example for New York - required

  • :destinationLocationCode (String)

    the Airport IATA code to which the flight is going. ““MAD”“, for example for Madrid - required

  • :departureDate (String)

    the date on which to fly out, in ‘YYYY-MM-DD` format - required

  • :departureTime (String)

    local time on which to fly out, in ‘HH:MM:SS` format - required

  • :arrivalDate (String)

    date on which the flight returns to the origin, in ‘YYYY-MM-DD` format - required

  • :arrivalTime (String)

    local time on which to fly out, in ‘HH:MM:SS` format - required

  • :aircraftCode (String)

    IATA aircraft code - required

  • :carrierCode (String)

    airline / carrier code - required

  • :flightNumber (String)

    flight number - required

  • :duration (String)

    flight duration, in ‘PnYnMnDTnHnMnS` format e.g. PT2H10M - required

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



48
49
50
# File 'lib/amadeus/namespaces/travel/predictions/flight_delay.rb', line 48

def get(params = {})
  client.get('/v1/travel/predictions/flight-delay', params)
end