Skip to content

Commit

Permalink
add location score
Browse files Browse the repository at this point in the history
  • Loading branch information
tsolakoua committed Jun 2, 2021
1 parent 6c581c3 commit d5556ff
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ amadeus.referenceData.locations.pointsOfInterest.bySquare.get({
// Extract the information about point of interest with ID '9CB40CB5D0'
amadeus.referenceData.locations.pointOfInterest('9CB40CB5D0').get()

// Location Score
amadeus.location.analytics.categoryRatedAreas.get({
latitude : 41.397158,
longitude : 2.160873
})

// Safe Place
// How safe is Barcelona? (based a geo location and a radius)
amadeus.safety.safetyRatedLocations.get({
Expand Down
2 changes: 2 additions & 0 deletions src/amadeus.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Airport from './amadeus/namespaces/airport';
import Safety from './amadeus/namespaces/safety';
import Schedule from './amadeus/namespaces/schedule';
import Analytics from './amadeus/namespaces/analytics';
import Location from './amadeus/namespaces/location';


/**
Expand Down Expand Up @@ -74,6 +75,7 @@ class Amadeus {
this.safety = new Safety(this.client);
this.schedule = new Schedule(this.client);
this.analytics = new Analytics(this.client);
this.location = new Location(this.client);
}

/**
Expand Down
24 changes: 24 additions & 0 deletions src/amadeus/namespaces/location.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Analytics from './location/analytics';

/**
* A namespaced client for the
* `/v1/location` endpoints
*
* Access via the {@link Amadeus} object
*
* ```js
* let amadeus = new Amadeus();
* amadeus.location;
* ```
*
* @param {Client} client
* @property {analytics} analytics
*/
class Location {
constructor(client) {
this.client = client;
this.analytics = new Analytics(client);
}
}

export default Location;
24 changes: 24 additions & 0 deletions src/amadeus/namespaces/location/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import CategoryRatedAreas from './analytics/category_rated_areas';

/**
* A namespaced client for the
* `/v1/location/analytics` endpoints
*
* Access via the {@link Amadeus} object
*
* ```js
* let amadeus = new Amadeus();
* amadeus.location;
* ```
*
* @param {Client} client
* @property {analytics} CategoryRatedAreas
*/
class Analytics {
constructor(client) {
this.client = client;
this.categoryRatedAreas = new CategoryRatedAreas(client);
}
}

export default Analytics;
44 changes: 44 additions & 0 deletions src/amadeus/namespaces/location/analytics/category_rated_areas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* A namespaced client for the
* `/v1/location/analytics/category-rated-areas` endpoints
*
* Access via the {@link Amadeus} object
*
* ```js
* let amadeus = new Amadeus();
* amadeus.referenceData.locations.pointsOfInterest;
* ```
*
* @param {Client} client
*/
class CategoryRatedAreas {
constructor(client) {
this.client = client;
}

/**
* Gets popularity score for location categories
*
* @param {Object} params
* @param {Double} params.latitude latitude location to be at the center of
* the search circle - required
* @param {Double} params.longitude longitude location to be at the center of
* the search circle - required
* @param {Double} params.radius radius of the search in Kilometer - optional
* @return {Promise.<Response,ResponseError>} a Promise
*
* ets popularity score for location categories in Barcelona
*
* ```js
* amadeus.location.analytics.categoryRatedAreas.get({
* longitude: 2.160873,
* latitude: 41.397158
* });
* ```
*/
get(params = {}) {
return this.client.get('/v1/location/analytics/category-rated-areas', params);
}
}

export default CategoryRatedAreas;

0 comments on commit d5556ff

Please sign in to comment.