Class: Amadeus::Namespaces::Travel::Predictions::TripPurpose

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

Overview

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

Access via the Amadeus::Client object

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

Instance Method Summary collapse

Instance Method Details

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

Predicts traveler purpose, Business or Leisure,

with the probability in the context of search & shopping

Examples:

what is the name of airline code ‘U2’

amadeus.travel.predictions.trip_purpose.get(
                originLocationCode: 'NYC',
                destinationLocationCode: 'MAD',
                departureDate: '2020-08-01',
                returnDate: '2020-08-12',
                searchDate: '2020-06-11')

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :originLocationCode (String)

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

  • :destinationLocationCode (String)

    the City/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

  • :returnDate (String)

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

  • :searchDate (String)

    date on which the traveler performs the search, in ‘YYYY-MM-DD` format. If it is not specified the current date will be used - optional

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



39
40
41
# File 'lib/amadeus/namespaces/travel/predictions/trip_purpose.rb', line 39

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