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

com.amadeus.referencedata.locations.Cities Maven / Gradle / Ivy

package com.amadeus.referencedata.locations;

import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.City;
import com.amadeus.resources.Resource;

/**
 * 

* A namespaced client for the * /v1/reference-data/locations/cities endpoints. *

* *

* Access via the Amadeus client object. *

* *
 * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
 * amadeus.referenceData.locations.cities;
*/ public class Cities { private Amadeus client; /** * Constructor. * @hide */ public Cities(Amadeus client) { this.client = client; } /** *

* Returns a list of relevant cities that match a specific word or string of letters. *

* *
   * amadeus.referenceData.locations.cities.get(Params
   *   .with("keyword", "PARIS");
* * @param params the parameters to send to the API * @return an API response object * @throws ResponseException when an exception occurs */ public City[] get(Params params) throws ResponseException { Response response = client.get("/v1/reference-data/locations/cities", params); return (City[]) Resource.fromArray(response, City[].class); } /** * Convenience method for calling get without any parameters. * @see Cities#get() */ public City[] get() throws ResponseException { return get(null); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy