All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amadeus.airport.DirectDestinations Maven / Gradle / Ivy

package com.amadeus.airport;

import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.Destination;
import com.amadeus.resources.Resource;

/**
 * 

* A namespaced client for the * /v1/airport/direct-destinations endpoints. *

* *

* Access via the Amadeus client object. *

* *
 * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
 * amadeus.airport.directDestinations;
*/ public class DirectDestinations { private Amadeus client; /** * Constructor. * @hide */ public DirectDestinations(Amadeus client) { this.client = client; } /** *

* Find all destinations served by a given airport. *

* *
   * amadeus.airport.directDestinations.get(Params
   *     .with("departureAirportCode", "MAD")
   *     .and("max","2"));
   * 
* * @param params the parameters to send to the API * @return an API response object * @throws ResponseException when an exception occurs */ public Destination[] get(Params params) throws ResponseException { Response response = client.get("/v1/airport/direct-destinations", params); return (Destination[]) Resource.fromArray(response, Destination[].class); } /** * Convenience method for calling get without any parameters. * @see DirectDestinations#get() */ public Destination[] get() throws ResponseException { return get(null); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy