com.amadeus.referenceData.locations.PointsOfInterest Maven / Gradle / Ivy
package com.amadeus.referencedata.locations;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.referencedata.locations.pointsofinterest.BySquare;
import com.amadeus.resources.PointOfInterest;
import com.amadeus.resources.Resource;
import com.google.gson.Gson;
/**
*
* A namespaced client for the
* /v1/reference-data/locations/pois
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
* amadeus.referenceData.locations.pointsOfInterest;
*/
public class PointsOfInterest {
private Amadeus client;
/**
*
* A namespaced client for the
* /v1/reference-data/locations/pois/by-square
endpoints.
*
*/
public BySquare bySquare;
/**
* Constructor.
* @hide
*/
public PointsOfInterest(Amadeus client) {
this.client = client;
this.bySquare = new BySquare(client);
}
/**
*
* Returns a list of relevant point of interests near to a given point.
*
*
*
* amadeus.referenceData.locations.pointsOfInterest.get(Params
* .with("longitude", 2.160873)
* .and("latitude", 41.397158));
*
* @param params the parameters to send to the API
* @return an API response object
* @throws ResponseException when an exception occurs
*/
public PointOfInterest[] get(Params params) throws ResponseException {
Response response = client.get("/v1/reference-data/locations/pois", params);
return (PointOfInterest[]) Resource.fromArray(response, PointOfInterest[].class);
}
/**
* Convenience method for calling get
without any parameters.
* @see PointsOfInterest#get()
*/
public PointOfInterest[] get() throws ResponseException {
return get(null);
}
}