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

com.amadeus.shopping.HotelOffers 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.HotelOffer;
import com.amadeus.resources.Resource;
import com.google.gson.Gson;

/**
 * 

* A namespaced client for the * /v1/shopping/hotel-offers endpoints. *

* *

* Access via the Amadeus client object. *

* *
 * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
 * amadeus.shopping.hotelOffers;
*/ public class HotelOffers { private Amadeus client; /** * Constructor. * @hide */ public HotelOffers(Amadeus client) { this.client = client; } /** *

* Search for hotels and retrieve availability and rates information. *

* *
   * amadeus.shopping.hotelOffers.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 HotelOffer[] get(Params params) throws ResponseException { Response response = client.get("/v2/shopping/hotel-offers", params); return (HotelOffer[]) Resource.fromArray(response, HotelOffer[].class); } /** * Convenience method for calling get without any parameters. * @see HotelOffers#get() */ public HotelOffer[] get() throws ResponseException { return get(null); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy