com.amadeus.shopping.HotelOffersSearch Maven / Gradle / Ivy
package com.amadeus.shopping;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.HotelOfferSearch;
import com.amadeus.resources.Resource;
/**
*
* A namespaced client for the
* /v3/shopping/hotel-offers
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
* amadeus.shopping.hotelOffersSearch;
*/
public class HotelOffersSearch {
private Amadeus client;
/**
* Constructor.
* @hide
*/
public HotelOffersSearch(Amadeus client) {
this.client = client;
}
/**
*
* Search for hotels and retrieve availability and rates information.
*
*
*
* amadeus.shopping.hotelOffers.get(Params
* .with("hotelIds", "MCLONGHM")
* .and("adults", 1)
* .and("checkInDate", "2022-11-22")
* .and("roomQuantity", 1)
* .and("paymentPolicy", "NONE")
* .and("bestRateOnly", true));
*
* @param params the parameters to send to the API
* @return an API response object
* @throws ResponseException when an exception occurs
*/
public HotelOfferSearch[] get(Params params) throws ResponseException {
Response response = client.get("/v3/shopping/hotel-offers", params);
return (HotelOfferSearch[]) Resource.fromArray(response, HotelOfferSearch[].class);
}
/**
* Convenience method for calling get
without any parameters.
* @see HotelOffersSearch#get()
*/
public HotelOfferSearch[] get() throws ResponseException {
return get(null);
}
}