com.amadeus.travel.analytics.FareSearches Maven / Gradle / Ivy
package com.amadeus.travel.analytics;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.FareSearch;
import com.amadeus.resources.Resource;
import com.google.gson.Gson;
/**
*
* A namespaced client for the
* /v1/travel/analytics/fare-searches
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
* amadeus.travel.analytics.fareSearches;
*/
public class FareSearches {
private Amadeus client;
/**
* Constructor.
* @hide
*/
public FareSearches(Amadeus client) {
this.client = client;
}
/**
*
* The Fare Search History API allows to find the number of
* estimated searches from an origin, optionally a destination,
* within a time period when travelers are performing the searches.
*
*
*
* amadeus.travel.analytics.fareSearches.get(Params
* .with("origin", "LHR")
* .and("sourceCountry", "FR")
* .and("period", 2011));
*
* @param params the parameters to send to the API
* @return an API response object
* @throws ResponseException when an exception occurs
*/
public FareSearch[] get(Params params) throws ResponseException {
Response response = client.get("/v1/travel/analytics/fare-searches", params);
return (FareSearch[]) Resource.fromArray(response, FareSearch[].class);
}
/**
* Convenience method for calling get
without any parameters.
* @see FareSearches#get()
*/
public FareSearch[] get() throws ResponseException {
return get(null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy