Skip to content

Commit d5556ff

Browse files
committed
add location score
1 parent 6c581c3 commit d5556ff

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ amadeus.referenceData.locations.pointsOfInterest.bySquare.get({
386386
// Extract the information about point of interest with ID '9CB40CB5D0'
387387
amadeus.referenceData.locations.pointOfInterest('9CB40CB5D0').get()
388388

389+
// Location Score
390+
amadeus.location.analytics.categoryRatedAreas.get({
391+
latitude : 41.397158,
392+
longitude : 2.160873
393+
})
394+
389395
// Safe Place
390396
// How safe is Barcelona? (based a geo location and a radius)
391397
amadeus.safety.safetyRatedLocations.get({

src/amadeus.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Airport from './amadeus/namespaces/airport';
1111
import Safety from './amadeus/namespaces/safety';
1212
import Schedule from './amadeus/namespaces/schedule';
1313
import Analytics from './amadeus/namespaces/analytics';
14+
import Location from './amadeus/namespaces/location';
1415

1516

1617
/**
@@ -74,6 +75,7 @@ class Amadeus {
7475
this.safety = new Safety(this.client);
7576
this.schedule = new Schedule(this.client);
7677
this.analytics = new Analytics(this.client);
78+
this.location = new Location(this.client);
7779
}
7880

7981
/**

src/amadeus/namespaces/location.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Analytics from './location/analytics';
2+
3+
/**
4+
* A namespaced client for the
5+
* `/v1/location` endpoints
6+
*
7+
* Access via the {@link Amadeus} object
8+
*
9+
* ```js
10+
* let amadeus = new Amadeus();
11+
* amadeus.location;
12+
* ```
13+
*
14+
* @param {Client} client
15+
* @property {analytics} analytics
16+
*/
17+
class Location {
18+
constructor(client) {
19+
this.client = client;
20+
this.analytics = new Analytics(client);
21+
}
22+
}
23+
24+
export default Location;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import CategoryRatedAreas from './analytics/category_rated_areas';
2+
3+
/**
4+
* A namespaced client for the
5+
* `/v1/location/analytics` endpoints
6+
*
7+
* Access via the {@link Amadeus} object
8+
*
9+
* ```js
10+
* let amadeus = new Amadeus();
11+
* amadeus.location;
12+
* ```
13+
*
14+
* @param {Client} client
15+
* @property {analytics} CategoryRatedAreas
16+
*/
17+
class Analytics {
18+
constructor(client) {
19+
this.client = client;
20+
this.categoryRatedAreas = new CategoryRatedAreas(client);
21+
}
22+
}
23+
24+
export default Analytics;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* A namespaced client for the
3+
* `/v1/location/analytics/category-rated-areas` endpoints
4+
*
5+
* Access via the {@link Amadeus} object
6+
*
7+
* ```js
8+
* let amadeus = new Amadeus();
9+
* amadeus.referenceData.locations.pointsOfInterest;
10+
* ```
11+
*
12+
* @param {Client} client
13+
*/
14+
class CategoryRatedAreas {
15+
constructor(client) {
16+
this.client = client;
17+
}
18+
19+
/**
20+
* Gets popularity score for location categories
21+
*
22+
* @param {Object} params
23+
* @param {Double} params.latitude latitude location to be at the center of
24+
* the search circle - required
25+
* @param {Double} params.longitude longitude location to be at the center of
26+
* the search circle - required
27+
* @param {Double} params.radius radius of the search in Kilometer - optional
28+
* @return {Promise.<Response,ResponseError>} a Promise
29+
*
30+
* ets popularity score for location categories in Barcelona
31+
*
32+
* ```js
33+
* amadeus.location.analytics.categoryRatedAreas.get({
34+
* longitude: 2.160873,
35+
* latitude: 41.397158
36+
* });
37+
* ```
38+
*/
39+
get(params = {}) {
40+
return this.client.get('/v1/location/analytics/category-rated-areas', params);
41+
}
42+
}
43+
44+
export default CategoryRatedAreas;

0 commit comments

Comments
 (0)