Skip to content

Commit

Permalink
Merge pull request #188 from amadeus4dev/remove-hotel-v2-&-travel-res…
Browse files Browse the repository at this point in the history
…triction-v1

january 2023 2 APIs decommissions
  • Loading branch information
tsolakoua authored Jan 27, 2023
2 parents af82911 + 5b9a27e commit f75d403
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 255 deletions.
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ amadeus.referenceData.locations.cities.get({
keyword: 'Paris'
})

//Hotel Name Autocomplete API
//Autocomplete a hotel search field
amadeus.referenceData.locations.hotel.get({
keyword: 'PARI',
subType: 'HOTEL_GDS'
})

//Hotel List API
//Get list of hotels by city code
amadeus.referenceData.locations.hotels.byCity.get({
Expand All @@ -385,25 +392,6 @@ amadeus.referenceData.locations.hotels.byHotels.get({
hotelIds: 'ACPAR245'
})

//Hotel Name Autocomplete API
//Autocomplete a hotel search field
amadeus.referenceData.locations.hotel.get({
keyword: 'PARI',
subType: 'HOTEL_GDS'
})

// Hotel Search API V2
// Get list of hotels by city code
amadeus.shopping.hotelOffers.get({
cityCode : 'MAD'
})
// Get list of offers for a specific hotel
amadeus.shopping.hotelOffersByHotel.get({
hotelId : 'XKPARC12'
})
// Confirm the availability of a specific offer id
amadeus.shopping.hotelOffer('XXX').get()

// Hotel Search API V3
// Get list of available offers in specific hotels by hotel ids
amadeus.shopping.hotelOffersSearch.get({
Expand Down Expand Up @@ -554,12 +542,6 @@ amadeus.dutyOfCare.diseases.covid19Report.get({
language: 'EN'
});

// Travel Restrictions API v1
amadeus.dutyOfCare.diseases.covid19AreaReport.get({
countryCode: 'US',
cityCode: 'NYC'
});

```
## Development & Contributing
Expand Down
38 changes: 0 additions & 38 deletions spec/amadeus/namespaces.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ describe('Namespaces', () => {
expect(amadeus.booking).toBeDefined();
expect(amadeus.booking.flightOrders).toBeDefined();

expect(amadeus.shopping.hotelOffers).toBeDefined();
expect(amadeus.shopping.hotelOffersByHotel).toBeDefined();
expect(amadeus.shopping.hotelOffer).toBeDefined();

expect(amadeus.shopping.hotelOfferSearch).toBeDefined();
expect(amadeus.shopping.hotelOffersSearch).toBeDefined();

Expand Down Expand Up @@ -101,7 +97,6 @@ describe('Namespaces', () => {

expect(amadeus.dutyOfCare).toBeDefined();
expect(amadeus.dutyOfCare.diseases).toBeDefined();
expect(amadeus.dutyOfCare.diseases.covid19AreaReport).toBeDefined();
expect(amadeus.dutyOfCare.diseases.covid19Report).toBeDefined();

expect(amadeus.airline.destinations).toBeDefined();
Expand Down Expand Up @@ -134,10 +129,6 @@ describe('Namespaces', () => {
expect(amadeus.shopping.flightOffersSearch.get).toBeDefined();
expect(amadeus.shopping.seatmaps.get).toBeDefined();

expect(amadeus.shopping.hotelOffers.get).toBeDefined();
expect(amadeus.shopping.hotelOffersByHotel.get).toBeDefined();
expect(amadeus.shopping.hotelOffer('XXX').get).toBeDefined();

expect(amadeus.shopping.hotelOfferSearch('XXX').get).toBeDefined();
expect(amadeus.shopping.hotelOffersSearch.get).toBeDefined();

Expand All @@ -161,7 +152,6 @@ describe('Namespaces', () => {

expect(amadeus.location.analytics.categoryRatedAreas.get).toBeDefined();

expect(amadeus.dutyOfCare.diseases.covid19AreaReport.get).toBeDefined();
expect(amadeus.dutyOfCare.diseases.covid19Report.get).toBeDefined();

expect(amadeus.airline.destinations.get).toBeDefined();
Expand Down Expand Up @@ -391,27 +381,6 @@ describe('Namespaces', () => {
.toHaveBeenCalledWith('/v1/shopping/seatmaps', {});
});

it('.amadeus.shopping.hotelOffers.get', () => {
amadeus.client.get = jest.fn();
amadeus.shopping.hotelOffers.get();
expect(amadeus.client.get)
.toHaveBeenCalledWith('/v2/shopping/hotel-offers', {});
});

it('.amadeus.shopping.hotelOffersByHotel.get', () => {
amadeus.client.get = jest.fn();
amadeus.shopping.hotelOffersByHotel.get();
expect(amadeus.client.get)
.toHaveBeenCalledWith('/v2/shopping/hotel-offers/by-hotel', {});
});

it('.amadeus.shopping.hotelOffer().get', () => {
amadeus.client.get = jest.fn();
amadeus.shopping.hotelOffer('XXX').get();
expect(amadeus.client.get)
.toHaveBeenCalledWith('/v2/shopping/hotel-offers/XXX', {});
});

it('.amadeus.shopping.hotelOfferSearch().get', () => {
amadeus.client.get = jest.fn();
amadeus.shopping.hotelOfferSearch('XXX').get();
Expand Down Expand Up @@ -538,13 +507,6 @@ describe('Namespaces', () => {
.toHaveBeenCalledWith('/v1/shopping/flight-offers/upselling', {});
});

it('.amadeus.dutyOfCare.diseases.covid19AreaReport.get', () => {
amadeus.client.get = jest.fn();
amadeus.dutyOfCare.diseases.covid19AreaReport.get();
expect(amadeus.client.get)
.toHaveBeenCalledWith('/v1/duty-of-care/diseases/covid19-area-report', {});
});

it('.amadeus.dutyOfCare.diseases.covid19Report.get', () => {
amadeus.client.get = jest.fn();
amadeus.dutyOfCare.diseases.covid19Report.get();
Expand Down
4 changes: 1 addition & 3 deletions src/amadeus/namespaces/duty_of_care/diseases.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Covid19AreaReport from './diseases/covid19_area_report';
import Covid19Report from './diseases/covid19_report';
/**
* A namespaced client for the
* `/v1/duty-of-care/diseases` and `/v2/duty-of-care/diseases` endpoints
* `/v2/duty-of-care/diseases` endpoints
*
* Access via the {@link Amadeus} object
*
Expand All @@ -16,7 +15,6 @@ import Covid19Report from './diseases/covid19_report';
class Diseases {
constructor(client) {
this.client = client;
this.covid19AreaReport = new Covid19AreaReport(client);
this.covid19Report = new Covid19Report(client);
}
}
Expand Down

This file was deleted.

19 changes: 0 additions & 19 deletions src/amadeus/namespaces/shopping.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import FlightOffers from './shopping/flight_offers';
import FlightOffersSearch from './shopping/flight_offers_search';
import FlightDates from './shopping/flight_dates';
import Seatmaps from './shopping/seatmaps';
import HotelOffers from './shopping/hotel_offers';
import HotelOffersByHotel from './shopping/hotel_offers_by_hotel';
import HotelOffer from './shopping/hotel_offer';
import HotelOfferSearch from './shopping/hotel_offer_search';
import HotelOffersSearch from './shopping/hotel_offers_search';
import Activities from './shopping/activities';
Expand All @@ -30,9 +27,6 @@ import Availability from './shopping/availability';
* @property {FlightOffersSearch} flightOffersSearch
* @property {FlightDates} flightDates
* @property {Seatmaps} seatmaps
* @property {HotelOffers} hotelOffers
* @property {HotelOffer} hotelOffer
* @property {HotelOffersByHotel} hotelOffersByHotel
* @property {HotelOfferSearch} hotelOffers
* @property {HotelOffersSearch} hotelOffers
* @property {Availability} availability
Expand All @@ -45,24 +39,11 @@ class Shopping {
this.flightOffersSearch = new FlightOffersSearch(client);
this.flightDates = new FlightDates(client);
this.seatmaps = new Seatmaps(client);
this.hotelOffers = new HotelOffers(client);
this.hotelOffersByHotel = new HotelOffersByHotel(client);
this.hotelOffersSearch = new HotelOffersSearch(client);
this.activities = new Activities(client);
this.availability = new Availability(client);
}


/**
* Loads a namespaced path for a specific offer ID for Hotel Search V2
*
* @param {string} [offerId] The ID of the offer for a dedicated hotel
* @return {HotelOffer}
**/
hotelOffer(offerId) {
return new HotelOffer(this.client, offerId);
}

/**
* Loads a namespaced path for a specific offer ID for Hotel Search V3
*
Expand Down
40 changes: 0 additions & 40 deletions src/amadeus/namespaces/shopping/hotel_offer.js

This file was deleted.

45 changes: 0 additions & 45 deletions src/amadeus/namespaces/shopping/hotel_offers.js

This file was deleted.

40 changes: 0 additions & 40 deletions src/amadeus/namespaces/shopping/hotel_offers_by_hotel.js

This file was deleted.

0 comments on commit f75d403

Please sign in to comment.