Skip to content

Commit 90bb15f

Browse files
Travel Restrictions API added
1 parent ad9c8f3 commit 90bb15f

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

src/amadeus.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Safety from './amadeus/namespaces/safety';
1212
import Schedule from './amadeus/namespaces/schedule';
1313
import Analytics from './amadeus/namespaces/analytics';
1414
import Location from './amadeus/namespaces/location';
15+
import DutyOfCare from './amadeus/namespaces/duty_of_care';
1516

1617

1718
/**
@@ -76,6 +77,7 @@ class Amadeus {
7677
this.schedule = new Schedule(this.client);
7778
this.analytics = new Analytics(this.client);
7879
this.location = new Location(this.client);
80+
this.dutyOfCare = new DutyOfCare(this.client);
7981
}
8082

8183
/**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Diseases from './duty_of_care/diseases';
2+
/**
3+
* A namespaced client for the
4+
* `/v1/duty-of-care` endpoint
5+
*
6+
* Access via the {@link Amadeus} object
7+
*
8+
* @param {Client} client
9+
* @property {Diseases} diseases
10+
*/
11+
class DutyOfCare {
12+
constructor(client) {
13+
this.client = client;
14+
this.diseases = new Diseases(client);
15+
}
16+
17+
}
18+
19+
export default DutyOfCare;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Covid19AreaReport from './diseases/covid19_area_report';
2+
/**
3+
* A namespaced client for the
4+
* `/v1/duty-of-care/diseases` endpoints
5+
*
6+
* Access via the {@link Amadeus} object
7+
*
8+
* ```js
9+
* let amadeus = new Amadeus();
10+
* amadeus.dutyOfCare.diseases;
11+
* ```
12+
*
13+
* @param {Client} client
14+
*/
15+
class Diseases {
16+
constructor(client) {
17+
this.client = client;
18+
this.covid19AreaReport = new Covid19AreaReport(client);
19+
}
20+
}
21+
22+
export default Diseases;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* A namespaced client for the
3+
* `/v1/duty-of-care/diseases/covid19-area-report` endpoints
4+
*
5+
* Access via the {@link Amadeus} object
6+
*
7+
* ```js
8+
* let amadeus = new Amadeus();
9+
* amadeus.dutyOfCare.diseases.covid19AreaReport;
10+
* ```
11+
*
12+
* @param {Client} client
13+
*/
14+
class Covid19AreaReport {
15+
constructor(client) {
16+
this.client = client;
17+
}
18+
19+
/**
20+
* Returns Covid-19 related restrictions for a given country
21+
*
22+
* @param {Object} params
23+
* @param {string} params.countryCode ISO 3166 Alpha-2 code. e.g. "US" United States of America.
24+
* @return {Promise.<Response,ResponseError>} a Promise
25+
*
26+
* Returns Covid-19 restrictions in the United States
27+
*
28+
* ```js
29+
* amadeus.dutyOfCare.diseases.covid19AreaReport.get({
30+
* countryCode: 'US'
31+
* }).then(function(response){
32+
* console.log(response.data);
33+
* }).catch(function(responseError){
34+
* console.log(responseError);
35+
* });
36+
* ```
37+
*/
38+
39+
40+
get(params = {}) {
41+
return this.client.get('/v1/duty-of-care/diseases/covid19-area-report', params);
42+
}
43+
}
44+
45+
export default Covid19AreaReport;

0 commit comments

Comments
 (0)