com.amadeus.shopping.hotel.Offer Maven / Gradle / Ivy
package com.amadeus.shopping.hotel;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.HotelOffer;
import com.amadeus.resources.Resource;
import com.google.gson.Gson;
/**
*
* A namespaced client for the
* /v1/shopping/hotel/:hotel_id/offers
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
* amadeus.shopping.hotel(hotelId).offers;
*/
public class Offer {
private Amadeus client;
private String hotelId;
private String offerId;
/**
* Constructor.
* @hide
*/
public Offer(Amadeus client, String hotelId, String offerId) {
this.client = client;
this.hotelId = hotelId;
this.offerId = offerId;
}
/**
*
* Get room and rate details.
*
*
*
* amadeus.shopping.hotel("SMPARCOL")
* .offer("AC7D4DA2C322A73AF0824318A4965DA2805A3FC2")
* .get();
*
* @param params the parameters to send to the API
* @return an API response object
* @throws ResponseException when an exception occurs
*/
public HotelOffer.Offer get(Params params) throws ResponseException {
String path = String.format("/v1/shopping/hotels/%s/offers/%s", hotelId, offerId);
Response response = client.get(path, params);
return (HotelOffer.Offer) Resource.fromObject(response, HotelOffer.Offer.class);
}
/**
* Convenience method for calling get
without any parameters.
* @see Offer#get()
*/
public HotelOffer.Offer get() throws ResponseException {
return get(null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy