Skip to content

Commit

Permalink
Merge pull request #244 from amadeus4dev/remove-hotelv2
Browse files Browse the repository at this point in the history
Remove Hotel Search v2
  • Loading branch information
tsolakoua authored Jan 27, 2023
2 parents 3c1905c + 3411806 commit f9c9056
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 623 deletions.
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ This library conveniently maps every API path to a similar path. For example, `G
amadeus.referenceData.urls.checkinLinks.get(Params.with("airlineCode", "BA"));
```

Similarly, to select a resource by ID, you can pass in the ID to the **singular** path. For example, `GET /v2/shopping/hotel-offers/XXX` would be:
Similarly, to select a resource by ID, you can pass in the ID to the **singular** path. For example, `GET v1/reference-data/locations/pois` would be:

```java
amadeus.shopping.hotelOffer("XXX").get(...);
amadeus.referenceData.locations.pointOfInterest("9CB40CB5D0").get();
```

You can make any arbitrary API call as well directly with the `.get` method.
Expand Down Expand Up @@ -268,22 +268,6 @@ Period[] busiestPeriods = amadeus.travel.analytics.airTraffic.busiestPeriod.get(
.and("period", "2017")
.and("direction", BusiestPeriod.ARRIVING));

// Hotel Search API
// Get list of hotels by city code
HotelOffer[] offers = amadeus.shopping.hotelOffers.get(Params
.with("cityCode", "MAD"));
// Get list of offers for a specific hotel
HotelOffer hotelOffer = amadeus.shopping.hotelOffersByHotel.get(Params.with("hotelId", "BGLONBGB"));
// Confirm the availability of a specific offer
HotelOffer offer = amadeus.shopping.hotelOffer("4BA070CE929E135B3268A9F2D0C51E9D4A6CF318BA10485322FA2C7E78C7852E").get();

// Hotel Booking
// The body can be a String version of your JSON or a JsonObject
HotelBooking[] hotel = amadeus.booking.hotelBookings.post(body);

// Hotel Ratings / Sentiments
HotelSentiment[] hotelSentiments = amadeus.ereputation.hotelSentiments.get(Params.with("hotelIds", "ELONMFS,ADNYCCTB"));

// Points of Interest
// What are the popular places in Barcelona (based a geo location and a radius)
PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.get(Params
Expand Down Expand Up @@ -444,13 +428,20 @@ Hotel[] result = amadeus.referenceData.locations.hotel.get(Params
HotelOfferSearch[] offers = amadeus.shopping.hotelOffersSearch.get(Params
.with("hotelIds", "MCLONGHM")
.and("adults", 1)
.and("checkInDate", "2022-11-22")
.and("checkInDate", "2023-05-22")
.and("roomQuantity", 1)
.and("paymentPolicy", "NONE")
.and("bestRateOnly", true));
// Get hotel offer pricing by offer id
HotelOfferSearch offer = amadeus.shopping.hotelOfferSearch("QF3MNOBDQ8").get();

// Hotel Booking
// The body can be a String version of your JSON or a JsonObject
HotelBooking[] hotel = amadeus.booking.hotelBookings.post(body);

// Hotel Ratings / Sentiments
HotelSentiment[] hotelSentiments = amadeus.ereputation.hotelSentiments.get(Params.with("hotelIds", "ELONMFS,ADNYCCTB"));

// Airline Routes
// Get airline destinations
Destination[] destinations = amadeus.airline.destinations.get(Params
Expand Down
31 changes: 0 additions & 31 deletions src/main/java/com/amadeus/Shopping.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import com.amadeus.shopping.FlightDestinations;
import com.amadeus.shopping.FlightOffers;
import com.amadeus.shopping.FlightOffersSearch;
import com.amadeus.shopping.HotelOffer;
import com.amadeus.shopping.HotelOfferSearch;
import com.amadeus.shopping.HotelOffers;
import com.amadeus.shopping.HotelOffersByHotel;
import com.amadeus.shopping.HotelOffersSearch;
import com.amadeus.shopping.SeatMaps;

Expand Down Expand Up @@ -66,14 +63,6 @@ public class Shopping {
*/
public FlightOffersSearch flightOffersSearch;

/**
* <p>
* A namespaced client for the
* <code>/v2/shopping/hotel-offers</code> endpoints.
* </p>
*/
public HotelOffers hotelOffers;

/**
* <p>
* A namespaced client for the
Expand All @@ -82,14 +71,6 @@ public class Shopping {
*/
public HotelOffersSearch hotelOffersSearch;

/**
* <p>
* A namespaced client for the
* <code>/v2/shopping/hotel-offers/by-hotel</code> endpoints.
* </p>
*/
public HotelOffersByHotel hotelOffersByHotel;

/**
* <p>
* A namespaced client for the
Expand Down Expand Up @@ -131,25 +112,13 @@ public Shopping(Amadeus client) {
this.flightDates = new FlightDates(client);
this.flightDestinations = new FlightDestinations(client);
this.flightOffers = new FlightOffers(client);
this.hotelOffers = new HotelOffers(client);
this.hotelOffersSearch = new HotelOffersSearch(client);
this.hotelOffersByHotel = new HotelOffersByHotel(client);
this.flightOffersSearch = new FlightOffersSearch(client);
this.seatMaps = new SeatMaps(client);
this.activities = new Activities(client);
this.availability = new Availability(client);
}

/**
* <p>
* A namespaced client for the
* <code>/v1/shopping/hotel/:hotel_id</code> endpoints.
* </p>
*/
public HotelOffer hotelOffer(String hotelId) {
return new HotelOffer(client, hotelId);
}

/**
* <p>
* A namespaced client for the
Expand Down
Loading

0 comments on commit f9c9056

Please sign in to comment.