com.amadeus.referencedata.locations.hotels.ByCity Maven / Gradle / Ivy
package com.amadeus.referencedata.locations.hotels;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.Hotel;
import com.amadeus.resources.Resource;
/**
*
* A namespaced client for the
* /v1/reference-data/locations/hotels/by-city
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
* amadeus.referenceData.locations.hotels.byCity;
*/
public class ByCity {
private Amadeus client;
/**
* Constructor.
* @hide
*/
public ByCity(Amadeus client) {
this.client = client;
}
/**
*
* Returns a list of relevant hotels inside a city.
*
*
*
* amadeus.referenceData.locations.hotels.byCity.get(Params
* .with("cityCode", "PAR"));
*
* @param params the parameters to send to the API
* @return an API response object
* @throws ResponseException when an exception occurs
*/
public Hotel[] get(Params params) throws ResponseException {
Response response = client.get("/v1/reference-data/locations/hotels/by-city", params);
return (Hotel[]) Resource.fromArray(response, Hotel[].class);
}
/**
* Convenience method for calling get
without any parameters.
* @see ByCity#get()
*/
public Hotel[] get() throws ResponseException {
return get(null);
}
}