All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amadeus.shopping.HotelOffer 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.Resource;

/**
 * 

* A namespaced client for the * /v2/shopping/hotel-offers/:offer_id endpoints. *

* *

* Access via the Amadeus client object *

* *
 * Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build();
 * amadeus.shopping.HotelOffer(offerId);
* * @hide */ public class HotelOffer { private Amadeus client; private String offerId; /** * Constructor. * @hide */ public HotelOffer(Amadeus client, String offerId) { this.offerId = offerId; this.client = client; } /** *

* Returns details for a specific offer. *

* *
   * amadeus.shopping.HotelOffer("XXX").get();
* * @param params the parameters to send to the API * @return an API response object * @throws ResponseException when an exception occurs */ public com.amadeus.resources.HotelOffer get(Params params) throws ResponseException { String path = String.format("/v2/shopping/hotel-offers/%s", offerId); Response response = client.get(path, params); return (com.amadeus.resources.HotelOffer) Resource.fromObject( response, com.amadeus.resources.HotelOffer.class); } /** * Convenience method for calling get without any parameters. * @see com.amadeus.resources.HotelOffer#get() */ public com.amadeus.resources.HotelOffer get() throws ResponseException { return get(null); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy