From 393e81b4aa4aeda31a07e2a7645ccf4954bbb6ab Mon Sep 17 00:00:00 2001
From: Anna Tsolakou
+ * A namespaced client for the
+ *
+ * A namespaced client for the
+ *
+ * Access via the Amadeus client object.
+ *
+ * Returns a list of destination recommendations.
+ * /v1/reference-data/recommended-locations
endpoints.
+ * /v1/reference-data/recommended-locations
endpoints.
+ *
+ * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
+ * amadeus.referenceData.locations.recommendedLocations;
+ */
+public class RecommendedLocations {
+ private Amadeus client;
+
+ /**
+ * Constructor.
+ * @hide
+ */
+ public RecommendedLocations(Amadeus client) {
+ this.client = client;
+ }
+
+ /**
+ *
+ * amadeus.referenceData.locations.recommendedLocations.get(Params
+ * .with("cityCodes", "PAR")
+ * .and("travelerCountryCode", "FR"));
+ *
+ * @param params the parameters to send to the API
+ * @return an API response object
+ * @throws ResponseException when an exception occurs
+ */
+ public Location[] get(Params params) throws ResponseException {
+ Response response = client.get("/v1/reference-data/recommended-locations", params);
+ return (Location[]) Resource.fromArray(response, Location[].class);
+ }
+
+ /**
+ * Convenience method for calling get
without any parameters.
+ * @see Location#get()
+ */
+ public Location[] get() throws ResponseException {
+ return get(null);
+ }
+}
diff --git a/src/test/java/com/amadeus/NamespaceTest.java b/src/test/java/com/amadeus/NamespaceTest.java
index 773a5433..018e31a1 100644
--- a/src/test/java/com/amadeus/NamespaceTest.java
+++ b/src/test/java/com/amadeus/NamespaceTest.java
@@ -12,6 +12,7 @@
import com.amadeus.referenceData.Locations;
import com.amadeus.referenceData.locations.Airports;
import com.amadeus.referenceData.locations.PointsOfInterest;
+import com.amadeus.referenceData.RecommendedLocations;
import com.amadeus.referenceData.urls.CheckinLinks;
import com.amadeus.safety.SafetyRatedLocations;
import com.amadeus.shopping.FlightDates;
@@ -54,6 +55,7 @@ public void testAllNamespacesExist() {
TestCase.assertNotNull(client.referenceData.locations.pointsOfInterest.bySquare);
TestCase.assertNotNull(client.referenceData.locations.pointOfInterest("XXX"));
TestCase.assertNotNull(client.referenceData.location("123"));
+ TestCase.assertNotNull(client.referenceData.recommendedLocations);
TestCase.assertNotNull(client.referenceData.airlines);
TestCase.assertNotNull(client.travel.analytics.airTraffic.traveled);
TestCase.assertNotNull(client.travel.analytics.airTraffic.booked);
@@ -164,6 +166,16 @@ public void testGetMethods() throws ResponseException {
TestCase.assertNotNull(poi.get(params));
TestCase.assertEquals(poi.get().length, 2);
+ // Testing travel recommendations
+ Mockito.when(client.get("/v1/reference-data/recommended-locations", null))
+ .thenReturn(multiResponse);
+ Mockito.when(client.get("/v1/reference-data/recommended-locations", params))
+ .thenReturn(multiResponse);
+ RecommendedLocations destinations = new RecommendedLocations(client);
+ TestCase.assertNotNull(destinations.get());
+ TestCase.assertNotNull(destinations.get(params));
+ TestCase.assertEquals(destinations.get().length, 2);
+
// Testing safe place by coordinates
Mockito.when(client.get("/v1/safety/safety-rated-locations", null))
.thenReturn(multiResponse);
From 21f6707c748ace557157835cbc0b92967db3f0f9 Mon Sep 17 00:00:00 2001
From: Anna Tsolakou
* Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
- * amadeus.referenceData.locations.recommendedLocations;
+ * amadeus.referenceData.recommendedLocations;
*/
public class RecommendedLocations {
private Amadeus client;
@@ -39,7 +39,7 @@ public RecommendedLocations(Amadeus client) {
*
- * amadeus.referenceData.locations.recommendedLocations.get(Params + * amadeus.referenceData.recommendedLocations.get(Params * .with("cityCodes", "PAR") * .and("travelerCountryCode", "FR"));*