From a9e4282a1ca4e94cf0981f17941488c8c08881de Mon Sep 17 00:00:00 2001 From: Rachik ABIDI Date: Wed, 7 Feb 2018 14:48:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Release=201.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding ridesharing feature --- Cartfile | 2 +- Cartfile.resolved | 4 - package.json | 2 +- plugin.xml | 4 +- scripts/ios/carthage.js | 2 +- src/android/build.gradle | 4 +- .../kisio/CDVNavitiaSDK/CDVNavitiaSDK.java | 6399 ++++++++++++----- src/ios/CDVNavitiaSDK.swift | 4709 ++++++++---- www/NavitiaSDK.js | 2841 ++++++-- 9 files changed, 10286 insertions(+), 3681 deletions(-) diff --git a/Cartfile b/Cartfile index 8355b60..197bfe7 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "CanalTP/NavitiaSDK_ios" ~> 1.0 \ No newline at end of file +github "CanalTP/NavitiaSDK_ios" ~> 1.1.0 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved index 59020f8..e69de29 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,4 +0,0 @@ -github "Alamofire/Alamofire" "4.6.0" -github "CanalTP/NavitiaSDK_ios" "1.0.0" -github "Hearst-DD/ObjectMapper" "2.2.9" -github "tristanhimmelman/AlamofireObjectMapper" "4.1.0" diff --git a/package.json b/package.json index a46b09c..0209060 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-navitia-sdk", - "version": "1.0.0", + "version": "1.1.0", "description": "Cordova plugin for NavitiaSDK iOS & Android", "cordova": { "id": "org-kisio-plugins-navitia-sdk", diff --git a/plugin.xml b/plugin.xml index fab5912..65ad3b9 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + NavitiaSDK @@ -35,4 +35,4 @@ - + \ No newline at end of file diff --git a/scripts/ios/carthage.js b/scripts/ios/carthage.js index abcadbb..cfb8ab8 100644 --- a/scripts/ios/carthage.js +++ b/scripts/ios/carthage.js @@ -34,4 +34,4 @@ module.exports = function(ctx) { }); return deferral.promise; -}; +}; \ No newline at end of file diff --git a/src/android/build.gradle b/src/android/build.gradle index cd48935..9f96cd7 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -6,5 +6,5 @@ repositories { } dependencies { - compile 'org.kisio.sdk:navitia-sdk:0.3.0' -} + compile 'org.kisio.sdk:navitia-sdk:1.0.0' +} \ No newline at end of file diff --git a/src/android/org/kisio/CDVNavitiaSDK/CDVNavitiaSDK.java b/src/android/org/kisio/CDVNavitiaSDK/CDVNavitiaSDK.java index 5f8857f..86b3a38 100644 --- a/src/android/org/kisio/CDVNavitiaSDK/CDVNavitiaSDK.java +++ b/src/android/org/kisio/CDVNavitiaSDK/CDVNavitiaSDK.java @@ -11,10 +11,13 @@ import org.kisio.NavitiaSDK.NavitiaSDK; import org.kisio.NavitiaSDK.NavitiaConfiguration; +import org.kisio.NavitiaSDK.apis.AddressesApi; import org.kisio.NavitiaSDK.apis.CalendarsApi; import org.kisio.NavitiaSDK.apis.CommercialModesApi; import org.kisio.NavitiaSDK.apis.CompaniesApi; import org.kisio.NavitiaSDK.apis.ContributorsApi; +import org.kisio.NavitiaSDK.apis.CoordApi; +import org.kisio.NavitiaSDK.apis.CoordsApi; import org.kisio.NavitiaSDK.apis.CoverageApi; import org.kisio.NavitiaSDK.apis.DatasetsApi; import org.kisio.NavitiaSDK.apis.DisruptionsApi; @@ -31,6 +34,7 @@ import org.kisio.NavitiaSDK.apis.NextArrivalsApi; import org.kisio.NavitiaSDK.apis.NextDeparturesApi; import org.kisio.NavitiaSDK.apis.PhysicalModesApi; +import org.kisio.NavitiaSDK.apis.PlaceUriApi; import org.kisio.NavitiaSDK.apis.PlacesApi; import org.kisio.NavitiaSDK.apis.PlacesNearbyApi; import org.kisio.NavitiaSDK.apis.PoiTypesApi; @@ -38,7 +42,6 @@ import org.kisio.NavitiaSDK.apis.PtobjectsApi; import org.kisio.NavitiaSDK.apis.RouteSchedulesApi; import org.kisio.NavitiaSDK.apis.RoutesApi; -import org.kisio.NavitiaSDK.apis.StatusApi; import org.kisio.NavitiaSDK.apis.StopAreasApi; import org.kisio.NavitiaSDK.apis.StopPointsApi; import org.kisio.NavitiaSDK.apis.StopSchedulesApi; @@ -117,6 +120,72 @@ private DateTime stringToDateTime(String value) { } public CDVNavitiaSDK() { + actions.put("coverageLonLatAddresses", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatAddresses(params, callbackContext); + } + }); + actions.put("coverageLonLatAddressesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatAddressesId(params, callbackContext); + } + }); + actions.put("coverageLonLatUriAddresses", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriAddresses(params, callbackContext); + } + }); + actions.put("coverageLonLatUriAddressesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriAddressesId(params, callbackContext); + } + }); + actions.put("coverageRegionAddresses", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionAddresses(params, callbackContext); + } + }); + actions.put("coverageRegionAddressesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionAddressesId(params, callbackContext); + } + }); + actions.put("coverageRegionUriAddresses", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionUriAddresses(params, callbackContext); + } + }); + actions.put("coverageRegionUriAddressesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionUriAddressesId(params, callbackContext); + } + }); + actions.put("coverageLonLatCalendars", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatCalendars(params, callbackContext); + } + }); + actions.put("coverageLonLatCalendarsId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatCalendarsId(params, callbackContext); + } + }); + actions.put("coverageLonLatUriCalendars", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriCalendars(params, callbackContext); + } + }); actions.put("coverageRegionCalendars", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -279,6 +348,114 @@ public void doAction(JSONObject params, CallbackContext callbackContext) { coverageRegionUriContributorsId(params, callbackContext); } }); + actions.put("coordLonLat", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coordLonLat(params, callbackContext); + } + }); + actions.put("coordsLonLat", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coordsLonLat(params, callbackContext); + } + }); + actions.put("coverageLonLatCoord", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatCoord(params, callbackContext); + } + }); + actions.put("coverageLonLatCoordId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatCoordId(params, callbackContext); + } + }); + actions.put("coverageLonLatCoords", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatCoords(params, callbackContext); + } + }); + actions.put("coverageLonLatCoordsId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatCoordsId(params, callbackContext); + } + }); + actions.put("coverageLonLatUriCoord", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriCoord(params, callbackContext); + } + }); + actions.put("coverageLonLatUriCoordId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriCoordId(params, callbackContext); + } + }); + actions.put("coverageLonLatUriCoords", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriCoords(params, callbackContext); + } + }); + actions.put("coverageLonLatUriCoordsId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriCoordsId(params, callbackContext); + } + }); + actions.put("coverageRegionCoord", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionCoord(params, callbackContext); + } + }); + actions.put("coverageRegionCoordId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionCoordId(params, callbackContext); + } + }); + actions.put("coverageRegionCoords", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionCoords(params, callbackContext); + } + }); + actions.put("coverageRegionCoordsId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionCoordsId(params, callbackContext); + } + }); + actions.put("coverageRegionUriCoord", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionUriCoord(params, callbackContext); + } + }); + actions.put("coverageRegionUriCoordId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionUriCoordId(params, callbackContext); + } + }); + actions.put("coverageRegionUriCoords", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionUriCoords(params, callbackContext); + } + }); + actions.put("coverageRegionUriCoordsId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionUriCoordsId(params, callbackContext); + } + }); actions.put("coverage", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -393,18 +570,36 @@ public void doAction(JSONObject params, CallbackContext callbackContext) { coverageRegionUriDisruptionsId(params, callbackContext); } }); + actions.put("coverageLonLatGeoStatus", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatGeoStatus(params, callbackContext); + } + }); actions.put("coverageRegionGeoStatus", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { coverageRegionGeoStatus(params, callbackContext); } }); + actions.put("coverageLonLatIsochrones", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatIsochrones(params, callbackContext); + } + }); actions.put("coverageRegionIsochrones", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { coverageRegionIsochrones(params, callbackContext); } }); + actions.put("coverageLonLatHeatMaps", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatHeatMaps(params, callbackContext); + } + }); actions.put("coverageRegionHeatMaps", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -579,6 +774,18 @@ public void doAction(JSONObject params, CallbackContext callbackContext) { lineGroups(params, callbackContext); } }); + actions.put("coverageLonLatLineReports", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatLineReports(params, callbackContext); + } + }); + actions.put("coverageLonLatUriLineReports", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriLineReports(params, callbackContext); + } + }); actions.put("coverageRegionLineReports", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -795,6 +1002,24 @@ public void doAction(JSONObject params, CallbackContext callbackContext) { coverageRegionUriPhysicalModesId(params, callbackContext); } }); + actions.put("coverageLonLatPlacesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatPlacesId(params, callbackContext); + } + }); + actions.put("coverageRegionPlacesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageRegionPlacesId(params, callbackContext); + } + }); + actions.put("placesId", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + placesId(params, callbackContext); + } + }); actions.put("coverageLonLatPlaces", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -1029,12 +1254,6 @@ public void doAction(JSONObject params, CallbackContext callbackContext) { routes(params, callbackContext); } }); - actions.put("coverageRegionStatus", new Action() { - @Override - public void doAction(JSONObject params, CallbackContext callbackContext) { - coverageRegionStatus(params, callbackContext); - } - }); actions.put("coverageLonLatStopAreas", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -1161,6 +1380,18 @@ public void doAction(JSONObject params, CallbackContext callbackContext) { stopSchedules(params, callbackContext); } }); + actions.put("coverageLonLatTrafficReports", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatTrafficReports(params, callbackContext); + } + }); + actions.put("coverageLonLatUriTrafficReports", new Action() { + @Override + public void doAction(JSONObject params, CallbackContext callbackContext) { + coverageLonLatUriTrafficReports(params, callbackContext); + } + }); actions.put("coverageRegionTrafficReports", new Action() { @Override public void doAction(JSONObject params, CallbackContext callbackContext) { @@ -1306,55 +1537,27 @@ private void init(String token, CallbackContext callbackContext) { } } - final private void coverageRegionCalendars(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatAddresses(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CalendarsApi.CoverageRegionCalendarsRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageRegionCalendarsRequestBuilder(); + final AddressesApi.CoverageLonLatAddressesRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageLonLatAddressesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - calendarsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { - // Param: startDate, Type: String - calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); - } - if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { - // Param: endDate, Type: String - calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + addressesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + addressesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - calendarsRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -1387,59 +1590,31 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionCalendarsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatAddressesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CalendarsApi.CoverageRegionCalendarsIdRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageRegionCalendarsIdRequestBuilder(); + final AddressesApi.CoverageLonLatAddressesIdRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageLonLatAddressesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - calendarsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + addressesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + addressesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - calendarsRequestBuilder.withId(stringStraightPass(params.getString("id"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { - // Param: startDate, Type: String - calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); - } - if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { - // Param: endDate, Type: String - calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + addressesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - calendarsRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -1472,59 +1647,31 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriCalendars(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriAddresses(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CalendarsApi.CoverageRegionUriCalendarsRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageRegionUriCalendarsRequestBuilder(); + final AddressesApi.CoverageLonLatUriAddressesRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageLonLatUriAddressesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - calendarsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + addressesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + addressesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - calendarsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { - // Param: startDate, Type: String - calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); - } - if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { - // Param: endDate, Type: String - calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + addressesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - calendarsRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -1557,83 +1704,35 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatCommercialModes(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriAddressesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageLonLatCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatCommercialModesRequestBuilder(); + final AddressesApi.CoverageLonLatUriAddressesIdRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageLonLatUriAddressesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + addressesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + addressesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + addressesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + addressesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -1666,83 +1765,23 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionAddresses(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageLonLatCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatCommercialModesIdRequestBuilder(); + final AddressesApi.CoverageRegionAddressesRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageRegionAddressesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); - } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { - // Param: id, Type: String - commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + addressesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -1775,87 +1814,27 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriCommercialModes(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionAddressesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageLonLatUriCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatUriCommercialModesRequestBuilder(); + final AddressesApi.CoverageRegionAddressesIdRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageRegionAddressesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); - } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + addressesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + addressesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -1888,87 +1867,84 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriAddresses(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageLonLatUriCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatUriCommercialModesIdRequestBuilder(); + final AddressesApi.CoverageRegionUriAddressesRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageRegionUriAddressesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); - } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + addressesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); - } - if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { - // Param: id, Type: String - commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + addressesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + + addressesRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriAddressesId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final AddressesApi.CoverageRegionUriAddressesIdRequestBuilder addressesRequestBuilder = this.navitiaSdk.addressesApi.newCoverageRegionUriAddressesIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + addressesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + addressesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + addressesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + addressesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2001,79 +1977,59 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionCommercialModes(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCalendars(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageRegionCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionCommercialModesRequestBuilder(); + final CalendarsApi.CoverageLonLatCalendarsRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageLonLatCalendarsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + calendarsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + calendarsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { + // Param: startDate, Type: String + calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); + } + if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { + // Param: endDate, Type: String + calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + calendarsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2106,79 +2062,63 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCalendarsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageRegionCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionCommercialModesIdRequestBuilder(); + final CalendarsApi.CoverageLonLatCalendarsIdRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageLonLatCalendarsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + calendarsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + calendarsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + calendarsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { + // Param: startDate, Type: String + calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); + } + if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { + // Param: endDate, Type: String + calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + calendarsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2211,83 +2151,63 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriCommercialModes(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriCalendars(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageRegionUriCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionUriCommercialModesRequestBuilder(); + final CalendarsApi.CoverageLonLatUriCalendarsRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageLonLatUriCalendarsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + calendarsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + calendarsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + calendarsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { + // Param: startDate, Type: String + calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); + } + if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { + // Param: endDate, Type: String + calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + calendarsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2320,83 +2240,55 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionCalendars(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CommercialModesApi.CoverageRegionUriCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionUriCommercialModesIdRequestBuilder(); + final CalendarsApi.CoverageRegionCalendarsRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageRegionCalendarsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + calendarsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } - if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { - // Param: id, Type: String - commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { + // Param: startDate, Type: String + calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { + // Param: endDate, Type: String + calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } - commercialModesRequestBuilder.rawGet(new ApiCallback() { + calendarsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2429,83 +2321,59 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatCompanies(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionCalendarsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageLonLatCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatCompaniesRequestBuilder(); + final CalendarsApi.CoverageRegionCalendarsIdRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageRegionCalendarsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + calendarsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + calendarsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { + // Param: startDate, Type: String + calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); + } + if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { + // Param: endDate, Type: String + calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + calendarsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2538,83 +2406,59 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatCompaniesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriCalendars(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageLonLatCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatCompaniesIdRequestBuilder(); + final CalendarsApi.CoverageRegionUriCalendarsRequestBuilder calendarsRequestBuilder = this.navitiaSdk.calendarsApi.newCoverageRegionUriCalendarsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + calendarsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + calendarsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { - // Param: id, Type: String - companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + calendarsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + calendarsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + calendarsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + if (params.has("startDate") && (params.getString("startDate") != null) && (!params.getString("startDate").isEmpty()) ) { + // Param: startDate, Type: String + calendarsRequestBuilder.withStartDate(stringStraightPass(params.getString("startDate"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("endDate") && (params.getString("endDate") != null) && (!params.getString("endDate").isEmpty()) ) { + // Param: endDate, Type: String + calendarsRequestBuilder.withEndDate(stringStraightPass(params.getString("endDate"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + calendarsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + calendarsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + calendarsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + calendarsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2647,87 +2491,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriCompanies(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCommercialModes(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageLonLatUriCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatUriCompaniesRequestBuilder(); + final CommercialModesApi.CoverageLonLatCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatCommercialModesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2760,87 +2600,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriCompaniesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageLonLatUriCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatUriCompaniesIdRequestBuilder(); + final CommercialModesApi.CoverageLonLatCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatCommercialModesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2873,79 +2709,87 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionCompanies(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriCommercialModes(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageRegionCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionCompaniesRequestBuilder(); + final CommercialModesApi.CoverageLonLatUriCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatUriCommercialModesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -2978,79 +2822,87 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionCompaniesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageRegionCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionCompaniesIdRequestBuilder(); + final CommercialModesApi.CoverageLonLatUriCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageLonLatUriCommercialModesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + commercialModesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + commercialModesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3083,83 +2935,79 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriCompanies(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionCommercialModes(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageRegionUriCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionUriCompaniesRequestBuilder(); + final CommercialModesApi.CoverageRegionCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionCommercialModesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3192,83 +3040,79 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriCompaniesId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CompaniesApi.CoverageRegionUriCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionUriCompaniesIdRequestBuilder(); + final CommercialModesApi.CoverageRegionCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionCommercialModesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - companiesRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3301,83 +3145,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatContributors(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriCommercialModes(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageLonLatContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatContributorsRequestBuilder(); + final CommercialModesApi.CoverageRegionUriCommercialModesRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionUriCommercialModesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + commercialModesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3410,83 +3254,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatContributorsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriCommercialModesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageLonLatContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatContributorsIdRequestBuilder(); + final CommercialModesApi.CoverageRegionUriCommercialModesIdRequestBuilder commercialModesRequestBuilder = this.navitiaSdk.commercialModesApi.newCoverageRegionUriCommercialModesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + commercialModesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + commercialModesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + commercialModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + commercialModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + commercialModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + commercialModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + commercialModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + commercialModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + commercialModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + commercialModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + commercialModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + commercialModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + commercialModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + commercialModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + commercialModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + commercialModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + commercialModesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3519,87 +3363,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriContributors(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCompanies(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageLonLatUriContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatUriContributorsRequestBuilder(); + final CompaniesApi.CoverageLonLatCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatCompaniesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3632,87 +3472,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriContributorsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCompaniesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageLonLatUriContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatUriContributorsIdRequestBuilder(); + final CompaniesApi.CoverageLonLatCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatCompaniesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3745,79 +3581,87 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionContributors(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriCompanies(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageRegionContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionContributorsRequestBuilder(); + final CompaniesApi.CoverageLonLatUriCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatUriCompaniesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3850,79 +3694,87 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionContributorsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriCompaniesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageRegionContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionContributorsIdRequestBuilder(); + final CompaniesApi.CoverageLonLatUriCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageLonLatUriCompaniesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + companiesRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + companiesRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -3955,83 +3807,79 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriContributors(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionCompanies(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageRegionUriContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionUriContributorsRequestBuilder(); + final CompaniesApi.CoverageRegionCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionCompaniesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4064,83 +3912,79 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriContributorsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionCompaniesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final ContributorsApi.CoverageRegionUriContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionUriContributorsIdRequestBuilder(); + final CompaniesApi.CoverageRegionCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionCompaniesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - contributorsRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4173,80 +4017,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverage(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriCompanies(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CoverageApi.CoverageRequestBuilder coverageRequestBuilder = this.navitiaSdk.coverageApi.newCoverageRequestBuilder(); + final CompaniesApi.CoverageRegionUriCompaniesRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionUriCompaniesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - coverageRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - - coverageRequestBuilder.rawGet(new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - callbackContext.error("Problem during request call | " + e.getMessage()); - } - - @Override - public void onSuccess(String result, int statusCode, Map> responseHeaders) { - JSONObject jsonObject = null; - try { - jsonObject = new JSONObject(result); - callbackContext.success(jsonObject); - } catch (Exception e) { - String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); - callbackContext.error(errorMessage); - } - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - } - }); - } catch (Exception e) { - String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); - callbackContext.error(errorMessage); - } - } - }); - } - final private void coverageLonLat(final JSONObject params, final CallbackContext callbackContext) { - if (this.navitiaSdk == null) { - callbackContext.error("NavitiaSDK is not instanciated"); - return; - } - - final CoverageApi.CoverageLonLatRequestBuilder coverageRequestBuilder = this.navitiaSdk.coverageApi.newCoverageLonLatRequestBuilder(); - cordova.getThreadPool().execute(new Runnable() { - @Override - public void run() { - try { - if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { - // Param: lat, Type: BigDecimal - coverageRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } - if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { - // Param: lon, Type: BigDecimal - coverageRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - coverageRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + companiesRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - coverageRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4279,27 +4126,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegion(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriCompaniesId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final CoverageApi.CoverageRegionRequestBuilder coverageRequestBuilder = this.navitiaSdk.coverageApi.newCoverageRegionRequestBuilder(); + final CompaniesApi.CoverageRegionUriCompaniesIdRequestBuilder companiesRequestBuilder = this.navitiaSdk.companiesApi.newCoverageRegionUriCompaniesIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - coverageRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + companiesRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - coverageRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + companiesRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + companiesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + companiesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + companiesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + companiesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + companiesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + companiesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + companiesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + companiesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + companiesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + companiesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + companiesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + companiesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + companiesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + companiesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - coverageRequestBuilder.rawGet(new ApiCallback() { + companiesRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4332,83 +4235,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatDatasets(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatContributors(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageLonLatDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatDatasetsRequestBuilder(); + final ContributorsApi.CoverageLonLatContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatContributorsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4441,83 +4344,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatContributorsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageLonLatDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatDatasetsIdRequestBuilder(); + final ContributorsApi.CoverageLonLatContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatContributorsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4550,87 +4453,87 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriDatasets(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriContributors(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageLonLatUriDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatUriDatasetsRequestBuilder(); + final ContributorsApi.CoverageLonLatUriContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatUriContributorsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4663,87 +4566,87 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriContributorsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageLonLatUriDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatUriDatasetsIdRequestBuilder(); + final ContributorsApi.CoverageLonLatUriContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageLonLatUriContributorsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + contributorsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + contributorsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4776,79 +4679,79 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionDatasets(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionContributors(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageRegionDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionDatasetsRequestBuilder(); + final ContributorsApi.CoverageRegionContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionContributorsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4881,79 +4784,79 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionContributorsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageRegionDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionDatasetsIdRequestBuilder(); + final ContributorsApi.CoverageRegionContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionContributorsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -4986,83 +4889,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriDatasets(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriContributors(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageRegionUriDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionUriDatasetsRequestBuilder(); + final ContributorsApi.CoverageRegionUriContributorsRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionUriContributorsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { // Param: filter, Type: String - datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + contributorsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5095,83 +4998,83 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionUriContributorsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DatasetsApi.CoverageRegionUriDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionUriDatasetsIdRequestBuilder(); + final ContributorsApi.CoverageRegionUriContributorsIdRequestBuilder contributorsRequestBuilder = this.navitiaSdk.contributorsApi.newCoverageRegionUriContributorsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + contributorsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { // Param: uri, Type: String - datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + contributorsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + contributorsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { // Param: startPage, Type: Integer - datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + contributorsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); } if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { // Param: count, Type: Integer - datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + contributorsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); } if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { // Param: depth, Type: Integer - datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + contributorsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); } if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { // Param: forbiddenId, Type: List - datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + contributorsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + contributorsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { // Param: externalCode, Type: String - datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + contributorsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); } if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { // Param: headsign, Type: String - datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + contributorsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); } if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { // Param: showCodes, Type: Boolean - datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + contributorsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { // Param: odtLevel, Type: String - datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + contributorsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); } if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { // Param: distance, Type: Integer - datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + contributorsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + contributorsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + contributorsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + contributorsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - datasetsRequestBuilder.rawGet(new ApiCallback() { + contributorsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5204,87 +5107,27 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatDisruptions(final JSONObject params, final CallbackContext callbackContext) { + final private void coordLonLat(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageLonLatDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatDisruptionsRequestBuilder(); + final CoordApi.CoordLonLatRequestBuilder coordRequestBuilder = this.navitiaSdk.coordApi.newCoordLonLatRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + coordRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - disruptionsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); - } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + coordRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + coordRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5317,87 +5160,27 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coordsLonLat(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageLonLatDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatDisruptionsIdRequestBuilder(); + final CoordApi.CoordsLonLatRequestBuilder coordRequestBuilder = this.navitiaSdk.coordApi.newCoordsLonLatRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + coordRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { - // Param: id, Type: String - disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + coordRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + coordRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5430,91 +5213,27 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriDisruptions(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCoord(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageLonLatUriDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatUriDisruptionsRequestBuilder(); + final CoordsApi.CoverageLonLatCoordRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatCoordRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - disruptionsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - disruptionsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); - } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + coordsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5547,91 +5266,31 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageLonLatUriDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCoordId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageLonLatUriDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatUriDisruptionsIdRequestBuilder(); + final CoordsApi.CoverageLonLatCoordIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatCoordIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { // Param: lat, Type: BigDecimal - disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { // Param: lon, Type: BigDecimal - disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); - } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - disruptionsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + coordsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5664,83 +5323,27 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionDisruptions(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCoords(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageRegionDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionDisruptionsRequestBuilder(); + final CoordsApi.CoverageLonLatCoordsRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatCoordsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - disruptionsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + coordsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5773,83 +5376,31 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatCoordsId(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageRegionDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionDisruptionsIdRequestBuilder(); + final CoordsApi.CoverageLonLatCoordsIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatCoordsIdRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); - } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); - } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + coordsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5882,19 +5433,2388 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriDisruptions(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatUriCoord(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageRegionUriDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionUriDisruptionsRequestBuilder(); + final CoordsApi.CoverageLonLatUriCoordRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatUriCoordRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriCoordId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageLonLatUriCoordIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatUriCoordIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriCoords(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageLonLatUriCoordsRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatUriCoordsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriCoordsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageLonLatUriCoordsIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageLonLatUriCoordsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coordsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coordsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionCoord(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionCoordRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionCoordRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionCoordId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionCoordIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionCoordIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionCoords(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionCoordsRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionCoordsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionCoordsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionCoordsIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionCoordsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriCoord(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionUriCoordRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionUriCoordRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriCoordId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionUriCoordIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionUriCoordIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriCoords(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionUriCoordsRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionUriCoordsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriCoordsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoordsApi.CoverageRegionUriCoordsIdRequestBuilder coordsRequestBuilder = this.navitiaSdk.coordsApi.newCoverageRegionUriCoordsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coordsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + coordsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + coordsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + + coordsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverage(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoverageApi.CoverageRequestBuilder coverageRequestBuilder = this.navitiaSdk.coverageApi.newCoverageRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + coverageRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + coverageRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLat(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoverageApi.CoverageLonLatRequestBuilder coverageRequestBuilder = this.navitiaSdk.coverageApi.newCoverageLonLatRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + coverageRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + coverageRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + coverageRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + coverageRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegion(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final CoverageApi.CoverageRegionRequestBuilder coverageRequestBuilder = this.navitiaSdk.coverageApi.newCoverageRegionRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + coverageRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + coverageRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + coverageRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatDatasets(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageLonLatDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatDatasetsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageLonLatDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatDatasetsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriDatasets(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageLonLatUriDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatUriDatasetsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageLonLatUriDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageLonLatUriDatasetsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + datasetsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + datasetsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionDatasets(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageRegionDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionDatasetsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageRegionDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionDatasetsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriDatasets(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageRegionUriDatasetsRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionUriDatasetsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + datasetsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriDatasetsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DatasetsApi.CoverageRegionUriDatasetsIdRequestBuilder datasetsRequestBuilder = this.navitiaSdk.datasetsApi.newCoverageRegionUriDatasetsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + datasetsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + datasetsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + datasetsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + datasetsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + datasetsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + datasetsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + datasetsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + datasetsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + datasetsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + datasetsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + datasetsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + datasetsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + datasetsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + datasetsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + datasetsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + datasetsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + datasetsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatDisruptions(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageLonLatDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatDisruptionsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + disruptionsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageLonLatDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatDisruptionsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriDisruptions(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageLonLatUriDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatUriDisruptionsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + disruptionsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + disruptionsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageLonLatUriDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageLonLatUriDisruptionsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + disruptionsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + disruptionsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + disruptionsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionDisruptions(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageRegionDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionDisruptionsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + disruptionsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageRegionDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionDisruptionsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriDisruptions(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageRegionUriDisruptionsRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionUriDisruptionsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); } if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { @@ -5962,7 +7882,222 @@ public void run() { disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionUriDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final DisruptionsApi.CoverageRegionUriDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionUriDisruptionsIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + disruptionsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + disruptionsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatGeoStatus(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final GeoStatusApi.CoverageLonLatGeoStatusRequestBuilder geoStatusRequestBuilder = this.navitiaSdk.geoStatusApi.newCoverageLonLatGeoStatusRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + geoStatusRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + geoStatusRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + + geoStatusRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionGeoStatus(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final GeoStatusApi.CoverageRegionGeoStatusRequestBuilder geoStatusRequestBuilder = this.navitiaSdk.geoStatusApi.newCoverageRegionGeoStatusRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + geoStatusRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + + geoStatusRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -5995,87 +8130,135 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionUriDisruptionsId(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatIsochrones(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final DisruptionsApi.CoverageRegionUriDisruptionsIdRequestBuilder disruptionsRequestBuilder = this.navitiaSdk.disruptionsApi.newCoverageRegionUriDisruptionsIdRequestBuilder(); + final GraphicalIsochroneApi.CoverageLonLatIsochronesRequestBuilder graphicalIsochroneRequestBuilder = this.navitiaSdk.graphicalIsochroneApi.newCoverageLonLatIsochronesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - disruptionsRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + graphicalIsochroneRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); } - if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { - // Param: uri, Type: String - disruptionsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + graphicalIsochroneRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } - if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { - // Param: id, Type: String - disruptionsRequestBuilder.withId(stringStraightPass(params.getString("id"))); + if (params.has("from") && (params.getString("from") != null) && (!params.getString("from").isEmpty()) ) { + // Param: from, Type: String + graphicalIsochroneRequestBuilder.withFrom(stringStraightPass(params.getString("from"))); } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - disruptionsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + if (params.has("to") && (params.getString("to") != null) && (!params.getString("to").isEmpty()) ) { + // Param: to, Type: String + graphicalIsochroneRequestBuilder.withTo(stringStraightPass(params.getString("to"))); } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - disruptionsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + if (params.has("datetime") && (params.getString("datetime") != null) && (!params.getString("datetime").isEmpty()) ) { + // Param: datetime, Type: Date + graphicalIsochroneRequestBuilder.withDatetime(stringToDateTime(params.getString("datetime"))); } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - disruptionsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + if (params.has("datetimeRepresents") && (params.getString("datetimeRepresents") != null) && (!params.getString("datetimeRepresents").isEmpty()) ) { + // Param: datetimeRepresents, Type: String + graphicalIsochroneRequestBuilder.withDatetimeRepresents(stringStraightPass(params.getString("datetimeRepresents"))); } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - disruptionsRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + if (params.has("maxNbTransfers") && (params.getString("maxNbTransfers") != null) && (!params.getString("maxNbTransfers").isEmpty()) ) { + // Param: maxNbTransfers, Type: Integer + graphicalIsochroneRequestBuilder.withMaxNbTransfers(integerStraightPass(params.getInt("maxNbTransfers"))); + } + if (params.has("minNbTransfers") && (params.getString("minNbTransfers") != null) && (!params.getString("minNbTransfers").isEmpty()) ) { + // Param: minNbTransfers, Type: Integer + graphicalIsochroneRequestBuilder.withMinNbTransfers(integerStraightPass(params.getInt("minNbTransfers"))); + } + if (params.has("firstSectionMode") && (params.getString("firstSectionMode") != null) && (!params.getString("firstSectionMode").isEmpty()) ) { + // Param: firstSectionMode, Type: List + graphicalIsochroneRequestBuilder.withFirstSectionMode(jsonArrayToStringList(params.getJSONArray("firstSectionMode"))); + } + if (params.has("lastSectionMode") && (params.getString("lastSectionMode") != null) && (!params.getString("lastSectionMode").isEmpty()) ) { + // Param: lastSectionMode, Type: List + graphicalIsochroneRequestBuilder.withLastSectionMode(jsonArrayToStringList(params.getJSONArray("lastSectionMode"))); + } + if (params.has("maxDurationToPt") && (params.getString("maxDurationToPt") != null) && (!params.getString("maxDurationToPt").isEmpty()) ) { + // Param: maxDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxDurationToPt(integerStraightPass(params.getInt("maxDurationToPt"))); + } + if (params.has("maxWalkingDurationToPt") && (params.getString("maxWalkingDurationToPt") != null) && (!params.getString("maxWalkingDurationToPt").isEmpty()) ) { + // Param: maxWalkingDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxWalkingDurationToPt(integerStraightPass(params.getInt("maxWalkingDurationToPt"))); + } + if (params.has("maxBikeDurationToPt") && (params.getString("maxBikeDurationToPt") != null) && (!params.getString("maxBikeDurationToPt").isEmpty()) ) { + // Param: maxBikeDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxBikeDurationToPt(integerStraightPass(params.getInt("maxBikeDurationToPt"))); + } + if (params.has("maxBssDurationToPt") && (params.getString("maxBssDurationToPt") != null) && (!params.getString("maxBssDurationToPt").isEmpty()) ) { + // Param: maxBssDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxBssDurationToPt(integerStraightPass(params.getInt("maxBssDurationToPt"))); + } + if (params.has("maxCarDurationToPt") && (params.getString("maxCarDurationToPt") != null) && (!params.getString("maxCarDurationToPt").isEmpty()) ) { + // Param: maxCarDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxCarDurationToPt(integerStraightPass(params.getInt("maxCarDurationToPt"))); + } + if (params.has("walkingSpeed") && (params.getString("walkingSpeed") != null) && (!params.getString("walkingSpeed").isEmpty()) ) { + // Param: walkingSpeed, Type: Float + graphicalIsochroneRequestBuilder.withWalkingSpeed(longToFloat(params.getLong("walkingSpeed"))); + } + if (params.has("bikeSpeed") && (params.getString("bikeSpeed") != null) && (!params.getString("bikeSpeed").isEmpty()) ) { + // Param: bikeSpeed, Type: Float + graphicalIsochroneRequestBuilder.withBikeSpeed(longToFloat(params.getLong("bikeSpeed"))); + } + if (params.has("bssSpeed") && (params.getString("bssSpeed") != null) && (!params.getString("bssSpeed").isEmpty()) ) { + // Param: bssSpeed, Type: Float + graphicalIsochroneRequestBuilder.withBssSpeed(longToFloat(params.getLong("bssSpeed"))); + } + if (params.has("carSpeed") && (params.getString("carSpeed") != null) && (!params.getString("carSpeed").isEmpty()) ) { + // Param: carSpeed, Type: Float + graphicalIsochroneRequestBuilder.withCarSpeed(longToFloat(params.getLong("carSpeed"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - disruptionsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + graphicalIsochroneRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - disruptionsRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + if (params.has("allowedId") && (params.getString("allowedId") != null) && (!params.getString("allowedId").isEmpty()) ) { + // Param: allowedId, Type: List + graphicalIsochroneRequestBuilder.withAllowedId(jsonArrayToStringList(params.getJSONArray("allowedId"))); } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - disruptionsRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + if (params.has("disruptionActive") && (params.getString("disruptionActive") != null) && (!params.getString("disruptionActive").isEmpty()) ) { + // Param: disruptionActive, Type: Boolean + graphicalIsochroneRequestBuilder.withDisruptionActive(booleanStraightPass(params.getBoolean("disruptionActive"))); } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - disruptionsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + if (params.has("dataFreshness") && (params.getString("dataFreshness") != null) && (!params.getString("dataFreshness").isEmpty()) ) { + // Param: dataFreshness, Type: String + graphicalIsochroneRequestBuilder.withDataFreshness(stringStraightPass(params.getString("dataFreshness"))); } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - disruptionsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + if (params.has("maxDuration") && (params.getString("maxDuration") != null) && (!params.getString("maxDuration").isEmpty()) ) { + // Param: maxDuration, Type: Integer + graphicalIsochroneRequestBuilder.withMaxDuration(integerStraightPass(params.getInt("maxDuration"))); } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - disruptionsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + if (params.has("wheelchair") && (params.getString("wheelchair") != null) && (!params.getString("wheelchair").isEmpty()) ) { + // Param: wheelchair, Type: Boolean + graphicalIsochroneRequestBuilder.withWheelchair(booleanStraightPass(params.getBoolean("wheelchair"))); } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - disruptionsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + if (params.has("travelerType") && (params.getString("travelerType") != null) && (!params.getString("travelerType").isEmpty()) ) { + // Param: travelerType, Type: String + graphicalIsochroneRequestBuilder.withTravelerType(stringStraightPass(params.getString("travelerType"))); } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - disruptionsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + if (params.has("directPath") && (params.getString("directPath") != null) && (!params.getString("directPath").isEmpty()) ) { + // Param: directPath, Type: String + graphicalIsochroneRequestBuilder.withDirectPath(stringStraightPass(params.getString("directPath"))); } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - disruptionsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + if (params.has("minDuration") && (params.getString("minDuration") != null) && (!params.getString("minDuration").isEmpty()) ) { + // Param: minDuration, Type: Integer + graphicalIsochroneRequestBuilder.withMinDuration(integerStraightPass(params.getInt("minDuration"))); } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - disruptionsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + if (params.has("boundaryDuration") && (params.getString("boundaryDuration") != null) && (!params.getString("boundaryDuration").isEmpty()) ) { + // Param: boundaryDuration, Type: List + graphicalIsochroneRequestBuilder.withBoundaryDuration(jsonArrayToIntegerList(params.getJSONArray("boundaryDuration"))); } - disruptionsRequestBuilder.rawGet(new ApiCallback() { + graphicalIsochroneRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -6108,23 +8291,131 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionGeoStatus(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageRegionIsochrones(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final GeoStatusApi.CoverageRegionGeoStatusRequestBuilder geoStatusRequestBuilder = this.navitiaSdk.geoStatusApi.newCoverageRegionGeoStatusRequestBuilder(); + final GraphicalIsochroneApi.CoverageRegionIsochronesRequestBuilder graphicalIsochroneRequestBuilder = this.navitiaSdk.graphicalIsochroneApi.newCoverageRegionIsochronesRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { // Param: region, Type: String - geoStatusRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + graphicalIsochroneRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("from") && (params.getString("from") != null) && (!params.getString("from").isEmpty()) ) { + // Param: from, Type: String + graphicalIsochroneRequestBuilder.withFrom(stringStraightPass(params.getString("from"))); + } + if (params.has("to") && (params.getString("to") != null) && (!params.getString("to").isEmpty()) ) { + // Param: to, Type: String + graphicalIsochroneRequestBuilder.withTo(stringStraightPass(params.getString("to"))); + } + if (params.has("datetime") && (params.getString("datetime") != null) && (!params.getString("datetime").isEmpty()) ) { + // Param: datetime, Type: Date + graphicalIsochroneRequestBuilder.withDatetime(stringToDateTime(params.getString("datetime"))); + } + if (params.has("datetimeRepresents") && (params.getString("datetimeRepresents") != null) && (!params.getString("datetimeRepresents").isEmpty()) ) { + // Param: datetimeRepresents, Type: String + graphicalIsochroneRequestBuilder.withDatetimeRepresents(stringStraightPass(params.getString("datetimeRepresents"))); + } + if (params.has("maxNbTransfers") && (params.getString("maxNbTransfers") != null) && (!params.getString("maxNbTransfers").isEmpty()) ) { + // Param: maxNbTransfers, Type: Integer + graphicalIsochroneRequestBuilder.withMaxNbTransfers(integerStraightPass(params.getInt("maxNbTransfers"))); + } + if (params.has("minNbTransfers") && (params.getString("minNbTransfers") != null) && (!params.getString("minNbTransfers").isEmpty()) ) { + // Param: minNbTransfers, Type: Integer + graphicalIsochroneRequestBuilder.withMinNbTransfers(integerStraightPass(params.getInt("minNbTransfers"))); + } + if (params.has("firstSectionMode") && (params.getString("firstSectionMode") != null) && (!params.getString("firstSectionMode").isEmpty()) ) { + // Param: firstSectionMode, Type: List + graphicalIsochroneRequestBuilder.withFirstSectionMode(jsonArrayToStringList(params.getJSONArray("firstSectionMode"))); + } + if (params.has("lastSectionMode") && (params.getString("lastSectionMode") != null) && (!params.getString("lastSectionMode").isEmpty()) ) { + // Param: lastSectionMode, Type: List + graphicalIsochroneRequestBuilder.withLastSectionMode(jsonArrayToStringList(params.getJSONArray("lastSectionMode"))); + } + if (params.has("maxDurationToPt") && (params.getString("maxDurationToPt") != null) && (!params.getString("maxDurationToPt").isEmpty()) ) { + // Param: maxDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxDurationToPt(integerStraightPass(params.getInt("maxDurationToPt"))); + } + if (params.has("maxWalkingDurationToPt") && (params.getString("maxWalkingDurationToPt") != null) && (!params.getString("maxWalkingDurationToPt").isEmpty()) ) { + // Param: maxWalkingDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxWalkingDurationToPt(integerStraightPass(params.getInt("maxWalkingDurationToPt"))); + } + if (params.has("maxBikeDurationToPt") && (params.getString("maxBikeDurationToPt") != null) && (!params.getString("maxBikeDurationToPt").isEmpty()) ) { + // Param: maxBikeDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxBikeDurationToPt(integerStraightPass(params.getInt("maxBikeDurationToPt"))); + } + if (params.has("maxBssDurationToPt") && (params.getString("maxBssDurationToPt") != null) && (!params.getString("maxBssDurationToPt").isEmpty()) ) { + // Param: maxBssDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxBssDurationToPt(integerStraightPass(params.getInt("maxBssDurationToPt"))); + } + if (params.has("maxCarDurationToPt") && (params.getString("maxCarDurationToPt") != null) && (!params.getString("maxCarDurationToPt").isEmpty()) ) { + // Param: maxCarDurationToPt, Type: Integer + graphicalIsochroneRequestBuilder.withMaxCarDurationToPt(integerStraightPass(params.getInt("maxCarDurationToPt"))); + } + if (params.has("walkingSpeed") && (params.getString("walkingSpeed") != null) && (!params.getString("walkingSpeed").isEmpty()) ) { + // Param: walkingSpeed, Type: Float + graphicalIsochroneRequestBuilder.withWalkingSpeed(longToFloat(params.getLong("walkingSpeed"))); + } + if (params.has("bikeSpeed") && (params.getString("bikeSpeed") != null) && (!params.getString("bikeSpeed").isEmpty()) ) { + // Param: bikeSpeed, Type: Float + graphicalIsochroneRequestBuilder.withBikeSpeed(longToFloat(params.getLong("bikeSpeed"))); + } + if (params.has("bssSpeed") && (params.getString("bssSpeed") != null) && (!params.getString("bssSpeed").isEmpty()) ) { + // Param: bssSpeed, Type: Float + graphicalIsochroneRequestBuilder.withBssSpeed(longToFloat(params.getLong("bssSpeed"))); + } + if (params.has("carSpeed") && (params.getString("carSpeed") != null) && (!params.getString("carSpeed").isEmpty()) ) { + // Param: carSpeed, Type: Float + graphicalIsochroneRequestBuilder.withCarSpeed(longToFloat(params.getLong("carSpeed"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + graphicalIsochroneRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("allowedId") && (params.getString("allowedId") != null) && (!params.getString("allowedId").isEmpty()) ) { + // Param: allowedId, Type: List + graphicalIsochroneRequestBuilder.withAllowedId(jsonArrayToStringList(params.getJSONArray("allowedId"))); + } + if (params.has("disruptionActive") && (params.getString("disruptionActive") != null) && (!params.getString("disruptionActive").isEmpty()) ) { + // Param: disruptionActive, Type: Boolean + graphicalIsochroneRequestBuilder.withDisruptionActive(booleanStraightPass(params.getBoolean("disruptionActive"))); + } + if (params.has("dataFreshness") && (params.getString("dataFreshness") != null) && (!params.getString("dataFreshness").isEmpty()) ) { + // Param: dataFreshness, Type: String + graphicalIsochroneRequestBuilder.withDataFreshness(stringStraightPass(params.getString("dataFreshness"))); + } + if (params.has("maxDuration") && (params.getString("maxDuration") != null) && (!params.getString("maxDuration").isEmpty()) ) { + // Param: maxDuration, Type: Integer + graphicalIsochroneRequestBuilder.withMaxDuration(integerStraightPass(params.getInt("maxDuration"))); + } + if (params.has("wheelchair") && (params.getString("wheelchair") != null) && (!params.getString("wheelchair").isEmpty()) ) { + // Param: wheelchair, Type: Boolean + graphicalIsochroneRequestBuilder.withWheelchair(booleanStraightPass(params.getBoolean("wheelchair"))); + } + if (params.has("travelerType") && (params.getString("travelerType") != null) && (!params.getString("travelerType").isEmpty()) ) { + // Param: travelerType, Type: String + graphicalIsochroneRequestBuilder.withTravelerType(stringStraightPass(params.getString("travelerType"))); + } + if (params.has("directPath") && (params.getString("directPath") != null) && (!params.getString("directPath").isEmpty()) ) { + // Param: directPath, Type: String + graphicalIsochroneRequestBuilder.withDirectPath(stringStraightPass(params.getString("directPath"))); + } + if (params.has("minDuration") && (params.getString("minDuration") != null) && (!params.getString("minDuration").isEmpty()) ) { + // Param: minDuration, Type: Integer + graphicalIsochroneRequestBuilder.withMinDuration(integerStraightPass(params.getInt("minDuration"))); + } + if (params.has("boundaryDuration") && (params.getString("boundaryDuration") != null) && (!params.getString("boundaryDuration").isEmpty()) ) { + // Param: boundaryDuration, Type: List + graphicalIsochroneRequestBuilder.withBoundaryDuration(jsonArrayToIntegerList(params.getJSONArray("boundaryDuration"))); } - geoStatusRequestBuilder.rawGet(new ApiCallback() { + graphicalIsochroneRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -6157,131 +8448,131 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionIsochrones(final JSONObject params, final CallbackContext callbackContext) { + final private void coverageLonLatHeatMaps(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); return; } - final GraphicalIsochroneApi.CoverageRegionIsochronesRequestBuilder graphicalIsochroneRequestBuilder = this.navitiaSdk.graphicalIsochroneApi.newCoverageRegionIsochronesRequestBuilder(); + final HeatMapApi.CoverageLonLatHeatMapsRequestBuilder heatMapRequestBuilder = this.navitiaSdk.heatMapApi.newCoverageLonLatHeatMapsRequestBuilder(); cordova.getThreadPool().execute(new Runnable() { @Override public void run() { try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - graphicalIsochroneRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + heatMapRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + heatMapRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); } if (params.has("from") && (params.getString("from") != null) && (!params.getString("from").isEmpty()) ) { // Param: from, Type: String - graphicalIsochroneRequestBuilder.withFrom(stringStraightPass(params.getString("from"))); + heatMapRequestBuilder.withFrom(stringStraightPass(params.getString("from"))); } if (params.has("to") && (params.getString("to") != null) && (!params.getString("to").isEmpty()) ) { // Param: to, Type: String - graphicalIsochroneRequestBuilder.withTo(stringStraightPass(params.getString("to"))); + heatMapRequestBuilder.withTo(stringStraightPass(params.getString("to"))); } if (params.has("datetime") && (params.getString("datetime") != null) && (!params.getString("datetime").isEmpty()) ) { // Param: datetime, Type: Date - graphicalIsochroneRequestBuilder.withDatetime(stringToDateTime(params.getString("datetime"))); + heatMapRequestBuilder.withDatetime(stringToDateTime(params.getString("datetime"))); } if (params.has("datetimeRepresents") && (params.getString("datetimeRepresents") != null) && (!params.getString("datetimeRepresents").isEmpty()) ) { // Param: datetimeRepresents, Type: String - graphicalIsochroneRequestBuilder.withDatetimeRepresents(stringStraightPass(params.getString("datetimeRepresents"))); + heatMapRequestBuilder.withDatetimeRepresents(stringStraightPass(params.getString("datetimeRepresents"))); } if (params.has("maxNbTransfers") && (params.getString("maxNbTransfers") != null) && (!params.getString("maxNbTransfers").isEmpty()) ) { // Param: maxNbTransfers, Type: Integer - graphicalIsochroneRequestBuilder.withMaxNbTransfers(integerStraightPass(params.getInt("maxNbTransfers"))); + heatMapRequestBuilder.withMaxNbTransfers(integerStraightPass(params.getInt("maxNbTransfers"))); } if (params.has("minNbTransfers") && (params.getString("minNbTransfers") != null) && (!params.getString("minNbTransfers").isEmpty()) ) { // Param: minNbTransfers, Type: Integer - graphicalIsochroneRequestBuilder.withMinNbTransfers(integerStraightPass(params.getInt("minNbTransfers"))); + heatMapRequestBuilder.withMinNbTransfers(integerStraightPass(params.getInt("minNbTransfers"))); } if (params.has("firstSectionMode") && (params.getString("firstSectionMode") != null) && (!params.getString("firstSectionMode").isEmpty()) ) { // Param: firstSectionMode, Type: List - graphicalIsochroneRequestBuilder.withFirstSectionMode(jsonArrayToStringList(params.getJSONArray("firstSectionMode"))); + heatMapRequestBuilder.withFirstSectionMode(jsonArrayToStringList(params.getJSONArray("firstSectionMode"))); } if (params.has("lastSectionMode") && (params.getString("lastSectionMode") != null) && (!params.getString("lastSectionMode").isEmpty()) ) { // Param: lastSectionMode, Type: List - graphicalIsochroneRequestBuilder.withLastSectionMode(jsonArrayToStringList(params.getJSONArray("lastSectionMode"))); + heatMapRequestBuilder.withLastSectionMode(jsonArrayToStringList(params.getJSONArray("lastSectionMode"))); } if (params.has("maxDurationToPt") && (params.getString("maxDurationToPt") != null) && (!params.getString("maxDurationToPt").isEmpty()) ) { // Param: maxDurationToPt, Type: Integer - graphicalIsochroneRequestBuilder.withMaxDurationToPt(integerStraightPass(params.getInt("maxDurationToPt"))); + heatMapRequestBuilder.withMaxDurationToPt(integerStraightPass(params.getInt("maxDurationToPt"))); } if (params.has("maxWalkingDurationToPt") && (params.getString("maxWalkingDurationToPt") != null) && (!params.getString("maxWalkingDurationToPt").isEmpty()) ) { // Param: maxWalkingDurationToPt, Type: Integer - graphicalIsochroneRequestBuilder.withMaxWalkingDurationToPt(integerStraightPass(params.getInt("maxWalkingDurationToPt"))); + heatMapRequestBuilder.withMaxWalkingDurationToPt(integerStraightPass(params.getInt("maxWalkingDurationToPt"))); } if (params.has("maxBikeDurationToPt") && (params.getString("maxBikeDurationToPt") != null) && (!params.getString("maxBikeDurationToPt").isEmpty()) ) { // Param: maxBikeDurationToPt, Type: Integer - graphicalIsochroneRequestBuilder.withMaxBikeDurationToPt(integerStraightPass(params.getInt("maxBikeDurationToPt"))); + heatMapRequestBuilder.withMaxBikeDurationToPt(integerStraightPass(params.getInt("maxBikeDurationToPt"))); } if (params.has("maxBssDurationToPt") && (params.getString("maxBssDurationToPt") != null) && (!params.getString("maxBssDurationToPt").isEmpty()) ) { // Param: maxBssDurationToPt, Type: Integer - graphicalIsochroneRequestBuilder.withMaxBssDurationToPt(integerStraightPass(params.getInt("maxBssDurationToPt"))); + heatMapRequestBuilder.withMaxBssDurationToPt(integerStraightPass(params.getInt("maxBssDurationToPt"))); } if (params.has("maxCarDurationToPt") && (params.getString("maxCarDurationToPt") != null) && (!params.getString("maxCarDurationToPt").isEmpty()) ) { // Param: maxCarDurationToPt, Type: Integer - graphicalIsochroneRequestBuilder.withMaxCarDurationToPt(integerStraightPass(params.getInt("maxCarDurationToPt"))); + heatMapRequestBuilder.withMaxCarDurationToPt(integerStraightPass(params.getInt("maxCarDurationToPt"))); } if (params.has("walkingSpeed") && (params.getString("walkingSpeed") != null) && (!params.getString("walkingSpeed").isEmpty()) ) { // Param: walkingSpeed, Type: Float - graphicalIsochroneRequestBuilder.withWalkingSpeed(longToFloat(params.getLong("walkingSpeed"))); + heatMapRequestBuilder.withWalkingSpeed(longToFloat(params.getLong("walkingSpeed"))); } if (params.has("bikeSpeed") && (params.getString("bikeSpeed") != null) && (!params.getString("bikeSpeed").isEmpty()) ) { // Param: bikeSpeed, Type: Float - graphicalIsochroneRequestBuilder.withBikeSpeed(longToFloat(params.getLong("bikeSpeed"))); + heatMapRequestBuilder.withBikeSpeed(longToFloat(params.getLong("bikeSpeed"))); } if (params.has("bssSpeed") && (params.getString("bssSpeed") != null) && (!params.getString("bssSpeed").isEmpty()) ) { // Param: bssSpeed, Type: Float - graphicalIsochroneRequestBuilder.withBssSpeed(longToFloat(params.getLong("bssSpeed"))); + heatMapRequestBuilder.withBssSpeed(longToFloat(params.getLong("bssSpeed"))); } if (params.has("carSpeed") && (params.getString("carSpeed") != null) && (!params.getString("carSpeed").isEmpty()) ) { // Param: carSpeed, Type: Float - graphicalIsochroneRequestBuilder.withCarSpeed(longToFloat(params.getLong("carSpeed"))); + heatMapRequestBuilder.withCarSpeed(longToFloat(params.getLong("carSpeed"))); } if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { // Param: forbiddenUris, Type: List - graphicalIsochroneRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + heatMapRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } if (params.has("allowedId") && (params.getString("allowedId") != null) && (!params.getString("allowedId").isEmpty()) ) { // Param: allowedId, Type: List - graphicalIsochroneRequestBuilder.withAllowedId(jsonArrayToStringList(params.getJSONArray("allowedId"))); + heatMapRequestBuilder.withAllowedId(jsonArrayToStringList(params.getJSONArray("allowedId"))); } if (params.has("disruptionActive") && (params.getString("disruptionActive") != null) && (!params.getString("disruptionActive").isEmpty()) ) { // Param: disruptionActive, Type: Boolean - graphicalIsochroneRequestBuilder.withDisruptionActive(booleanStraightPass(params.getBoolean("disruptionActive"))); + heatMapRequestBuilder.withDisruptionActive(booleanStraightPass(params.getBoolean("disruptionActive"))); } if (params.has("dataFreshness") && (params.getString("dataFreshness") != null) && (!params.getString("dataFreshness").isEmpty()) ) { // Param: dataFreshness, Type: String - graphicalIsochroneRequestBuilder.withDataFreshness(stringStraightPass(params.getString("dataFreshness"))); + heatMapRequestBuilder.withDataFreshness(stringStraightPass(params.getString("dataFreshness"))); } if (params.has("maxDuration") && (params.getString("maxDuration") != null) && (!params.getString("maxDuration").isEmpty()) ) { // Param: maxDuration, Type: Integer - graphicalIsochroneRequestBuilder.withMaxDuration(integerStraightPass(params.getInt("maxDuration"))); + heatMapRequestBuilder.withMaxDuration(integerStraightPass(params.getInt("maxDuration"))); } if (params.has("wheelchair") && (params.getString("wheelchair") != null) && (!params.getString("wheelchair").isEmpty()) ) { // Param: wheelchair, Type: Boolean - graphicalIsochroneRequestBuilder.withWheelchair(booleanStraightPass(params.getBoolean("wheelchair"))); + heatMapRequestBuilder.withWheelchair(booleanStraightPass(params.getBoolean("wheelchair"))); } if (params.has("travelerType") && (params.getString("travelerType") != null) && (!params.getString("travelerType").isEmpty()) ) { // Param: travelerType, Type: String - graphicalIsochroneRequestBuilder.withTravelerType(stringStraightPass(params.getString("travelerType"))); + heatMapRequestBuilder.withTravelerType(stringStraightPass(params.getString("travelerType"))); } if (params.has("directPath") && (params.getString("directPath") != null) && (!params.getString("directPath").isEmpty()) ) { // Param: directPath, Type: String - graphicalIsochroneRequestBuilder.withDirectPath(stringStraightPass(params.getString("directPath"))); - } - if (params.has("minDuration") && (params.getString("minDuration") != null) && (!params.getString("minDuration").isEmpty()) ) { - // Param: minDuration, Type: Integer - graphicalIsochroneRequestBuilder.withMinDuration(integerStraightPass(params.getInt("minDuration"))); + heatMapRequestBuilder.withDirectPath(stringStraightPass(params.getString("directPath"))); } - if (params.has("boundaryDuration") && (params.getString("boundaryDuration") != null) && (!params.getString("boundaryDuration").isEmpty()) ) { - // Param: boundaryDuration, Type: List - graphicalIsochroneRequestBuilder.withBoundaryDuration(jsonArrayToIntegerList(params.getJSONArray("boundaryDuration"))); + if (params.has("resolution") && (params.getString("resolution") != null) && (!params.getString("resolution").isEmpty()) ) { + // Param: resolution, Type: Integer + heatMapRequestBuilder.withResolution(integerStraightPass(params.getInt("resolution"))); } - graphicalIsochroneRequestBuilder.rawGet(new ApiCallback() { + heatMapRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -9677,36 +11968,202 @@ public void run() { // Param: showCodes, Type: Boolean lineGroupsRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - lineGroupsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + lineGroupsRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + lineGroupsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + lineGroupsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + lineGroupsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + lineGroupsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { + // Param: filter, Type: String + lineGroupsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); + } + if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { + // Param: originalId, Type: String + lineGroupsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + } + + lineGroupsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatLineReports(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final LineReportsApi.CoverageLonLatLineReportsRequestBuilder lineReportsRequestBuilder = this.navitiaSdk.lineReportsApi.newCoverageLonLatLineReportsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + lineReportsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + lineReportsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + lineReportsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + lineReportsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + lineReportsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + lineReportsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + lineReportsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + lineReportsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + lineReportsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + + lineReportsRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriLineReports(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final LineReportsApi.CoverageLonLatUriLineReportsRequestBuilder lineReportsRequestBuilder = this.navitiaSdk.lineReportsApi.newCoverageLonLatUriLineReportsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + lineReportsRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + lineReportsRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + lineReportsRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + lineReportsRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + lineReportsRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + lineReportsRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + lineReportsRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - lineGroupsRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + lineReportsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { // Param: since, Type: Date - lineGroupsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + lineReportsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); } if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { // Param: until, Type: Date - lineGroupsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); - } - if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { - // Param: disableGeojson, Type: Boolean - lineGroupsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); - } - if (params.has("filter") && (params.getString("filter") != null) && (!params.getString("filter").isEmpty()) ) { - // Param: filter, Type: String - lineGroupsRequestBuilder.withFilter(stringStraightPass(params.getString("filter"))); - } - if (params.has("originalId") && (params.getString("originalId") != null) && (!params.getString("originalId").isEmpty()) ) { - // Param: originalId, Type: String - lineGroupsRequestBuilder.withOriginalId(stringStraightPass(params.getString("originalId"))); + lineReportsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); } - lineGroupsRequestBuilder.rawGet(new ApiCallback() { + lineReportsRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -9774,6 +12231,14 @@ public void run() { // Param: disableGeojson, Type: Boolean lineReportsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + lineReportsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + lineReportsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } lineReportsRequestBuilder.rawGet(new ApiCallback() { @Override @@ -9847,6 +12312,14 @@ public void run() { // Param: disableGeojson, Type: Boolean lineReportsRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + lineReportsRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + lineReportsRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } lineReportsRequestBuilder.rawGet(new ApiCallback() { @Override @@ -13619,62 +16092,257 @@ public void run() { } if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { // Param: id, Type: String - physicalModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); - } - if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { - // Param: startPage, Type: Integer - physicalModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); - } - if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { - // Param: count, Type: Integer - physicalModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); - } - if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { - // Param: depth, Type: Integer - physicalModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); - } - if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { - // Param: forbiddenId, Type: List - physicalModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); - } - if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { - // Param: forbiddenUris, Type: List - physicalModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); - } - if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { - // Param: externalCode, Type: String - physicalModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); - } - if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { - // Param: headsign, Type: String - physicalModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); - } - if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { - // Param: showCodes, Type: Boolean - physicalModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); - } - if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { - // Param: odtLevel, Type: String - physicalModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); - } - if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { - // Param: distance, Type: Integer - physicalModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + physicalModesRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + physicalModesRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + physicalModesRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + physicalModesRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + physicalModesRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + physicalModesRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("externalCode") && (params.getString("externalCode") != null) && (!params.getString("externalCode").isEmpty()) ) { + // Param: externalCode, Type: String + physicalModesRequestBuilder.withExternalCode(stringStraightPass(params.getString("externalCode"))); + } + if (params.has("headsign") && (params.getString("headsign") != null) && (!params.getString("headsign").isEmpty()) ) { + // Param: headsign, Type: String + physicalModesRequestBuilder.withHeadsign(stringStraightPass(params.getString("headsign"))); + } + if (params.has("showCodes") && (params.getString("showCodes") != null) && (!params.getString("showCodes").isEmpty()) ) { + // Param: showCodes, Type: Boolean + physicalModesRequestBuilder.withShowCodes(booleanStraightPass(params.getBoolean("showCodes"))); + } + if (params.has("odtLevel") && (params.getString("odtLevel") != null) && (!params.getString("odtLevel").isEmpty()) ) { + // Param: odtLevel, Type: String + physicalModesRequestBuilder.withOdtLevel(stringStraightPass(params.getString("odtLevel"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + physicalModesRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { + // Param: since, Type: Date + physicalModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + } + if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { + // Param: until, Type: Date + physicalModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + physicalModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + physicalModesRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatPlacesId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final PlaceUriApi.CoverageLonLatPlacesIdRequestBuilder placeUriRequestBuilder = this.navitiaSdk.placeUriApi.newCoverageLonLatPlacesIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + placeUriRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + placeUriRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + placeUriRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("bssStands") && (params.getString("bssStands") != null) && (!params.getString("bssStands").isEmpty()) ) { + // Param: bssStands, Type: Boolean + placeUriRequestBuilder.withBssStands(booleanStraightPass(params.getBoolean("bssStands"))); + } + if (params.has("addPoiInfos") && (params.getString("addPoiInfos") != null) && (!params.getString("addPoiInfos").isEmpty()) ) { + // Param: addPoiInfos, Type: List + placeUriRequestBuilder.withAddPoiInfos(jsonArrayToStringList(params.getJSONArray("addPoiInfos"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + placeUriRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + placeUriRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageRegionPlacesId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final PlaceUriApi.CoverageRegionPlacesIdRequestBuilder placeUriRequestBuilder = this.navitiaSdk.placeUriApi.newCoverageRegionPlacesIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { + // Param: region, Type: String + placeUriRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); + } + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + placeUriRequestBuilder.withId(stringStraightPass(params.getString("id"))); + } + if (params.has("bssStands") && (params.getString("bssStands") != null) && (!params.getString("bssStands").isEmpty()) ) { + // Param: bssStands, Type: Boolean + placeUriRequestBuilder.withBssStands(booleanStraightPass(params.getBoolean("bssStands"))); + } + if (params.has("addPoiInfos") && (params.getString("addPoiInfos") != null) && (!params.getString("addPoiInfos").isEmpty()) ) { + // Param: addPoiInfos, Type: List + placeUriRequestBuilder.withAddPoiInfos(jsonArrayToStringList(params.getJSONArray("addPoiInfos"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + placeUriRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + placeUriRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void placesId(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final PlaceUriApi.PlacesIdRequestBuilder placeUriRequestBuilder = this.navitiaSdk.placeUriApi.newPlacesIdRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("id") && (params.getString("id") != null) && (!params.getString("id").isEmpty()) ) { + // Param: id, Type: String + placeUriRequestBuilder.withId(stringStraightPass(params.getString("id"))); } - if (params.has("since") && (params.getString("since") != null) && (!params.getString("since").isEmpty()) ) { - // Param: since, Type: Date - physicalModesRequestBuilder.withSince(stringToDateTime(params.getString("since"))); + if (params.has("bssStands") && (params.getString("bssStands") != null) && (!params.getString("bssStands").isEmpty()) ) { + // Param: bssStands, Type: Boolean + placeUriRequestBuilder.withBssStands(booleanStraightPass(params.getBoolean("bssStands"))); } - if (params.has("until") && (params.getString("until") != null) && (!params.getString("until").isEmpty()) ) { - // Param: until, Type: Date - physicalModesRequestBuilder.withUntil(stringToDateTime(params.getString("until"))); + if (params.has("addPoiInfos") && (params.getString("addPoiInfos") != null) && (!params.getString("addPoiInfos").isEmpty()) ) { + // Param: addPoiInfos, Type: List + placeUriRequestBuilder.withAddPoiInfos(jsonArrayToStringList(params.getJSONArray("addPoiInfos"))); } if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { // Param: disableGeojson, Type: Boolean - physicalModesRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + placeUriRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); } - physicalModesRequestBuilder.rawGet(new ApiCallback() { + placeUriRequestBuilder.rawGet(new ApiCallback() { @Override public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { callbackContext.error("Problem during request call | " + e.getMessage()); @@ -17830,55 +20498,6 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } - final private void coverageRegionStatus(final JSONObject params, final CallbackContext callbackContext) { - if (this.navitiaSdk == null) { - callbackContext.error("NavitiaSDK is not instanciated"); - return; - } - - final StatusApi.CoverageRegionStatusRequestBuilder statusRequestBuilder = this.navitiaSdk.statusApi.newCoverageRegionStatusRequestBuilder(); - cordova.getThreadPool().execute(new Runnable() { - @Override - public void run() { - try { - if (params.has("region") && (params.getString("region") != null) && (!params.getString("region").isEmpty()) ) { - // Param: region, Type: String - statusRequestBuilder.withRegion(stringStraightPass(params.getString("region"))); - } - - statusRequestBuilder.rawGet(new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - callbackContext.error("Problem during request call | " + e.getMessage()); - } - - @Override - public void onSuccess(String result, int statusCode, Map> responseHeaders) { - JSONObject jsonObject = null; - try { - jsonObject = new JSONObject(result); - callbackContext.success(jsonObject); - } catch (Exception e) { - String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); - callbackContext.error(errorMessage); - } - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - } - }); - } catch (Exception e) { - String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); - callbackContext.error(errorMessage); - } - } - }); - } final private void coverageLonLatStopAreas(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); @@ -20244,6 +22863,172 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) } }); } + final private void coverageLonLatTrafficReports(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final TrafficReportApi.CoverageLonLatTrafficReportsRequestBuilder trafficReportRequestBuilder = this.navitiaSdk.trafficReportApi.newCoverageLonLatTrafficReportsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + trafficReportRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + trafficReportRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + trafficReportRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + trafficReportRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + trafficReportRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + trafficReportRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + trafficReportRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + trafficReportRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + trafficReportRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + trafficReportRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } + final private void coverageLonLatUriTrafficReports(final JSONObject params, final CallbackContext callbackContext) { + if (this.navitiaSdk == null) { + callbackContext.error("NavitiaSDK is not instanciated"); + return; + } + + final TrafficReportApi.CoverageLonLatUriTrafficReportsRequestBuilder trafficReportRequestBuilder = this.navitiaSdk.trafficReportApi.newCoverageLonLatUriTrafficReportsRequestBuilder(); + cordova.getThreadPool().execute(new Runnable() { + @Override + public void run() { + try { + if (params.has("lat") && (params.getString("lat") != null) && (!params.getString("lat").isEmpty()) ) { + // Param: lat, Type: BigDecimal + trafficReportRequestBuilder.withLat(longToBigDecimal(params.getLong("lat"))); + } + if (params.has("lon") && (params.getString("lon") != null) && (!params.getString("lon").isEmpty()) ) { + // Param: lon, Type: BigDecimal + trafficReportRequestBuilder.withLon(longToBigDecimal(params.getLong("lon"))); + } + if (params.has("uri") && (params.getString("uri") != null) && (!params.getString("uri").isEmpty()) ) { + // Param: uri, Type: String + trafficReportRequestBuilder.withUri(stringStraightPass(params.getString("uri"))); + } + if (params.has("depth") && (params.getString("depth") != null) && (!params.getString("depth").isEmpty()) ) { + // Param: depth, Type: Integer + trafficReportRequestBuilder.withDepth(integerStraightPass(params.getInt("depth"))); + } + if (params.has("count") && (params.getString("count") != null) && (!params.getString("count").isEmpty()) ) { + // Param: count, Type: Integer + trafficReportRequestBuilder.withCount(integerStraightPass(params.getInt("count"))); + } + if (params.has("startPage") && (params.getString("startPage") != null) && (!params.getString("startPage").isEmpty()) ) { + // Param: startPage, Type: Integer + trafficReportRequestBuilder.withStartPage(integerStraightPass(params.getInt("startPage"))); + } + if (params.has("forbiddenId") && (params.getString("forbiddenId") != null) && (!params.getString("forbiddenId").isEmpty()) ) { + // Param: forbiddenId, Type: List + trafficReportRequestBuilder.withForbiddenId(jsonArrayToStringList(params.getJSONArray("forbiddenId"))); + } + if (params.has("forbiddenUris") && (params.getString("forbiddenUris") != null) && (!params.getString("forbiddenUris").isEmpty()) ) { + // Param: forbiddenUris, Type: List + trafficReportRequestBuilder.withForbiddenUris(jsonArrayToStringList(params.getJSONArray("forbiddenUris"))); + } + if (params.has("distance") && (params.getString("distance") != null) && (!params.getString("distance").isEmpty()) ) { + // Param: distance, Type: Integer + trafficReportRequestBuilder.withDistance(integerStraightPass(params.getInt("distance"))); + } + if (params.has("disableGeojson") && (params.getString("disableGeojson") != null) && (!params.getString("disableGeojson").isEmpty()) ) { + // Param: disableGeojson, Type: Boolean + trafficReportRequestBuilder.withDisableGeojson(booleanStraightPass(params.getBoolean("disableGeojson"))); + } + + trafficReportRequestBuilder.rawGet(new ApiCallback() { + @Override + public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { + callbackContext.error("Problem during request call | " + e.getMessage()); + } + + @Override + public void onSuccess(String result, int statusCode, Map> responseHeaders) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(result); + callbackContext.success(jsonObject); + } catch (Exception e) { + String errorMessage = "Problem during response parsing | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + } + }); + } catch (Exception e) { + String errorMessage = "Problem during request building | " + String.valueOf(e.hashCode()) + ": " + e.getMessage(); + callbackContext.error(errorMessage); + } + } + }); + } final private void coverageRegionTrafficReports(final JSONObject params, final CallbackContext callbackContext) { if (this.navitiaSdk == null) { callbackContext.error("NavitiaSDK is not instanciated"); diff --git a/src/ios/CDVNavitiaSDK.swift b/src/ios/CDVNavitiaSDK.swift index 7517974..4a92c24 100644 --- a/src/ios/CDVNavitiaSDK.swift +++ b/src/ios/CDVNavitiaSDK.swift @@ -73,8 +73,8 @@ import NavitiaSDK ) } - @objc(coverageRegionCalendars:) - func coverageRegionCalendars(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatAddresses:) + func coverageLonLatAddresses(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -84,35 +84,14 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CalendarsApi? = self.sdk?.calendarsApi { - let queryBuilder: CoverageRegionCalendarsRequestBuilder = api!.newCoverageRegionCalendarsRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageLonLatAddressesRequestBuilder = api!.newCoverageLonLatAddressesRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "startDate") != nil { - queryBuilder.withStartDate(anyToString(params!["startDate"]!)) - } - if params?.index(forKey: "endDate") != nil { - queryBuilder.withEndDate(anyToString(params!["endDate"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -139,8 +118,8 @@ import NavitiaSDK } } } - @objc(coverageRegionCalendarsId:) - func coverageRegionCalendarsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatAddressesId:) + func coverageLonLatAddressesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -150,39 +129,18 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CalendarsApi? = self.sdk?.calendarsApi { - let queryBuilder: CoverageRegionCalendarsIdRequestBuilder = api!.newCoverageRegionCalendarsIdRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageLonLatAddressesIdRequestBuilder = api!.newCoverageLonLatAddressesIdRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "startDate") != nil { - queryBuilder.withStartDate(anyToString(params!["startDate"]!)) - } - if params?.index(forKey: "endDate") != nil { - queryBuilder.withEndDate(anyToString(params!["endDate"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -208,8 +166,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriCalendars:) - func coverageRegionUriCalendars(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriAddresses:) + func coverageLonLatUriAddresses(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -219,39 +177,18 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CalendarsApi? = self.sdk?.calendarsApi { - let queryBuilder: CoverageRegionUriCalendarsRequestBuilder = api!.newCoverageRegionUriCalendarsRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageLonLatUriAddressesRequestBuilder = api!.newCoverageLonLatUriAddressesRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "uri") != nil { queryBuilder.withUri(anyToString(params!["uri"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "startDate") != nil { - queryBuilder.withStartDate(anyToString(params!["startDate"]!)) - } - if params?.index(forKey: "endDate") != nil { - queryBuilder.withEndDate(anyToString(params!["endDate"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -277,8 +214,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatCommercialModes:) - func coverageLonLatCommercialModes(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriAddressesId:) + func coverageLonLatUriAddressesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -288,8 +225,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageLonLatCommercialModesRequestBuilder = api!.newCoverageLonLatCommercialModesRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageLonLatUriAddressesIdRequestBuilder = api!.newCoverageLonLatUriAddressesIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -297,49 +234,53 @@ import NavitiaSDK if params?.index(forKey: "lon") != nil { queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCommercialModesRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionAddresses:) + func coverageRegionAddresses(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageRegionAddressesRequestBuilder = api!.newCoverageRegionAddressesRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -366,8 +307,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatCommercialModesId:) - func coverageLonLatCommercialModesId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionAddressesId:) + func coverageRegionAddressesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -377,59 +318,15 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageLonLatCommercialModesIdRequestBuilder = api!.newCoverageLonLatCommercialModesIdRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageRegionAddressesIdRequestBuilder = api!.newCoverageRegionAddressesIdRequestBuilder(); - if params?.index(forKey: "lat") != nil { - queryBuilder.withLat(anyToDouble(params!["lat"]!)) - } - if params?.index(forKey: "lon") != nil { - queryBuilder.withLon(anyToDouble(params!["lon"]!)) + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCommercialModesIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -455,8 +352,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriCommercialModes:) - func coverageLonLatUriCommercialModes(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriAddresses:) + func coverageRegionUriAddresses(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -466,62 +363,15 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageLonLatUriCommercialModesRequestBuilder = api!.newCoverageLonLatUriCommercialModesRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageRegionUriAddressesRequestBuilder = api!.newCoverageRegionUriAddressesRequestBuilder(); - if params?.index(forKey: "lat") != nil { - queryBuilder.withLat(anyToDouble(params!["lat"]!)) - } - if params?.index(forKey: "lon") != nil { - queryBuilder.withLon(anyToDouble(params!["lon"]!)) + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } if params?.index(forKey: "uri") != nil { queryBuilder.withUri(anyToString(params!["uri"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCommercialModesRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -547,8 +397,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriCommercialModesId:) - func coverageLonLatUriCommercialModesId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriAddressesId:) + func coverageRegionUriAddressesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -558,14 +408,11 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageLonLatUriCommercialModesIdRequestBuilder = api!.newCoverageLonLatUriCommercialModesIdRequestBuilder(); + if let api: AddressesApi? = self.sdk?.addressesApi { + let queryBuilder: CoverageRegionUriAddressesIdRequestBuilder = api!.newCoverageRegionUriAddressesIdRequestBuilder(); - if params?.index(forKey: "lat") != nil { - queryBuilder.withLat(anyToDouble(params!["lat"]!)) - } - if params?.index(forKey: "lon") != nil { - queryBuilder.withLon(anyToDouble(params!["lon"]!)) + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } if params?.index(forKey: "uri") != nil { queryBuilder.withUri(anyToString(params!["uri"]!)) @@ -573,47 +420,6 @@ import NavitiaSDK if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCommercialModesIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -639,8 +445,8 @@ import NavitiaSDK } } } - @objc(coverageRegionCommercialModes:) - func coverageRegionCommercialModes(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCalendars:) + func coverageLonLatCalendars(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -650,20 +456,29 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageRegionCommercialModesRequestBuilder = api!.newCoverageRegionCommercialModesRequestBuilder(); + if let api: CalendarsApi? = self.sdk?.calendarsApi { + let queryBuilder: CoverageLonLatCalendarsRequestBuilder = api!.newCoverageLonLatCalendarsRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) } if params?.index(forKey: "count") != nil { queryBuilder.withCount(anyToInt(params!["count"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "startDate") != nil { + queryBuilder.withStartDate(anyToString(params!["startDate"]!)) + } + if params?.index(forKey: "endDate") != nil { + queryBuilder.withEndDate(anyToString(params!["endDate"]!)) } if params?.index(forKey: "forbiddenId") != nil { queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) @@ -671,35 +486,9 @@ import NavitiaSDK if params?.index(forKey: "forbiddenUris") != nil { queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCommercialModesRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } if params?.index(forKey: "distance") != nil { queryBuilder.withDistance(anyToInt(params!["distance"]!)) } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -725,8 +514,8 @@ import NavitiaSDK } } } - @objc(coverageRegionCommercialModesId:) - func coverageRegionCommercialModesId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCalendarsId:) + func coverageLonLatCalendarsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -736,23 +525,32 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageRegionCommercialModesIdRequestBuilder = api!.newCoverageRegionCommercialModesIdRequestBuilder(); + if let api: CalendarsApi? = self.sdk?.calendarsApi { + let queryBuilder: CoverageLonLatCalendarsIdRequestBuilder = api!.newCoverageLonLatCalendarsIdRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) } if params?.index(forKey: "count") != nil { queryBuilder.withCount(anyToInt(params!["count"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "startDate") != nil { + queryBuilder.withStartDate(anyToString(params!["startDate"]!)) + } + if params?.index(forKey: "endDate") != nil { + queryBuilder.withEndDate(anyToString(params!["endDate"]!)) } if params?.index(forKey: "forbiddenId") != nil { queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) @@ -760,32 +558,9 @@ import NavitiaSDK if params?.index(forKey: "forbiddenUris") != nil { queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCommercialModesIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } if params?.index(forKey: "distance") != nil { queryBuilder.withDistance(anyToInt(params!["distance"]!)) } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -811,8 +586,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriCommercialModes:) - func coverageRegionUriCommercialModes(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCalendars:) + func coverageLonLatUriCalendars(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -822,23 +597,32 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageRegionUriCommercialModesRequestBuilder = api!.newCoverageRegionUriCommercialModesRequestBuilder(); + if let api: CalendarsApi? = self.sdk?.calendarsApi { + let queryBuilder: CoverageLonLatUriCalendarsRequestBuilder = api!.newCoverageLonLatUriCalendarsRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "uri") != nil { queryBuilder.withUri(anyToString(params!["uri"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) } if params?.index(forKey: "count") != nil { queryBuilder.withCount(anyToInt(params!["count"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "startDate") != nil { + queryBuilder.withStartDate(anyToString(params!["startDate"]!)) + } + if params?.index(forKey: "endDate") != nil { + queryBuilder.withEndDate(anyToString(params!["endDate"]!)) } if params?.index(forKey: "forbiddenId") != nil { queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) @@ -846,35 +630,9 @@ import NavitiaSDK if params?.index(forKey: "forbiddenUris") != nil { queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCommercialModesRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } if params?.index(forKey: "distance") != nil { queryBuilder.withDistance(anyToInt(params!["distance"]!)) } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -900,8 +658,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriCommercialModesId:) - func coverageRegionUriCommercialModesId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionCalendars:) + func coverageRegionCalendars(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -911,26 +669,26 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CommercialModesApi? = self.sdk?.commercialModesApi { - let queryBuilder: CoverageRegionUriCommercialModesIdRequestBuilder = api!.newCoverageRegionUriCommercialModesIdRequestBuilder(); + if let api: CalendarsApi? = self.sdk?.calendarsApi { + let queryBuilder: CoverageRegionCalendarsRequestBuilder = api!.newCoverageRegionCalendarsRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) } - if params?.index(forKey: "uri") != nil { - queryBuilder.withUri(anyToString(params!["uri"]!)) + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) } - if params?.index(forKey: "id") != nil { - queryBuilder.withId(anyToString(params!["id"]!)) + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) } if params?.index(forKey: "startPage") != nil { queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) + if params?.index(forKey: "startDate") != nil { + queryBuilder.withStartDate(anyToString(params!["startDate"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) + if params?.index(forKey: "endDate") != nil { + queryBuilder.withEndDate(anyToString(params!["endDate"]!)) } if params?.index(forKey: "forbiddenId") != nil { queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) @@ -938,31 +696,146 @@ import NavitiaSDK if params?.index(forKey: "forbiddenUris") != nil { queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionCalendarsId:) + func coverageRegionCalendarsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CalendarsApi? = self.sdk?.calendarsApi { + let queryBuilder: CoverageRegionCalendarsIdRequestBuilder = api!.newCoverageRegionCalendarsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCommercialModesIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "startDate") != nil { + queryBuilder.withStartDate(anyToString(params!["startDate"]!)) + } + if params?.index(forKey: "endDate") != nil { + queryBuilder.withEndDate(anyToString(params!["endDate"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } if params?.index(forKey: "distance") != nil { queryBuilder.withDistance(anyToInt(params!["distance"]!)) } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriCalendars:) + func coverageRegionUriCalendars(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CalendarsApi? = self.sdk?.calendarsApi { + let queryBuilder: CoverageRegionUriCalendarsRequestBuilder = api!.newCoverageRegionUriCalendarsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "startDate") != nil { + queryBuilder.withStartDate(anyToString(params!["startDate"]!)) + } + if params?.index(forKey: "endDate") != nil { + queryBuilder.withEndDate(anyToString(params!["endDate"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -989,8 +862,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatCompanies:) - func coverageLonLatCompanies(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCommercialModes:) + func coverageLonLatCommercialModes(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1000,8 +873,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageLonLatCompaniesRequestBuilder = api!.newCoverageLonLatCompaniesRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageLonLatCommercialModesRequestBuilder = api!.newCoverageLonLatCommercialModesRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1034,7 +907,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCompaniesRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCommercialModesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1078,8 +951,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatCompaniesId:) - func coverageLonLatCompaniesId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCommercialModesId:) + func coverageLonLatCommercialModesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1089,8 +962,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageLonLatCompaniesIdRequestBuilder = api!.newCoverageLonLatCompaniesIdRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageLonLatCommercialModesIdRequestBuilder = api!.newCoverageLonLatCommercialModesIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1126,7 +999,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCompaniesIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCommercialModesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1167,8 +1040,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriCompanies:) - func coverageLonLatUriCompanies(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCommercialModes:) + func coverageLonLatUriCommercialModes(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1178,8 +1051,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageLonLatUriCompaniesRequestBuilder = api!.newCoverageLonLatUriCompaniesRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageLonLatUriCommercialModesRequestBuilder = api!.newCoverageLonLatUriCommercialModesRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1215,7 +1088,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCompaniesRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCommercialModesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1259,8 +1132,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriCompaniesId:) - func coverageLonLatUriCompaniesId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCommercialModesId:) + func coverageLonLatUriCommercialModesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1270,8 +1143,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageLonLatUriCompaniesIdRequestBuilder = api!.newCoverageLonLatUriCompaniesIdRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageLonLatUriCommercialModesIdRequestBuilder = api!.newCoverageLonLatUriCommercialModesIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1310,7 +1183,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCompaniesIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCommercialModesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1351,8 +1224,8 @@ import NavitiaSDK } } } - @objc(coverageRegionCompanies:) - func coverageRegionCompanies(command: CDVInvokedUrlCommand) { + @objc(coverageRegionCommercialModes:) + func coverageRegionCommercialModes(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1362,8 +1235,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageRegionCompaniesRequestBuilder = api!.newCoverageRegionCompaniesRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageRegionCommercialModesRequestBuilder = api!.newCoverageRegionCommercialModesRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -1393,7 +1266,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCompaniesRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCommercialModesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1437,8 +1310,8 @@ import NavitiaSDK } } } - @objc(coverageRegionCompaniesId:) - func coverageRegionCompaniesId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionCommercialModesId:) + func coverageRegionCommercialModesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1448,8 +1321,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageRegionCompaniesIdRequestBuilder = api!.newCoverageRegionCompaniesIdRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageRegionCommercialModesIdRequestBuilder = api!.newCoverageRegionCommercialModesIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -1482,7 +1355,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCompaniesIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCommercialModesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1523,8 +1396,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriCompanies:) - func coverageRegionUriCompanies(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriCommercialModes:) + func coverageRegionUriCommercialModes(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1534,8 +1407,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageRegionUriCompaniesRequestBuilder = api!.newCoverageRegionUriCompaniesRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageRegionUriCommercialModesRequestBuilder = api!.newCoverageRegionUriCommercialModesRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -1568,7 +1441,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCompaniesRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCommercialModesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1612,8 +1485,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriCompaniesId:) - func coverageRegionUriCompaniesId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriCommercialModesId:) + func coverageRegionUriCommercialModesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1623,8 +1496,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: CompaniesApi? = self.sdk?.companiesApi { - let queryBuilder: CoverageRegionUriCompaniesIdRequestBuilder = api!.newCoverageRegionUriCompaniesIdRequestBuilder(); + if let api: CommercialModesApi? = self.sdk?.commercialModesApi { + let queryBuilder: CoverageRegionUriCommercialModesIdRequestBuilder = api!.newCoverageRegionUriCommercialModesIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -1660,7 +1533,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCompaniesIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCommercialModesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1701,8 +1574,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatContributors:) - func coverageLonLatContributors(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCompanies:) + func coverageLonLatCompanies(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1712,8 +1585,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageLonLatContributorsRequestBuilder = api!.newCoverageLonLatContributorsRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageLonLatCompaniesRequestBuilder = api!.newCoverageLonLatCompaniesRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1746,7 +1619,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatContributorsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCompaniesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1790,8 +1663,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatContributorsId:) - func coverageLonLatContributorsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCompaniesId:) + func coverageLonLatCompaniesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1801,8 +1674,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageLonLatContributorsIdRequestBuilder = api!.newCoverageLonLatContributorsIdRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageLonLatCompaniesIdRequestBuilder = api!.newCoverageLonLatCompaniesIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1838,7 +1711,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatContributorsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatCompaniesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1879,8 +1752,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriContributors:) - func coverageLonLatUriContributors(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCompanies:) + func coverageLonLatUriCompanies(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1890,8 +1763,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageLonLatUriContributorsRequestBuilder = api!.newCoverageLonLatUriContributorsRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageLonLatUriCompaniesRequestBuilder = api!.newCoverageLonLatUriCompaniesRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -1927,7 +1800,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriContributorsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCompaniesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -1971,8 +1844,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriContributorsId:) - func coverageLonLatUriContributorsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCompaniesId:) + func coverageLonLatUriCompaniesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -1982,8 +1855,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageLonLatUriContributorsIdRequestBuilder = api!.newCoverageLonLatUriContributorsIdRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageLonLatUriCompaniesIdRequestBuilder = api!.newCoverageLonLatUriCompaniesIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -2022,7 +1895,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriContributorsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriCompaniesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2063,8 +1936,8 @@ import NavitiaSDK } } } - @objc(coverageRegionContributors:) - func coverageRegionContributors(command: CDVInvokedUrlCommand) { + @objc(coverageRegionCompanies:) + func coverageRegionCompanies(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2074,8 +1947,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageRegionContributorsRequestBuilder = api!.newCoverageRegionContributorsRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageRegionCompaniesRequestBuilder = api!.newCoverageRegionCompaniesRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -2105,7 +1978,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionContributorsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCompaniesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2149,8 +2022,8 @@ import NavitiaSDK } } } - @objc(coverageRegionContributorsId:) - func coverageRegionContributorsId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionCompaniesId:) + func coverageRegionCompaniesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2160,8 +2033,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageRegionContributorsIdRequestBuilder = api!.newCoverageRegionContributorsIdRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageRegionCompaniesIdRequestBuilder = api!.newCoverageRegionCompaniesIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -2194,7 +2067,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionContributorsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionCompaniesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2235,8 +2108,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriContributors:) - func coverageRegionUriContributors(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriCompanies:) + func coverageRegionUriCompanies(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2246,8 +2119,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageRegionUriContributorsRequestBuilder = api!.newCoverageRegionUriContributorsRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageRegionUriCompaniesRequestBuilder = api!.newCoverageRegionUriCompaniesRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -2280,7 +2153,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriContributorsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCompaniesRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2324,8 +2197,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriContributorsId:) - func coverageRegionUriContributorsId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriCompaniesId:) + func coverageRegionUriCompaniesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2335,8 +2208,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: ContributorsApi? = self.sdk?.contributorsApi { - let queryBuilder: CoverageRegionUriContributorsIdRequestBuilder = api!.newCoverageRegionUriContributorsIdRequestBuilder(); + if let api: CompaniesApi? = self.sdk?.companiesApi { + let queryBuilder: CoverageRegionUriCompaniesIdRequestBuilder = api!.newCoverageRegionUriCompaniesIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -2372,7 +2245,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriContributorsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriCompaniesIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2413,143 +2286,8 @@ import NavitiaSDK } } } - @objc(coverage:) - func coverage(command: CDVInvokedUrlCommand) { - let params = command.arguments[0] as? [String : Any] - - if params == nil || params?.count == 0 { - let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") - self.commandDelegate!.send( - pluginResult, - callbackId: command.callbackId - ) - } else { - if let api: CoverageApi? = self.sdk?.coverageApi { - let queryBuilder: CoverageRequestBuilder = api!.newCoverageRequestBuilder(); - - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - - queryBuilder.rawGet(completion: { results, error in - var pluginResult: CDVPluginResult? = nil - - if error == nil { - NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) - let jsonData = results?.data(using: String.Encoding.utf8) - if jsonData != nil { - do { - let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] - pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) - } catch { - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) - } - } - } else { - NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) - } - - self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) - }) - } - } - } - @objc(coverageLonLat:) - func coverageLonLat(command: CDVInvokedUrlCommand) { - let params = command.arguments[0] as? [String : Any] - - if params == nil || params?.count == 0 { - let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") - self.commandDelegate!.send( - pluginResult, - callbackId: command.callbackId - ) - } else { - if let api: CoverageApi? = self.sdk?.coverageApi { - let queryBuilder: CoverageLonLatRequestBuilder = api!.newCoverageLonLatRequestBuilder(); - - if params?.index(forKey: "lat") != nil { - queryBuilder.withLat(anyToDouble(params!["lat"]!)) - } - if params?.index(forKey: "lon") != nil { - queryBuilder.withLon(anyToDouble(params!["lon"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - - queryBuilder.rawGet(completion: { results, error in - var pluginResult: CDVPluginResult? = nil - - if error == nil { - NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) - let jsonData = results?.data(using: String.Encoding.utf8) - if jsonData != nil { - do { - let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] - pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) - } catch { - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) - } - } - } else { - NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) - } - - self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) - }) - } - } - } - @objc(coverageRegion:) - func coverageRegion(command: CDVInvokedUrlCommand) { - let params = command.arguments[0] as? [String : Any] - - if params == nil || params?.count == 0 { - let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") - self.commandDelegate!.send( - pluginResult, - callbackId: command.callbackId - ) - } else { - if let api: CoverageApi? = self.sdk?.coverageApi { - let queryBuilder: CoverageRegionRequestBuilder = api!.newCoverageRegionRequestBuilder(); - - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - - queryBuilder.rawGet(completion: { results, error in - var pluginResult: CDVPluginResult? = nil - - if error == nil { - NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) - let jsonData = results?.data(using: String.Encoding.utf8) - if jsonData != nil { - do { - let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] - pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) - } catch { - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) - } - } - } else { - NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) - } - - self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) - }) - } - } - } - @objc(coverageLonLatDatasets:) - func coverageLonLatDatasets(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatContributors:) + func coverageLonLatContributors(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2559,8 +2297,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageLonLatDatasetsRequestBuilder = api!.newCoverageLonLatDatasetsRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageLonLatContributorsRequestBuilder = api!.newCoverageLonLatContributorsRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -2593,7 +2331,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDatasetsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatContributorsRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2637,8 +2375,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatDatasetsId:) - func coverageLonLatDatasetsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatContributorsId:) + func coverageLonLatContributorsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2648,8 +2386,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageLonLatDatasetsIdRequestBuilder = api!.newCoverageLonLatDatasetsIdRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageLonLatContributorsIdRequestBuilder = api!.newCoverageLonLatContributorsIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -2685,7 +2423,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDatasetsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatContributorsIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2726,8 +2464,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriDatasets:) - func coverageLonLatUriDatasets(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriContributors:) + func coverageLonLatUriContributors(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2737,8 +2475,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageLonLatUriDatasetsRequestBuilder = api!.newCoverageLonLatUriDatasetsRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageLonLatUriContributorsRequestBuilder = api!.newCoverageLonLatUriContributorsRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -2774,7 +2512,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDatasetsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriContributorsRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2818,8 +2556,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriDatasetsId:) - func coverageLonLatUriDatasetsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriContributorsId:) + func coverageLonLatUriContributorsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2829,8 +2567,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageLonLatUriDatasetsIdRequestBuilder = api!.newCoverageLonLatUriDatasetsIdRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageLonLatUriContributorsIdRequestBuilder = api!.newCoverageLonLatUriContributorsIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -2869,7 +2607,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDatasetsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriContributorsIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2910,8 +2648,8 @@ import NavitiaSDK } } } - @objc(coverageRegionDatasets:) - func coverageRegionDatasets(command: CDVInvokedUrlCommand) { + @objc(coverageRegionContributors:) + func coverageRegionContributors(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -2921,8 +2659,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageRegionDatasetsRequestBuilder = api!.newCoverageRegionDatasetsRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageRegionContributorsRequestBuilder = api!.newCoverageRegionContributorsRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -2952,7 +2690,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDatasetsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionContributorsRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -2996,8 +2734,8 @@ import NavitiaSDK } } } - @objc(coverageRegionDatasetsId:) - func coverageRegionDatasetsId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionContributorsId:) + func coverageRegionContributorsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3007,8 +2745,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageRegionDatasetsIdRequestBuilder = api!.newCoverageRegionDatasetsIdRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageRegionContributorsIdRequestBuilder = api!.newCoverageRegionContributorsIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -3041,7 +2779,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDatasetsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionContributorsIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -3082,8 +2820,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriDatasets:) - func coverageRegionUriDatasets(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriContributors:) + func coverageRegionUriContributors(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3093,8 +2831,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageRegionUriDatasetsRequestBuilder = api!.newCoverageRegionUriDatasetsRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageRegionUriContributorsRequestBuilder = api!.newCoverageRegionUriContributorsRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -3127,7 +2865,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDatasetsRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriContributorsRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -3171,8 +2909,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriDatasetsId:) - func coverageRegionUriDatasetsId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriContributorsId:) + func coverageRegionUriContributorsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3182,8 +2920,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DatasetsApi? = self.sdk?.datasetsApi { - let queryBuilder: CoverageRegionUriDatasetsIdRequestBuilder = api!.newCoverageRegionUriDatasetsIdRequestBuilder(); + if let api: ContributorsApi? = self.sdk?.contributorsApi { + let queryBuilder: CoverageRegionUriContributorsIdRequestBuilder = api!.newCoverageRegionUriContributorsIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) @@ -3219,7 +2957,7 @@ import NavitiaSDK queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) } if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDatasetsIdRequestBuilder.OdtLevel? { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriContributorsIdRequestBuilder.OdtLevel? { queryBuilder.withOdtLevel(enumValue) } } @@ -3260,8 +2998,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatDisruptions:) - func coverageLonLatDisruptions(command: CDVInvokedUrlCommand) { + @objc(coordLonLat:) + func coordLonLat(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3271,8 +3009,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageLonLatDisruptionsRequestBuilder = api!.newCoverageLonLatDisruptionsRequestBuilder(); + if let api: CoordApi? = self.sdk?.coordApi { + let queryBuilder: CoordLonLatRequestBuilder = api!.newCoordLonLatRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -3280,53 +3018,6 @@ import NavitiaSDK if params?.index(forKey: "lon") != nil { queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDisruptionsRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -3352,8 +3043,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatDisruptionsId:) - func coverageLonLatDisruptionsId(command: CDVInvokedUrlCommand) { + @objc(coordsLonLat:) + func coordsLonLat(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3363,8 +3054,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageLonLatDisruptionsIdRequestBuilder = api!.newCoverageLonLatDisruptionsIdRequestBuilder(); + if let api: CoordApi? = self.sdk?.coordApi { + let queryBuilder: CoordsLonLatRequestBuilder = api!.newCoordsLonLatRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -3372,53 +3063,6 @@ import NavitiaSDK if params?.index(forKey: "lon") != nil { queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "id") != nil { - queryBuilder.withId(anyToString(params!["id"]!)) - } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDisruptionsIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -3444,8 +3088,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriDisruptions:) - func coverageLonLatUriDisruptions(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCoord:) + func coverageLonLatCoord(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3455,8 +3099,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageLonLatUriDisruptionsRequestBuilder = api!.newCoverageLonLatUriDisruptionsRequestBuilder(); + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatCoordRequestBuilder = api!.newCoverageLonLatCoordRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -3464,56 +3108,6 @@ import NavitiaSDK if params?.index(forKey: "lon") != nil { queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "uri") != nil { - queryBuilder.withUri(anyToString(params!["uri"]!)) - } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDisruptionsRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -3539,8 +3133,8 @@ import NavitiaSDK } } } - @objc(coverageLonLatUriDisruptionsId:) - func coverageLonLatUriDisruptionsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCoordId:) + func coverageLonLatCoordId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3550,8 +3144,8 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageLonLatUriDisruptionsIdRequestBuilder = api!.newCoverageLonLatUriDisruptionsIdRequestBuilder(); + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatCoordIdRequestBuilder = api!.newCoverageLonLatCoordIdRequestBuilder(); if params?.index(forKey: "lat") != nil { queryBuilder.withLat(anyToDouble(params!["lat"]!)) @@ -3559,56 +3153,9 @@ import NavitiaSDK if params?.index(forKey: "lon") != nil { queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "uri") != nil { - queryBuilder.withUri(anyToString(params!["uri"]!)) - } if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDisruptionsIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -3634,8 +3181,8 @@ import NavitiaSDK } } } - @objc(coverageRegionDisruptions:) - func coverageRegionDisruptions(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCoords:) + func coverageLonLatCoords(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3645,58 +3192,14 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageRegionDisruptionsRequestBuilder = api!.newCoverageRegionDisruptionsRequestBuilder(); + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatCoordsRequestBuilder = api!.newCoverageLonLatCoordsRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) - } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDisruptionsRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -3723,8 +3226,8 @@ import NavitiaSDK } } } - @objc(coverageRegionDisruptionsId:) - func coverageRegionDisruptionsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatCoordsId:) + func coverageLonLatCoordsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3734,58 +3237,65 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageRegionDisruptionsIdRequestBuilder = api!.newCoverageRegionDisruptionsIdRequestBuilder(); + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatCoordsIdRequestBuilder = api!.newCoverageLonLatCoordsIdRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDisruptionsIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriCoord:) + func coverageLonLatUriCoord(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatUriCoordRequestBuilder = api!.newCoverageLonLatUriCoordRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -3812,8 +3322,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriDisruptions:) - func coverageRegionUriDisruptions(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCoordId:) + func coverageLonLatUriCoordId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3823,61 +3333,68 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageRegionUriDisruptionsRequestBuilder = api!.newCoverageRegionUriDisruptionsRequestBuilder(); + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatUriCoordIdRequestBuilder = api!.newCoverageLonLatUriCoordIdRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "uri") != nil { queryBuilder.withUri(anyToString(params!["uri"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDisruptionsRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriCoords:) + func coverageLonLatUriCoords(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatUriCoordsRequestBuilder = api!.newCoverageLonLatUriCoordsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) - } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) - } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -3904,8 +3421,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriDisruptionsId:) - func coverageRegionUriDisruptionsId(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriCoordsId:) + func coverageLonLatUriCoordsId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -3915,11 +3432,14 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: DisruptionsApi? = self.sdk?.disruptionsApi { - let queryBuilder: CoverageRegionUriDisruptionsIdRequestBuilder = api!.newCoverageRegionUriDisruptionsIdRequestBuilder(); + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageLonLatUriCoordsIdRequestBuilder = api!.newCoverageLonLatUriCoordsIdRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "uri") != nil { queryBuilder.withUri(anyToString(params!["uri"]!)) @@ -3927,49 +3447,2300 @@ import NavitiaSDK if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDisruptionsIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionCoord:) + func coverageRegionCoord(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionCoordRequestBuilder = api!.newCoverageRegionCoordRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionCoordId:) + func coverageRegionCoordId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionCoordIdRequestBuilder = api!.newCoverageRegionCoordIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionCoords:) + func coverageRegionCoords(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionCoordsRequestBuilder = api!.newCoverageRegionCoordsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionCoordsId:) + func coverageRegionCoordsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionCoordsIdRequestBuilder = api!.newCoverageRegionCoordsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriCoord:) + func coverageRegionUriCoord(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionUriCoordRequestBuilder = api!.newCoverageRegionUriCoordRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriCoordId:) + func coverageRegionUriCoordId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionUriCoordIdRequestBuilder = api!.newCoverageRegionUriCoordIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriCoords:) + func coverageRegionUriCoords(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionUriCoordsRequestBuilder = api!.newCoverageRegionUriCoordsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriCoordsId:) + func coverageRegionUriCoordsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoordsApi? = self.sdk?.coordsApi { + let queryBuilder: CoverageRegionUriCoordsIdRequestBuilder = api!.newCoverageRegionUriCoordsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverage:) + func coverage(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoverageApi? = self.sdk?.coverageApi { + let queryBuilder: CoverageRequestBuilder = api!.newCoverageRequestBuilder(); + + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLat:) + func coverageLonLat(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoverageApi? = self.sdk?.coverageApi { + let queryBuilder: CoverageLonLatRequestBuilder = api!.newCoverageLonLatRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegion:) + func coverageRegion(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: CoverageApi? = self.sdk?.coverageApi { + let queryBuilder: CoverageRegionRequestBuilder = api!.newCoverageRegionRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatDatasets:) + func coverageLonLatDatasets(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageLonLatDatasetsRequestBuilder = api!.newCoverageLonLatDatasetsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDatasetsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatDatasetsId:) + func coverageLonLatDatasetsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageLonLatDatasetsIdRequestBuilder = api!.newCoverageLonLatDatasetsIdRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDatasetsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriDatasets:) + func coverageLonLatUriDatasets(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageLonLatUriDatasetsRequestBuilder = api!.newCoverageLonLatUriDatasetsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDatasetsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriDatasetsId:) + func coverageLonLatUriDatasetsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageLonLatUriDatasetsIdRequestBuilder = api!.newCoverageLonLatUriDatasetsIdRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDatasetsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionDatasets:) + func coverageRegionDatasets(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageRegionDatasetsRequestBuilder = api!.newCoverageRegionDatasetsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDatasetsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionDatasetsId:) + func coverageRegionDatasetsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageRegionDatasetsIdRequestBuilder = api!.newCoverageRegionDatasetsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDatasetsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriDatasets:) + func coverageRegionUriDatasets(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageRegionUriDatasetsRequestBuilder = api!.newCoverageRegionUriDatasetsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDatasetsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriDatasetsId:) + func coverageRegionUriDatasetsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DatasetsApi? = self.sdk?.datasetsApi { + let queryBuilder: CoverageRegionUriDatasetsIdRequestBuilder = api!.newCoverageRegionUriDatasetsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDatasetsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatDisruptions:) + func coverageLonLatDisruptions(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageLonLatDisruptionsRequestBuilder = api!.newCoverageLonLatDisruptionsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDisruptionsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatDisruptionsId:) + func coverageLonLatDisruptionsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageLonLatDisruptionsIdRequestBuilder = api!.newCoverageLonLatDisruptionsIdRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatDisruptionsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriDisruptions:) + func coverageLonLatUriDisruptions(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageLonLatUriDisruptionsRequestBuilder = api!.newCoverageLonLatUriDisruptionsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDisruptionsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriDisruptionsId:) + func coverageLonLatUriDisruptionsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageLonLatUriDisruptionsIdRequestBuilder = api!.newCoverageLonLatUriDisruptionsIdRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageLonLatUriDisruptionsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionDisruptions:) + func coverageRegionDisruptions(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageRegionDisruptionsRequestBuilder = api!.newCoverageRegionDisruptionsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDisruptionsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionDisruptionsId:) + func coverageRegionDisruptionsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageRegionDisruptionsIdRequestBuilder = api!.newCoverageRegionDisruptionsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionDisruptionsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriDisruptions:) + func coverageRegionUriDisruptions(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageRegionUriDisruptionsRequestBuilder = api!.newCoverageRegionUriDisruptionsRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDisruptionsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriDisruptionsId:) + func coverageRegionUriDisruptionsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: DisruptionsApi? = self.sdk?.disruptionsApi { + let queryBuilder: CoverageRegionUriDisruptionsIdRequestBuilder = api!.newCoverageRegionUriDisruptionsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriDisruptionsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatGeoStatus:) + func coverageLonLatGeoStatus(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: GeoStatusApi? = self.sdk?.geoStatusApi { + let queryBuilder: CoverageLonLatGeoStatusRequestBuilder = api!.newCoverageLonLatGeoStatusRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionGeoStatus:) + func coverageRegionGeoStatus(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: GeoStatusApi? = self.sdk?.geoStatusApi { + let queryBuilder: CoverageRegionGeoStatusRequestBuilder = api!.newCoverageRegionGeoStatusRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatIsochrones:) + func coverageLonLatIsochrones(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: GraphicalIsochroneApi? = self.sdk?.graphicalIsochroneApi { + let queryBuilder: CoverageLonLatIsochronesRequestBuilder = api!.newCoverageLonLatIsochronesRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "from") != nil { + queryBuilder.withFrom(anyToString(params!["from"]!)) + } + if params?.index(forKey: "to") != nil { + queryBuilder.withTo(anyToString(params!["to"]!)) + } + if params?.index(forKey: "datetime") != nil { + queryBuilder.withDatetime(anyToDateTime(params!["datetime"]!)) + } + if params?.index(forKey: "datetimeRepresents") != nil { + if let enumValue = anyToEnum(params!["datetimeRepresents"]!) as CoverageLonLatIsochronesRequestBuilder.DatetimeRepresents? { + queryBuilder.withDatetimeRepresents(enumValue) + } + } + if params?.index(forKey: "maxNbTransfers") != nil { + queryBuilder.withMaxNbTransfers(anyToInt(params!["maxNbTransfers"]!)) + } + if params?.index(forKey: "minNbTransfers") != nil { + queryBuilder.withMinNbTransfers(anyToInt(params!["minNbTransfers"]!)) + } + if params?.index(forKey: "firstSectionMode") != nil { + queryBuilder.withFirstSectionMode(arrayToEnum(params!["firstSectionMode"]!) as [CoverageLonLatIsochronesRequestBuilder.FirstSectionMode]) + } + if params?.index(forKey: "lastSectionMode") != nil { + queryBuilder.withLastSectionMode(arrayToEnum(params!["lastSectionMode"]!) as [CoverageLonLatIsochronesRequestBuilder.LastSectionMode]) + } + if params?.index(forKey: "maxDurationToPt") != nil { + queryBuilder.withMaxDurationToPt(anyToInt(params!["maxDurationToPt"]!)) + } + if params?.index(forKey: "maxWalkingDurationToPt") != nil { + queryBuilder.withMaxWalkingDurationToPt(anyToInt(params!["maxWalkingDurationToPt"]!)) + } + if params?.index(forKey: "maxBikeDurationToPt") != nil { + queryBuilder.withMaxBikeDurationToPt(anyToInt(params!["maxBikeDurationToPt"]!)) + } + if params?.index(forKey: "maxBssDurationToPt") != nil { + queryBuilder.withMaxBssDurationToPt(anyToInt(params!["maxBssDurationToPt"]!)) + } + if params?.index(forKey: "maxCarDurationToPt") != nil { + queryBuilder.withMaxCarDurationToPt(anyToInt(params!["maxCarDurationToPt"]!)) + } + if params?.index(forKey: "walkingSpeed") != nil { + queryBuilder.withWalkingSpeed(anyToFloat(params!["walkingSpeed"]!)) + } + if params?.index(forKey: "bikeSpeed") != nil { + queryBuilder.withBikeSpeed(anyToFloat(params!["bikeSpeed"]!)) + } + if params?.index(forKey: "bssSpeed") != nil { + queryBuilder.withBssSpeed(anyToFloat(params!["bssSpeed"]!)) + } + if params?.index(forKey: "carSpeed") != nil { + queryBuilder.withCarSpeed(anyToFloat(params!["carSpeed"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "allowedId") != nil { + queryBuilder.withAllowedId(arrayToStringDict(params!["allowedId"]!)) + } + if params?.index(forKey: "disruptionActive") != nil { + queryBuilder.withDisruptionActive(anyToBool(params!["disruptionActive"]!)) + } + if params?.index(forKey: "dataFreshness") != nil { + if let enumValue = anyToEnum(params!["dataFreshness"]!) as CoverageLonLatIsochronesRequestBuilder.DataFreshness? { + queryBuilder.withDataFreshness(enumValue) + } + } + if params?.index(forKey: "maxDuration") != nil { + queryBuilder.withMaxDuration(anyToInt(params!["maxDuration"]!)) + } + if params?.index(forKey: "wheelchair") != nil { + queryBuilder.withWheelchair(anyToBool(params!["wheelchair"]!)) + } + if params?.index(forKey: "travelerType") != nil { + if let enumValue = anyToEnum(params!["travelerType"]!) as CoverageLonLatIsochronesRequestBuilder.TravelerType? { + queryBuilder.withTravelerType(enumValue) + } + } + if params?.index(forKey: "directPath") != nil { + if let enumValue = anyToEnum(params!["directPath"]!) as CoverageLonLatIsochronesRequestBuilder.DirectPath? { + queryBuilder.withDirectPath(enumValue) + } + } + if params?.index(forKey: "minDuration") != nil { + queryBuilder.withMinDuration(anyToInt(params!["minDuration"]!)) + } + if params?.index(forKey: "boundaryDuration") != nil { + queryBuilder.withBoundaryDuration(arrayToIntDict(params!["boundaryDuration"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionIsochrones:) + func coverageRegionIsochrones(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: GraphicalIsochroneApi? = self.sdk?.graphicalIsochroneApi { + let queryBuilder: CoverageRegionIsochronesRequestBuilder = api!.newCoverageRegionIsochronesRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "from") != nil { + queryBuilder.withFrom(anyToString(params!["from"]!)) + } + if params?.index(forKey: "to") != nil { + queryBuilder.withTo(anyToString(params!["to"]!)) + } + if params?.index(forKey: "datetime") != nil { + queryBuilder.withDatetime(anyToDateTime(params!["datetime"]!)) + } + if params?.index(forKey: "datetimeRepresents") != nil { + if let enumValue = anyToEnum(params!["datetimeRepresents"]!) as CoverageRegionIsochronesRequestBuilder.DatetimeRepresents? { + queryBuilder.withDatetimeRepresents(enumValue) + } + } + if params?.index(forKey: "maxNbTransfers") != nil { + queryBuilder.withMaxNbTransfers(anyToInt(params!["maxNbTransfers"]!)) + } + if params?.index(forKey: "minNbTransfers") != nil { + queryBuilder.withMinNbTransfers(anyToInt(params!["minNbTransfers"]!)) + } + if params?.index(forKey: "firstSectionMode") != nil { + queryBuilder.withFirstSectionMode(arrayToEnum(params!["firstSectionMode"]!) as [CoverageRegionIsochronesRequestBuilder.FirstSectionMode]) + } + if params?.index(forKey: "lastSectionMode") != nil { + queryBuilder.withLastSectionMode(arrayToEnum(params!["lastSectionMode"]!) as [CoverageRegionIsochronesRequestBuilder.LastSectionMode]) + } + if params?.index(forKey: "maxDurationToPt") != nil { + queryBuilder.withMaxDurationToPt(anyToInt(params!["maxDurationToPt"]!)) + } + if params?.index(forKey: "maxWalkingDurationToPt") != nil { + queryBuilder.withMaxWalkingDurationToPt(anyToInt(params!["maxWalkingDurationToPt"]!)) + } + if params?.index(forKey: "maxBikeDurationToPt") != nil { + queryBuilder.withMaxBikeDurationToPt(anyToInt(params!["maxBikeDurationToPt"]!)) + } + if params?.index(forKey: "maxBssDurationToPt") != nil { + queryBuilder.withMaxBssDurationToPt(anyToInt(params!["maxBssDurationToPt"]!)) + } + if params?.index(forKey: "maxCarDurationToPt") != nil { + queryBuilder.withMaxCarDurationToPt(anyToInt(params!["maxCarDurationToPt"]!)) + } + if params?.index(forKey: "walkingSpeed") != nil { + queryBuilder.withWalkingSpeed(anyToFloat(params!["walkingSpeed"]!)) + } + if params?.index(forKey: "bikeSpeed") != nil { + queryBuilder.withBikeSpeed(anyToFloat(params!["bikeSpeed"]!)) + } + if params?.index(forKey: "bssSpeed") != nil { + queryBuilder.withBssSpeed(anyToFloat(params!["bssSpeed"]!)) + } + if params?.index(forKey: "carSpeed") != nil { + queryBuilder.withCarSpeed(anyToFloat(params!["carSpeed"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "allowedId") != nil { + queryBuilder.withAllowedId(arrayToStringDict(params!["allowedId"]!)) + } + if params?.index(forKey: "disruptionActive") != nil { + queryBuilder.withDisruptionActive(anyToBool(params!["disruptionActive"]!)) + } + if params?.index(forKey: "dataFreshness") != nil { + if let enumValue = anyToEnum(params!["dataFreshness"]!) as CoverageRegionIsochronesRequestBuilder.DataFreshness? { + queryBuilder.withDataFreshness(enumValue) + } + } + if params?.index(forKey: "maxDuration") != nil { + queryBuilder.withMaxDuration(anyToInt(params!["maxDuration"]!)) + } + if params?.index(forKey: "wheelchair") != nil { + queryBuilder.withWheelchair(anyToBool(params!["wheelchair"]!)) + } + if params?.index(forKey: "travelerType") != nil { + if let enumValue = anyToEnum(params!["travelerType"]!) as CoverageRegionIsochronesRequestBuilder.TravelerType? { + queryBuilder.withTravelerType(enumValue) + } } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + if params?.index(forKey: "directPath") != nil { + if let enumValue = anyToEnum(params!["directPath"]!) as CoverageRegionIsochronesRequestBuilder.DirectPath? { + queryBuilder.withDirectPath(enumValue) + } } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + if params?.index(forKey: "minDuration") != nil { + queryBuilder.withMinDuration(anyToInt(params!["minDuration"]!)) } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + if params?.index(forKey: "boundaryDuration") != nil { + queryBuilder.withBoundaryDuration(arrayToIntDict(params!["boundaryDuration"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -3996,8 +5767,8 @@ import NavitiaSDK } } } - @objc(coverageRegionGeoStatus:) - func coverageRegionGeoStatus(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatHeatMaps:) + func coverageLonLatHeatMaps(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -4007,53 +5778,14 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: GeoStatusApi? = self.sdk?.geoStatusApi { - let queryBuilder: CoverageRegionGeoStatusRequestBuilder = api!.newCoverageRegionGeoStatusRequestBuilder(); + if let api: HeatMapApi? = self.sdk?.heatMapApi { + let queryBuilder: CoverageLonLatHeatMapsRequestBuilder = api!.newCoverageLonLatHeatMapsRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - - queryBuilder.rawGet(completion: { results, error in - var pluginResult: CDVPluginResult? = nil - - if error == nil { - NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) - let jsonData = results?.data(using: String.Encoding.utf8) - if jsonData != nil { - do { - let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] - pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) - } catch { - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) - } - } - } else { - NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) - } - - self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) - }) - } - } - } - @objc(coverageRegionIsochrones:) - func coverageRegionIsochrones(command: CDVInvokedUrlCommand) { - let params = command.arguments[0] as? [String : Any] - - if params == nil || params?.count == 0 { - let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") - self.commandDelegate!.send( - pluginResult, - callbackId: command.callbackId - ) - } else { - if let api: GraphicalIsochroneApi? = self.sdk?.graphicalIsochroneApi { - let queryBuilder: CoverageRegionIsochronesRequestBuilder = api!.newCoverageRegionIsochronesRequestBuilder(); - - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } if params?.index(forKey: "from") != nil { queryBuilder.withFrom(anyToString(params!["from"]!)) @@ -4065,7 +5797,7 @@ import NavitiaSDK queryBuilder.withDatetime(anyToDateTime(params!["datetime"]!)) } if params?.index(forKey: "datetimeRepresents") != nil { - if let enumValue = anyToEnum(params!["datetimeRepresents"]!) as CoverageRegionIsochronesRequestBuilder.DatetimeRepresents? { + if let enumValue = anyToEnum(params!["datetimeRepresents"]!) as CoverageLonLatHeatMapsRequestBuilder.DatetimeRepresents? { queryBuilder.withDatetimeRepresents(enumValue) } } @@ -4076,10 +5808,10 @@ import NavitiaSDK queryBuilder.withMinNbTransfers(anyToInt(params!["minNbTransfers"]!)) } if params?.index(forKey: "firstSectionMode") != nil { - queryBuilder.withFirstSectionMode(arrayToEnum(params!["firstSectionMode"]!) as [CoverageRegionIsochronesRequestBuilder.FirstSectionMode]) + queryBuilder.withFirstSectionMode(arrayToEnum(params!["firstSectionMode"]!) as [CoverageLonLatHeatMapsRequestBuilder.FirstSectionMode]) } if params?.index(forKey: "lastSectionMode") != nil { - queryBuilder.withLastSectionMode(arrayToEnum(params!["lastSectionMode"]!) as [CoverageRegionIsochronesRequestBuilder.LastSectionMode]) + queryBuilder.withLastSectionMode(arrayToEnum(params!["lastSectionMode"]!) as [CoverageLonLatHeatMapsRequestBuilder.LastSectionMode]) } if params?.index(forKey: "maxDurationToPt") != nil { queryBuilder.withMaxDurationToPt(anyToInt(params!["maxDurationToPt"]!)) @@ -4118,7 +5850,7 @@ import NavitiaSDK queryBuilder.withDisruptionActive(anyToBool(params!["disruptionActive"]!)) } if params?.index(forKey: "dataFreshness") != nil { - if let enumValue = anyToEnum(params!["dataFreshness"]!) as CoverageRegionIsochronesRequestBuilder.DataFreshness? { + if let enumValue = anyToEnum(params!["dataFreshness"]!) as CoverageLonLatHeatMapsRequestBuilder.DataFreshness? { queryBuilder.withDataFreshness(enumValue) } } @@ -4129,20 +5861,17 @@ import NavitiaSDK queryBuilder.withWheelchair(anyToBool(params!["wheelchair"]!)) } if params?.index(forKey: "travelerType") != nil { - if let enumValue = anyToEnum(params!["travelerType"]!) as CoverageRegionIsochronesRequestBuilder.TravelerType? { + if let enumValue = anyToEnum(params!["travelerType"]!) as CoverageLonLatHeatMapsRequestBuilder.TravelerType? { queryBuilder.withTravelerType(enumValue) } } if params?.index(forKey: "directPath") != nil { - if let enumValue = anyToEnum(params!["directPath"]!) as CoverageRegionIsochronesRequestBuilder.DirectPath? { + if let enumValue = anyToEnum(params!["directPath"]!) as CoverageLonLatHeatMapsRequestBuilder.DirectPath? { queryBuilder.withDirectPath(enumValue) } } - if params?.index(forKey: "minDuration") != nil { - queryBuilder.withMinDuration(anyToInt(params!["minDuration"]!)) - } - if params?.index(forKey: "boundaryDuration") != nil { - queryBuilder.withBoundaryDuration(arrayToIntDict(params!["boundaryDuration"]!)) + if params?.index(forKey: "resolution") != nil { + queryBuilder.withResolution(anyToInt(params!["resolution"]!)) } queryBuilder.rawGet(completion: { results, error in @@ -6794,8 +8523,186 @@ import NavitiaSDK } } } - @objc(coverageRegionUriLineGroupsId:) - func coverageRegionUriLineGroupsId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionUriLineGroupsId:) + func coverageRegionUriLineGroupsId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: LineGroupsApi? = self.sdk?.lineGroupsApi { + let queryBuilder: CoverageRegionUriLineGroupsIdRequestBuilder = api!.newCoverageRegionUriLineGroupsIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriLineGroupsIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(lineGroups:) + func lineGroups(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: LineGroupsApi? = self.sdk?.lineGroupsApi { + let queryBuilder: LineGroupsRequestBuilder = api!.newLineGroupsRequestBuilder(); + + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as LineGroupsRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + if params?.index(forKey: "originalId") != nil { + queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatLineReports:) + func coverageLonLatLineReports(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -6805,49 +8712,29 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: LineGroupsApi? = self.sdk?.lineGroupsApi { - let queryBuilder: CoverageRegionUriLineGroupsIdRequestBuilder = api!.newCoverageRegionUriLineGroupsIdRequestBuilder(); + if let api: LineReportsApi? = self.sdk?.lineReportsApi { + let queryBuilder: CoverageLonLatLineReportsRequestBuilder = api!.newCoverageLonLatLineReportsRequestBuilder(); - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) - } - if params?.index(forKey: "uri") != nil { - queryBuilder.withUri(anyToString(params!["uri"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "id") != nil { - queryBuilder.withId(anyToString(params!["id"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) } if params?.index(forKey: "count") != nil { queryBuilder.withCount(anyToInt(params!["count"]!)) } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) } if params?.index(forKey: "forbiddenUris") != nil { queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) - } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriLineGroupsIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) } if params?.index(forKey: "since") != nil { queryBuilder.withSince(anyToDateTime(params!["since"]!)) @@ -6855,12 +8742,6 @@ import NavitiaSDK if params?.index(forKey: "until") != nil { queryBuilder.withUntil(anyToDateTime(params!["until"]!)) } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -6886,8 +8767,8 @@ import NavitiaSDK } } } - @objc(lineGroups:) - func lineGroups(command: CDVInvokedUrlCommand) { + @objc(coverageLonLatUriLineReports:) + func coverageLonLatUriLineReports(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -6897,40 +8778,32 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: LineGroupsApi? = self.sdk?.lineGroupsApi { - let queryBuilder: LineGroupsRequestBuilder = api!.newLineGroupsRequestBuilder(); + if let api: LineReportsApi? = self.sdk?.lineReportsApi { + let queryBuilder: CoverageLonLatUriLineReportsRequestBuilder = api!.newCoverageLonLatUriLineReportsRequestBuilder(); - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) } if params?.index(forKey: "depth") != nil { queryBuilder.withDepth(anyToInt(params!["depth"]!)) } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) } if params?.index(forKey: "forbiddenUris") != nil { queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) - } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) - } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as LineGroupsRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) - } - } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) } if params?.index(forKey: "since") != nil { queryBuilder.withSince(anyToDateTime(params!["since"]!)) @@ -6938,15 +8811,6 @@ import NavitiaSDK if params?.index(forKey: "until") != nil { queryBuilder.withUntil(anyToDateTime(params!["until"]!)) } - if params?.index(forKey: "disableGeojson") != nil { - queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) - } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } - if params?.index(forKey: "originalId") != nil { - queryBuilder.withOriginalId(anyToString(params!["originalId"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -7004,6 +8868,12 @@ import NavitiaSDK if params?.index(forKey: "disableGeojson") != nil { queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -7064,6 +8934,12 @@ import NavitiaSDK if params?.index(forKey: "disableGeojson") != nil { queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -10082,15 +11958,161 @@ import NavitiaSDK if params?.index(forKey: "since") != nil { queryBuilder.withSince(anyToDateTime(params!["since"]!)) } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + if params?.index(forKey: "filter") != nil { + queryBuilder.withFilter(anyToString(params!["filter"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageRegionUriPhysicalModesId:) + func coverageRegionUriPhysicalModesId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: PhysicalModesApi? = self.sdk?.physicalModesApi { + let queryBuilder: CoverageRegionUriPhysicalModesIdRequestBuilder = api!.newCoverageRegionUriPhysicalModesIdRequestBuilder(); + + if params?.index(forKey: "region") != nil { + queryBuilder.withRegion(anyToString(params!["region"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "externalCode") != nil { + queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + } + if params?.index(forKey: "headsign") != nil { + queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + } + if params?.index(forKey: "showCodes") != nil { + queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + } + if params?.index(forKey: "odtLevel") != nil { + if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriPhysicalModesIdRequestBuilder.OdtLevel? { + queryBuilder.withOdtLevel(enumValue) + } + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "since") != nil { + queryBuilder.withSince(anyToDateTime(params!["since"]!)) + } + if params?.index(forKey: "until") != nil { + queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatPlacesId:) + func coverageLonLatPlacesId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: PlaceUriApi? = self.sdk?.placeUriApi { + let queryBuilder: CoverageLonLatPlacesIdRequestBuilder = api!.newCoverageLonLatPlacesIdRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) + } + if params?.index(forKey: "bssStands") != nil { + queryBuilder.withBssStands(anyToBool(params!["bssStands"]!)) + } + if params?.index(forKey: "addPoiInfos") != nil { + queryBuilder.withAddPoiInfos(arrayToEnum(params!["addPoiInfos"]!) as [CoverageLonLatPlacesIdRequestBuilder.AddPoiInfos]) } if params?.index(forKey: "disableGeojson") != nil { queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) } - if params?.index(forKey: "filter") != nil { - queryBuilder.withFilter(anyToString(params!["filter"]!)) - } queryBuilder.rawGet(completion: { results, error in var pluginResult: CDVPluginResult? = nil @@ -10116,8 +12138,8 @@ import NavitiaSDK } } } - @objc(coverageRegionUriPhysicalModesId:) - func coverageRegionUriPhysicalModesId(command: CDVInvokedUrlCommand) { + @objc(coverageRegionPlacesId:) + func coverageRegionPlacesId(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] if params == nil || params?.count == 0 { @@ -10127,55 +12149,71 @@ import NavitiaSDK callbackId: command.callbackId ) } else { - if let api: PhysicalModesApi? = self.sdk?.physicalModesApi { - let queryBuilder: CoverageRegionUriPhysicalModesIdRequestBuilder = api!.newCoverageRegionUriPhysicalModesIdRequestBuilder(); + if let api: PlaceUriApi? = self.sdk?.placeUriApi { + let queryBuilder: CoverageRegionPlacesIdRequestBuilder = api!.newCoverageRegionPlacesIdRequestBuilder(); if params?.index(forKey: "region") != nil { queryBuilder.withRegion(anyToString(params!["region"]!)) } - if params?.index(forKey: "uri") != nil { - queryBuilder.withUri(anyToString(params!["uri"]!)) - } if params?.index(forKey: "id") != nil { queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "startPage") != nil { - queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) - } - if params?.index(forKey: "count") != nil { - queryBuilder.withCount(anyToInt(params!["count"]!)) - } - if params?.index(forKey: "depth") != nil { - queryBuilder.withDepth(anyToInt(params!["depth"]!)) - } - if params?.index(forKey: "forbiddenId") != nil { - queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) - } - if params?.index(forKey: "forbiddenUris") != nil { - queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) - } - if params?.index(forKey: "externalCode") != nil { - queryBuilder.withExternalCode(anyToString(params!["externalCode"]!)) + if params?.index(forKey: "bssStands") != nil { + queryBuilder.withBssStands(anyToBool(params!["bssStands"]!)) } - if params?.index(forKey: "headsign") != nil { - queryBuilder.withHeadsign(anyToString(params!["headsign"]!)) + if params?.index(forKey: "addPoiInfos") != nil { + queryBuilder.withAddPoiInfos(arrayToEnum(params!["addPoiInfos"]!) as [CoverageRegionPlacesIdRequestBuilder.AddPoiInfos]) } - if params?.index(forKey: "showCodes") != nil { - queryBuilder.withShowCodes(anyToBool(params!["showCodes"]!)) + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) } - if params?.index(forKey: "odtLevel") != nil { - if let enumValue = anyToEnum(params!["odtLevel"]!) as CoverageRegionUriPhysicalModesIdRequestBuilder.OdtLevel? { - queryBuilder.withOdtLevel(enumValue) + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(placesId:) + func placesId(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: PlaceUriApi? = self.sdk?.placeUriApi { + let queryBuilder: PlacesIdRequestBuilder = api!.newPlacesIdRequestBuilder(); + + if params?.index(forKey: "id") != nil { + queryBuilder.withId(anyToString(params!["id"]!)) } - if params?.index(forKey: "distance") != nil { - queryBuilder.withDistance(anyToInt(params!["distance"]!)) - } - if params?.index(forKey: "since") != nil { - queryBuilder.withSince(anyToDateTime(params!["since"]!)) + if params?.index(forKey: "bssStands") != nil { + queryBuilder.withBssStands(anyToBool(params!["bssStands"]!)) } - if params?.index(forKey: "until") != nil { - queryBuilder.withUntil(anyToDateTime(params!["until"]!)) + if params?.index(forKey: "addPoiInfos") != nil { + queryBuilder.withAddPoiInfos(arrayToEnum(params!["addPoiInfos"]!) as [PlacesIdRequestBuilder.AddPoiInfos]) } if params?.index(forKey: "disableGeojson") != nil { queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) @@ -13558,48 +15596,6 @@ import NavitiaSDK } } } - @objc(coverageRegionStatus:) - func coverageRegionStatus(command: CDVInvokedUrlCommand) { - let params = command.arguments[0] as? [String : Any] - - if params == nil || params?.count == 0 { - let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") - self.commandDelegate!.send( - pluginResult, - callbackId: command.callbackId - ) - } else { - if let api: StatusApi? = self.sdk?.statusApi { - let queryBuilder: CoverageRegionStatusRequestBuilder = api!.newCoverageRegionStatusRequestBuilder(); - - if params?.index(forKey: "region") != nil { - queryBuilder.withRegion(anyToString(params!["region"]!)) - } - - queryBuilder.rawGet(completion: { results, error in - var pluginResult: CDVPluginResult? = nil - - if error == nil { - NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) - let jsonData = results?.data(using: String.Encoding.utf8) - if jsonData != nil { - do { - let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] - pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) - } catch { - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) - } - } - } else { - NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) - pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) - } - - self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) - }) - } - } - } @objc(coverageLonLatStopAreas:) func coverageLonLatStopAreas(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] @@ -15526,6 +17522,141 @@ import NavitiaSDK } } } + @objc(coverageLonLatTrafficReports:) + func coverageLonLatTrafficReports(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: TrafficReportApi? = self.sdk?.trafficReportApi { + let queryBuilder: CoverageLonLatTrafficReportsRequestBuilder = api!.newCoverageLonLatTrafficReportsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } + @objc(coverageLonLatUriTrafficReports:) + func coverageLonLatUriTrafficReports(command: CDVInvokedUrlCommand) { + let params = command.arguments[0] as? [String : Any] + + if params == nil || params?.count == 0 { + let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Wrong parameters") + self.commandDelegate!.send( + pluginResult, + callbackId: command.callbackId + ) + } else { + if let api: TrafficReportApi? = self.sdk?.trafficReportApi { + let queryBuilder: CoverageLonLatUriTrafficReportsRequestBuilder = api!.newCoverageLonLatUriTrafficReportsRequestBuilder(); + + if params?.index(forKey: "lat") != nil { + queryBuilder.withLat(anyToDouble(params!["lat"]!)) + } + if params?.index(forKey: "lon") != nil { + queryBuilder.withLon(anyToDouble(params!["lon"]!)) + } + if params?.index(forKey: "uri") != nil { + queryBuilder.withUri(anyToString(params!["uri"]!)) + } + if params?.index(forKey: "depth") != nil { + queryBuilder.withDepth(anyToInt(params!["depth"]!)) + } + if params?.index(forKey: "count") != nil { + queryBuilder.withCount(anyToInt(params!["count"]!)) + } + if params?.index(forKey: "startPage") != nil { + queryBuilder.withStartPage(anyToInt(params!["startPage"]!)) + } + if params?.index(forKey: "forbiddenId") != nil { + queryBuilder.withForbiddenId(arrayToStringDict(params!["forbiddenId"]!)) + } + if params?.index(forKey: "forbiddenUris") != nil { + queryBuilder.withForbiddenUris(arrayToStringDict(params!["forbiddenUris"]!)) + } + if params?.index(forKey: "distance") != nil { + queryBuilder.withDistance(anyToInt(params!["distance"]!)) + } + if params?.index(forKey: "disableGeojson") != nil { + queryBuilder.withDisableGeojson(anyToBool(params!["disableGeojson"]!)) + } + + queryBuilder.rawGet(completion: { results, error in + var pluginResult: CDVPluginResult? = nil + + if error == nil { + NSLog(String(format: "SDK journeys with query %@", queryBuilder.makeUrl())) + let jsonData = results?.data(using: String.Encoding.utf8) + if jsonData != nil { + do { + let jsonResults = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions.mutableContainers) as? [String : Any] + pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: jsonResults) + } catch { + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription) + } + } + } else { + NSLog(String(format: "SDK journeys fail with query %@", queryBuilder.makeUrl())) + pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error!.localizedDescription) + } + + self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) + }) + } + } + } @objc(coverageRegionTrafficReports:) func coverageRegionTrafficReports(command: CDVInvokedUrlCommand) { let params = command.arguments[0] as? [String : Any] diff --git a/www/NavitiaSDK.js b/www/NavitiaSDK.js index 5afbfbc..97c2e79 100644 --- a/www/NavitiaSDK.js +++ b/www/NavitiaSDK.js @@ -2,9 +2,194 @@ var exec = require('cordova/exec'); var request_builders = { - CoverageRegionCalendarsRequestBuilder: function () { - this.CoverageRegionCalendarsRequestBuilder = function() { + CoverageLonLatAddressesRequestBuilder: function () { + this.CoverageLonLatAddressesRequestBuilder = function() { + this.lat = null; + this.lon = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatAddresses', [{ + lat: this.lat, + lon: this.lon + }]); + }; + }, + CoverageLonLatAddressesIdRequestBuilder: function () { + this.CoverageLonLatAddressesIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.id = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatAddressesId', [{ + lat: this.lat, + lon: this.lon, + id: this.id + }]); + }; + }, + CoverageLonLatUriAddressesRequestBuilder: function () { + this.CoverageLonLatUriAddressesRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriAddresses', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri + }]); + }; + }, + CoverageLonLatUriAddressesIdRequestBuilder: function () { + this.CoverageLonLatUriAddressesIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; + this.id = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriAddressesId', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, + id: this.id + }]); + }; + }, + CoverageRegionAddressesRequestBuilder: function () { + this.CoverageRegionAddressesRequestBuilder = function() { + this.region = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionAddresses', [{ + region: this.region + }]); + }; + }, + CoverageRegionAddressesIdRequestBuilder: function () { + this.CoverageRegionAddressesIdRequestBuilder = function() { + this.region = null; + this.id = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionAddressesId', [{ + region: this.region, + id: this.id + }]); + }; + }, + CoverageRegionUriAddressesRequestBuilder: function () { + this.CoverageRegionUriAddressesRequestBuilder = function() { + this.region = null; + this.uri = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriAddresses', [{ + region: this.region, + uri: this.uri + }]); + }; + }, + CoverageRegionUriAddressesIdRequestBuilder: function () { + this.CoverageRegionUriAddressesIdRequestBuilder = function() { this.region = null; + this.uri = null; + this.id = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriAddressesId', [{ + region: this.region, + uri: this.uri, + id: this.id + }]); + }; + }, + CoverageLonLatCalendarsRequestBuilder: function () { + this.CoverageLonLatCalendarsRequestBuilder = function() { + this.lat = null; + this.lon = null; this.depth = null; this.count = null; this.startPage = null; @@ -14,8 +199,12 @@ var request_builders = { this.forbiddenUris = null; this.distance = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; return this; }; this.withDepth = function (depth) { @@ -51,8 +240,9 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCalendars', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatCalendars', [{ + lat: this.lat, + lon: this.lon, depth: this.depth, count: this.count, startPage: this.startPage, @@ -64,9 +254,10 @@ var request_builders = { }]); }; }, - CoverageRegionCalendarsIdRequestBuilder: function () { - this.CoverageRegionCalendarsIdRequestBuilder = function() { - this.region = null; + CoverageLonLatCalendarsIdRequestBuilder: function () { + this.CoverageLonLatCalendarsIdRequestBuilder = function() { + this.lat = null; + this.lon = null; this.id = null; this.depth = null; this.count = null; @@ -77,8 +268,12 @@ var request_builders = { this.forbiddenUris = null; this.distance = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; return this; }; this.withId = function (id) { @@ -118,8 +313,9 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCalendarsId', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatCalendarsId', [{ + lat: this.lat, + lon: this.lon, id: this.id, depth: this.depth, count: this.count, @@ -132,9 +328,10 @@ var request_builders = { }]); }; }, - CoverageRegionUriCalendarsRequestBuilder: function () { - this.CoverageRegionUriCalendarsRequestBuilder = function() { - this.region = null; + CoverageLonLatUriCalendarsRequestBuilder: function () { + this.CoverageLonLatUriCalendarsRequestBuilder = function() { + this.lat = null; + this.lon = null; this.uri = null; this.depth = null; this.count = null; @@ -145,8 +342,12 @@ var request_builders = { this.forbiddenUris = null; this.distance = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; return this; }; this.withUri = function (uri) { @@ -186,8 +387,9 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriCalendars', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriCalendars', [{ + lat: this.lat, + lon: this.lon, uri: this.uri, depth: this.depth, count: this.count, @@ -200,43 +402,40 @@ var request_builders = { }]); }; }, - CoverageLonLatCommercialModesRequestBuilder: function () { - this.CoverageLonLatCommercialModesRequestBuilder = function() { - this.lat = null; - this.lon = null; - this.startPage = null; - this.count = null; + CoverageRegionCalendarsRequestBuilder: function () { + this.CoverageRegionCalendarsRequestBuilder = function() { + this.region = null; this.depth = null; + this.count = null; + this.startPage = null; + this.startDate = null; + this.endDate = null; this.forbiddenId = null; this.forbiddenUris = null; - this.externalCode = null; - this.headsign = null; - this.showCodes = null; - this.odtLevel = null; this.distance = null; - this.since = null; - this.until = null; - this.disableGeojson = null; - this.filter = null; }; - this.withLat = function (lat) { - this.lat = lat; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withLon = function (lon) { - this.lon = lon; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withCount = function (count) { + this.count = count; return this; }; this.withStartPage = function (startPage) { this.startPage = startPage; return this; }; - this.withCount = function (count) { - this.count = count; + this.withStartDate = function (startDate) { + this.startDate = startDate; return this; }; - this.withDepth = function (depth) { - this.depth = depth; + this.withEndDate = function (endDate) { + this.endDate = endDate; return this; }; this.withForbiddenId = function (forbiddenId) { @@ -247,19 +446,220 @@ var request_builders = { this.forbiddenUris = forbiddenUris; return this; }; - this.withExternalCode = function (externalCode) { - this.externalCode = externalCode; - return this; - }; - this.withHeadsign = function (headsign) { - this.headsign = headsign; - return this; - }; - this.withShowCodes = function (showCodes) { - this.showCodes = showCodes; + this.withDistance = function (distance) { + this.distance = distance; return this; }; - this.withOdtLevel = function (odtLevel) { + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCalendars', [{ + region: this.region, + depth: this.depth, + count: this.count, + startPage: this.startPage, + startDate: this.startDate, + endDate: this.endDate, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + distance: this.distance + }]); + }; + }, + CoverageRegionCalendarsIdRequestBuilder: function () { + this.CoverageRegionCalendarsIdRequestBuilder = function() { + this.region = null; + this.id = null; + this.depth = null; + this.count = null; + this.startPage = null; + this.startDate = null; + this.endDate = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.distance = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withStartDate = function (startDate) { + this.startDate = startDate; + return this; + }; + this.withEndDate = function (endDate) { + this.endDate = endDate; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCalendarsId', [{ + region: this.region, + id: this.id, + depth: this.depth, + count: this.count, + startPage: this.startPage, + startDate: this.startDate, + endDate: this.endDate, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + distance: this.distance + }]); + }; + }, + CoverageRegionUriCalendarsRequestBuilder: function () { + this.CoverageRegionUriCalendarsRequestBuilder = function() { + this.region = null; + this.uri = null; + this.depth = null; + this.count = null; + this.startPage = null; + this.startDate = null; + this.endDate = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.distance = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withStartDate = function (startDate) { + this.startDate = startDate; + return this; + }; + this.withEndDate = function (endDate) { + this.endDate = endDate; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriCalendars', [{ + region: this.region, + uri: this.uri, + depth: this.depth, + count: this.count, + startPage: this.startPage, + startDate: this.startDate, + endDate: this.endDate, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + distance: this.distance + }]); + }; + }, + CoverageLonLatCommercialModesRequestBuilder: function () { + this.CoverageLonLatCommercialModesRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.startPage = null; + this.count = null; + this.depth = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.externalCode = null; + this.headsign = null; + this.showCodes = null; + this.odtLevel = null; + this.distance = null; + this.since = null; + this.until = null; + this.disableGeojson = null; + this.filter = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withExternalCode = function (externalCode) { + this.externalCode = externalCode; + return this; + }; + this.withHeadsign = function (headsign) { + this.headsign = headsign; + return this; + }; + this.withShowCodes = function (showCodes) { + this.showCodes = showCodes; + return this; + }; + this.withOdtLevel = function (odtLevel) { this.odtLevel = odtLevel; return this; }; @@ -2696,25 +3096,30 @@ var request_builders = { }]); }; }, - CoverageRequestBuilder: function () { - this.CoverageRequestBuilder = function() { - this.disableGeojson = null; + CoordLonLatRequestBuilder: function () { + this.CoordLonLatRequestBuilder = function() { + this.lat = null; + this.lon = null; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverage', [{ - disableGeojson: this.disableGeojson + exec(successCallback, errorCallback, 'NavitiaSDK', 'coordLonLat', [{ + lat: this.lat, + lon: this.lon }]); }; }, - CoverageLonLatRequestBuilder: function () { - this.CoverageLonLatRequestBuilder = function() { + CoordsLonLatRequestBuilder: function () { + this.CoordsLonLatRequestBuilder = function() { this.lat = null; this.lon = null; - this.disableGeojson = null; }; this.withLat = function (lat) { this.lat = lat; @@ -2724,56 +3129,38 @@ var request_builders = { this.lon = lon; return this; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; - return this; - }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLat', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coordsLonLat', [{ lat: this.lat, - lon: this.lon, - disableGeojson: this.disableGeojson + lon: this.lon }]); }; }, - CoverageRegionRequestBuilder: function () { - this.CoverageRegionRequestBuilder = function() { - this.region = null; - this.disableGeojson = null; + CoverageLonLatCoordRequestBuilder: function () { + this.CoverageLonLatCoordRequestBuilder = function() { + this.lat = null; + this.lon = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; + this.withLon = function (lon) { + this.lon = lon; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegion', [{ - region: this.region, - disableGeojson: this.disableGeojson + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatCoord', [{ + lat: this.lat, + lon: this.lon }]); }; }, - CoverageLonLatDatasetsRequestBuilder: function () { - this.CoverageLonLatDatasetsRequestBuilder = function() { + CoverageLonLatCoordIdRequestBuilder: function () { + this.CoverageLonLatCoordIdRequestBuilder = function() { this.lat = null; this.lon = null; - this.startPage = null; - this.count = null; - this.depth = null; - this.forbiddenId = null; - this.forbiddenUris = null; - this.externalCode = null; - this.headsign = null; - this.showCodes = null; - this.odtLevel = null; - this.distance = null; - this.since = null; - this.until = null; - this.disableGeojson = null; - this.filter = null; + this.id = null; }; this.withLat = function (lat) { this.lat = lat; @@ -2783,101 +3170,69 @@ var request_builders = { this.lon = lon; return this; }; - this.withStartPage = function (startPage) { - this.startPage = startPage; - return this; - }; - this.withCount = function (count) { - this.count = count; - return this; - }; - this.withDepth = function (depth) { - this.depth = depth; - return this; - }; - this.withForbiddenId = function (forbiddenId) { - this.forbiddenId = forbiddenId; - return this; - }; - this.withForbiddenUris = function (forbiddenUris) { - this.forbiddenUris = forbiddenUris; + this.withId = function (id) { + this.id = id; return this; }; - this.withExternalCode = function (externalCode) { - this.externalCode = externalCode; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatCoordId', [{ + lat: this.lat, + lon: this.lon, + id: this.id + }]); }; - this.withHeadsign = function (headsign) { - this.headsign = headsign; - return this; + }, + CoverageLonLatCoordsRequestBuilder: function () { + this.CoverageLonLatCoordsRequestBuilder = function() { + this.lat = null; + this.lon = null; }; - this.withShowCodes = function (showCodes) { - this.showCodes = showCodes; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withOdtLevel = function (odtLevel) { - this.odtLevel = odtLevel; + this.withLon = function (lon) { + this.lon = lon; return this; }; - this.withDistance = function (distance) { - this.distance = distance; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatCoords', [{ + lat: this.lat, + lon: this.lon + }]); }; - this.withSince = function (since) { - this.since = since; - return this; + }, + CoverageLonLatCoordsIdRequestBuilder: function () { + this.CoverageLonLatCoordsIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.id = null; }; - this.withUntil = function (until) { - this.until = until; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; + this.withLon = function (lon) { + this.lon = lon; return this; }; - this.withFilter = function (filter) { - this.filter = filter; + this.withId = function (id) { + this.id = id; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDatasets', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatCoordsId', [{ lat: this.lat, lon: this.lon, - startPage: this.startPage, - count: this.count, - depth: this.depth, - forbiddenId: this.forbiddenId, - forbiddenUris: this.forbiddenUris, - externalCode: this.externalCode, - headsign: this.headsign, - showCodes: this.showCodes, - odtLevel: this.odtLevel, - distance: this.distance, - since: this.since, - until: this.until, - disableGeojson: this.disableGeojson, - filter: this.filter + id: this.id }]); }; }, - CoverageLonLatDatasetsIdRequestBuilder: function () { - this.CoverageLonLatDatasetsIdRequestBuilder = function() { + CoverageLonLatUriCoordRequestBuilder: function () { + this.CoverageLonLatUriCoordRequestBuilder = function() { this.lat = null; this.lon = null; - this.id = null; - this.startPage = null; - this.count = null; - this.depth = null; - this.forbiddenId = null; - this.forbiddenUris = null; - this.externalCode = null; - this.headsign = null; - this.showCodes = null; - this.odtLevel = null; - this.distance = null; - this.since = null; - this.until = null; - this.disableGeojson = null; + this.uri = null; }; this.withLat = function (lat) { this.lat = lat; @@ -2887,102 +3242,82 @@ var request_builders = { this.lon = lon; return this; }; - this.withId = function (id) { - this.id = id; - return this; - }; - this.withStartPage = function (startPage) { - this.startPage = startPage; - return this; - }; - this.withCount = function (count) { - this.count = count; + this.withUri = function (uri) { + this.uri = uri; return this; }; - this.withDepth = function (depth) { - this.depth = depth; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriCoord', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri + }]); }; - this.withForbiddenId = function (forbiddenId) { - this.forbiddenId = forbiddenId; - return this; + }, + CoverageLonLatUriCoordIdRequestBuilder: function () { + this.CoverageLonLatUriCoordIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; + this.id = null; }; - this.withForbiddenUris = function (forbiddenUris) { - this.forbiddenUris = forbiddenUris; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withExternalCode = function (externalCode) { - this.externalCode = externalCode; + this.withLon = function (lon) { + this.lon = lon; return this; }; - this.withHeadsign = function (headsign) { - this.headsign = headsign; + this.withUri = function (uri) { + this.uri = uri; return this; }; - this.withShowCodes = function (showCodes) { - this.showCodes = showCodes; + this.withId = function (id) { + this.id = id; return this; }; - this.withOdtLevel = function (odtLevel) { - this.odtLevel = odtLevel; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriCoordId', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, + id: this.id + }]); }; - this.withDistance = function (distance) { - this.distance = distance; - return this; + }, + CoverageLonLatUriCoordsRequestBuilder: function () { + this.CoverageLonLatUriCoordsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; }; - this.withSince = function (since) { - this.since = since; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withUntil = function (until) { - this.until = until; + this.withLon = function (lon) { + this.lon = lon; return this; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; + this.withUri = function (uri) { + this.uri = uri; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDatasetsId', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriCoords', [{ lat: this.lat, lon: this.lon, - id: this.id, - startPage: this.startPage, - count: this.count, - depth: this.depth, - forbiddenId: this.forbiddenId, - forbiddenUris: this.forbiddenUris, - externalCode: this.externalCode, - headsign: this.headsign, - showCodes: this.showCodes, - odtLevel: this.odtLevel, - distance: this.distance, - since: this.since, - until: this.until, - disableGeojson: this.disableGeojson + uri: this.uri }]); }; }, - CoverageLonLatUriDatasetsRequestBuilder: function () { - this.CoverageLonLatUriDatasetsRequestBuilder = function() { + CoverageLonLatUriCoordsIdRequestBuilder: function () { + this.CoverageLonLatUriCoordsIdRequestBuilder = function() { this.lat = null; this.lon = null; this.uri = null; - this.startPage = null; - this.count = null; - this.depth = null; - this.forbiddenId = null; - this.forbiddenUris = null; - this.externalCode = null; - this.headsign = null; - this.showCodes = null; - this.odtLevel = null; - this.distance = null; - this.since = null; - this.until = null; - this.disableGeojson = null; - this.filter = null; + this.id = null; }; this.withLat = function (lat) { this.lat = lat; @@ -2996,90 +3331,243 @@ var request_builders = { this.uri = uri; return this; }; - this.withStartPage = function (startPage) { - this.startPage = startPage; + this.withId = function (id) { + this.id = id; return this; }; - this.withCount = function (count) { - this.count = count; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriCoordsId', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, + id: this.id + }]); }; - this.withDepth = function (depth) { - this.depth = depth; - return this; + }, + CoverageRegionCoordRequestBuilder: function () { + this.CoverageRegionCoordRequestBuilder = function() { + this.region = null; }; - this.withForbiddenId = function (forbiddenId) { - this.forbiddenId = forbiddenId; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withForbiddenUris = function (forbiddenUris) { - this.forbiddenUris = forbiddenUris; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCoord', [{ + region: this.region + }]); }; - this.withExternalCode = function (externalCode) { - this.externalCode = externalCode; - return this; + }, + CoverageRegionCoordIdRequestBuilder: function () { + this.CoverageRegionCoordIdRequestBuilder = function() { + this.region = null; + this.id = null; }; - this.withHeadsign = function (headsign) { - this.headsign = headsign; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withShowCodes = function (showCodes) { - this.showCodes = showCodes; + this.withId = function (id) { + this.id = id; return this; }; - this.withOdtLevel = function (odtLevel) { - this.odtLevel = odtLevel; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCoordId', [{ + region: this.region, + id: this.id + }]); + }; + }, + CoverageRegionCoordsRequestBuilder: function () { + this.CoverageRegionCoordsRequestBuilder = function() { + this.region = null; + }; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withDistance = function (distance) { - this.distance = distance; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCoords', [{ + region: this.region + }]); + }; + }, + CoverageRegionCoordsIdRequestBuilder: function () { + this.CoverageRegionCoordsIdRequestBuilder = function() { + this.region = null; + this.id = null; + }; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withSince = function (since) { - this.since = since; + this.withId = function (id) { + this.id = id; return this; }; - this.withUntil = function (until) { - this.until = until; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionCoordsId', [{ + region: this.region, + id: this.id + }]); + }; + }, + CoverageRegionUriCoordRequestBuilder: function () { + this.CoverageRegionUriCoordRequestBuilder = function() { + this.region = null; + this.uri = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriCoord', [{ + region: this.region, + uri: this.uri + }]); + }; + }, + CoverageRegionUriCoordIdRequestBuilder: function () { + this.CoverageRegionUriCoordIdRequestBuilder = function() { + this.region = null; + this.uri = null; + this.id = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withId = function (id) { + this.id = id; return this; }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriCoordId', [{ + region: this.region, + uri: this.uri, + id: this.id + }]); + }; + }, + CoverageRegionUriCoordsRequestBuilder: function () { + this.CoverageRegionUriCoordsRequestBuilder = function() { + this.region = null; + this.uri = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriCoords', [{ + region: this.region, + uri: this.uri + }]); + }; + }, + CoverageRegionUriCoordsIdRequestBuilder: function () { + this.CoverageRegionUriCoordsIdRequestBuilder = function() { + this.region = null; + this.uri = null; + this.id = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriCoordsId', [{ + region: this.region, + uri: this.uri, + id: this.id + }]); + }; + }, + CoverageRequestBuilder: function () { + this.CoverageRequestBuilder = function() { + this.disableGeojson = null; + }; this.withDisableGeojson = function (disableGeojson) { this.disableGeojson = disableGeojson; return this; }; - this.withFilter = function (filter) { - this.filter = filter; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverage', [{ + disableGeojson: this.disableGeojson + }]); + }; + }, + CoverageLonLatRequestBuilder: function () { + this.CoverageLonLatRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.disableGeojson = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDatasets', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLat', [{ lat: this.lat, lon: this.lon, - uri: this.uri, - startPage: this.startPage, - count: this.count, - depth: this.depth, - forbiddenId: this.forbiddenId, - forbiddenUris: this.forbiddenUris, - externalCode: this.externalCode, - headsign: this.headsign, - showCodes: this.showCodes, - odtLevel: this.odtLevel, - distance: this.distance, - since: this.since, - until: this.until, - disableGeojson: this.disableGeojson, - filter: this.filter + disableGeojson: this.disableGeojson }]); }; }, - CoverageLonLatUriDatasetsIdRequestBuilder: function () { - this.CoverageLonLatUriDatasetsIdRequestBuilder = function() { + CoverageRegionRequestBuilder: function () { + this.CoverageRegionRequestBuilder = function() { + this.region = null; + this.disableGeojson = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegion', [{ + region: this.region, + disableGeojson: this.disableGeojson + }]); + }; + }, + CoverageLonLatDatasetsRequestBuilder: function () { + this.CoverageLonLatDatasetsRequestBuilder = function() { this.lat = null; this.lon = null; - this.uri = null; - this.id = null; this.startPage = null; this.count = null; this.depth = null; @@ -3093,6 +3581,7 @@ var request_builders = { this.since = null; this.until = null; this.disableGeojson = null; + this.filter = null; }; this.withLat = function (lat) { this.lat = lat; @@ -3102,14 +3591,6 @@ var request_builders = { this.lon = lon; return this; }; - this.withUri = function (uri) { - this.uri = uri; - return this; - }; - this.withId = function (id) { - this.id = id; - return this; - }; this.withStartPage = function (startPage) { this.startPage = startPage; return this; @@ -3162,12 +3643,14 @@ var request_builders = { this.disableGeojson = disableGeojson; return this; }; + this.withFilter = function (filter) { + this.filter = filter; + return this; + }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDatasetsId', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDatasets', [{ lat: this.lat, lon: this.lon, - uri: this.uri, - id: this.id, startPage: this.startPage, count: this.count, depth: this.depth, @@ -3180,13 +3663,16 @@ var request_builders = { distance: this.distance, since: this.since, until: this.until, - disableGeojson: this.disableGeojson + disableGeojson: this.disableGeojson, + filter: this.filter }]); }; }, - CoverageRegionDatasetsRequestBuilder: function () { - this.CoverageRegionDatasetsRequestBuilder = function() { - this.region = null; + CoverageLonLatDatasetsIdRequestBuilder: function () { + this.CoverageLonLatDatasetsIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.id = null; this.startPage = null; this.count = null; this.depth = null; @@ -3200,10 +3686,17 @@ var request_builders = { this.since = null; this.until = null; this.disableGeojson = null; - this.filter = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withId = function (id) { + this.id = id; return this; }; this.withStartPage = function (startPage) { @@ -3258,13 +3751,11 @@ var request_builders = { this.disableGeojson = disableGeojson; return this; }; - this.withFilter = function (filter) { - this.filter = filter; - return this; - }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionDatasets', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDatasetsId', [{ + lat: this.lat, + lon: this.lon, + id: this.id, startPage: this.startPage, count: this.count, depth: this.depth, @@ -3277,15 +3768,15 @@ var request_builders = { distance: this.distance, since: this.since, until: this.until, - disableGeojson: this.disableGeojson, - filter: this.filter + disableGeojson: this.disableGeojson }]); }; }, - CoverageRegionDatasetsIdRequestBuilder: function () { - this.CoverageRegionDatasetsIdRequestBuilder = function() { - this.region = null; - this.id = null; + CoverageLonLatUriDatasetsRequestBuilder: function () { + this.CoverageLonLatUriDatasetsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; this.startPage = null; this.count = null; this.depth = null; @@ -3299,13 +3790,18 @@ var request_builders = { this.since = null; this.until = null; this.disableGeojson = null; + this.filter = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withId = function (id) { - this.id = id; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; return this; }; this.withStartPage = function (startPage) { @@ -3360,9 +3856,125 @@ var request_builders = { this.disableGeojson = disableGeojson; return this; }; + this.withFilter = function (filter) { + this.filter = filter; + return this; + }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionDatasetsId', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDatasets', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, + startPage: this.startPage, + count: this.count, + depth: this.depth, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + externalCode: this.externalCode, + headsign: this.headsign, + showCodes: this.showCodes, + odtLevel: this.odtLevel, + distance: this.distance, + since: this.since, + until: this.until, + disableGeojson: this.disableGeojson, + filter: this.filter + }]); + }; + }, + CoverageLonLatUriDatasetsIdRequestBuilder: function () { + this.CoverageLonLatUriDatasetsIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; + this.id = null; + this.startPage = null; + this.count = null; + this.depth = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.externalCode = null; + this.headsign = null; + this.showCodes = null; + this.odtLevel = null; + this.distance = null; + this.since = null; + this.until = null; + this.disableGeojson = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withExternalCode = function (externalCode) { + this.externalCode = externalCode; + return this; + }; + this.withHeadsign = function (headsign) { + this.headsign = headsign; + return this; + }; + this.withShowCodes = function (showCodes) { + this.showCodes = showCodes; + return this; + }; + this.withOdtLevel = function (odtLevel) { + this.odtLevel = odtLevel; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDatasetsId', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, id: this.id, startPage: this.startPage, count: this.count, @@ -3380,10 +3992,9 @@ var request_builders = { }]); }; }, - CoverageRegionUriDatasetsRequestBuilder: function () { - this.CoverageRegionUriDatasetsRequestBuilder = function() { + CoverageRegionDatasetsRequestBuilder: function () { + this.CoverageRegionDatasetsRequestBuilder = function() { this.region = null; - this.uri = null; this.startPage = null; this.count = null; this.depth = null; @@ -3403,10 +4014,6 @@ var request_builders = { this.region = region; return this; }; - this.withUri = function (uri) { - this.uri = uri; - return this; - }; this.withStartPage = function (startPage) { this.startPage = startPage; return this; @@ -3464,9 +4071,8 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriDatasets', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionDatasets', [{ region: this.region, - uri: this.uri, startPage: this.startPage, count: this.count, depth: this.depth, @@ -3484,10 +4090,9 @@ var request_builders = { }]); }; }, - CoverageRegionUriDatasetsIdRequestBuilder: function () { - this.CoverageRegionUriDatasetsIdRequestBuilder = function() { + CoverageRegionDatasetsIdRequestBuilder: function () { + this.CoverageRegionDatasetsIdRequestBuilder = function() { this.region = null; - this.uri = null; this.id = null; this.startPage = null; this.count = null; @@ -3507,10 +4112,6 @@ var request_builders = { this.region = region; return this; }; - this.withUri = function (uri) { - this.uri = uri; - return this; - }; this.withId = function (id) { this.id = id; return this; @@ -3568,9 +4169,8 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriDatasetsId', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionDatasetsId', [{ region: this.region, - uri: this.uri, id: this.id, startPage: this.startPage, count: this.count, @@ -3588,10 +4188,10 @@ var request_builders = { }]); }; }, - CoverageLonLatDisruptionsRequestBuilder: function () { - this.CoverageLonLatDisruptionsRequestBuilder = function() { - this.lat = null; - this.lon = null; + CoverageRegionUriDatasetsRequestBuilder: function () { + this.CoverageRegionUriDatasetsRequestBuilder = function() { + this.region = null; + this.uri = null; this.startPage = null; this.count = null; this.depth = null; @@ -3606,14 +4206,13 @@ var request_builders = { this.until = null; this.disableGeojson = null; this.filter = null; - this.originalId = null; }; - this.withLat = function (lat) { - this.lat = lat; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withLon = function (lon) { - this.lon = lon; + this.withUri = function (uri) { + this.uri = uri; return this; }; this.withStartPage = function (startPage) { @@ -3672,14 +4271,10 @@ var request_builders = { this.filter = filter; return this; }; - this.withOriginalId = function (originalId) { - this.originalId = originalId; - return this; - }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDisruptions', [{ - lat: this.lat, - lon: this.lon, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriDatasets', [{ + region: this.region, + uri: this.uri, startPage: this.startPage, count: this.count, depth: this.depth, @@ -3693,15 +4288,14 @@ var request_builders = { since: this.since, until: this.until, disableGeojson: this.disableGeojson, - filter: this.filter, - originalId: this.originalId + filter: this.filter }]); }; }, - CoverageLonLatDisruptionsIdRequestBuilder: function () { - this.CoverageLonLatDisruptionsIdRequestBuilder = function() { - this.lat = null; - this.lon = null; + CoverageRegionUriDatasetsIdRequestBuilder: function () { + this.CoverageRegionUriDatasetsIdRequestBuilder = function() { + this.region = null; + this.uri = null; this.id = null; this.startPage = null; this.count = null; @@ -3716,14 +4310,13 @@ var request_builders = { this.since = null; this.until = null; this.disableGeojson = null; - this.originalId = null; }; - this.withLat = function (lat) { - this.lat = lat; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withLon = function (lon) { - this.lon = lon; + this.withUri = function (uri) { + this.uri = uri; return this; }; this.withId = function (id) { @@ -3782,14 +4375,10 @@ var request_builders = { this.disableGeojson = disableGeojson; return this; }; - this.withOriginalId = function (originalId) { - this.originalId = originalId; - return this; - }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDisruptionsId', [{ - lat: this.lat, - lon: this.lon, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriDatasetsId', [{ + region: this.region, + uri: this.uri, id: this.id, startPage: this.startPage, count: this.count, @@ -3803,16 +4392,14 @@ var request_builders = { distance: this.distance, since: this.since, until: this.until, - disableGeojson: this.disableGeojson, - originalId: this.originalId + disableGeojson: this.disableGeojson }]); }; }, - CoverageLonLatUriDisruptionsRequestBuilder: function () { - this.CoverageLonLatUriDisruptionsRequestBuilder = function() { + CoverageLonLatDisruptionsRequestBuilder: function () { + this.CoverageLonLatDisruptionsRequestBuilder = function() { this.lat = null; this.lon = null; - this.uri = null; this.startPage = null; this.count = null; this.depth = null; @@ -3837,10 +4424,6 @@ var request_builders = { this.lon = lon; return this; }; - this.withUri = function (uri) { - this.uri = uri; - return this; - }; this.withStartPage = function (startPage) { this.startPage = startPage; return this; @@ -3902,10 +4485,9 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDisruptions', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDisruptions', [{ lat: this.lat, lon: this.lon, - uri: this.uri, startPage: this.startPage, count: this.count, depth: this.depth, @@ -3924,11 +4506,10 @@ var request_builders = { }]); }; }, - CoverageLonLatUriDisruptionsIdRequestBuilder: function () { - this.CoverageLonLatUriDisruptionsIdRequestBuilder = function() { + CoverageLonLatDisruptionsIdRequestBuilder: function () { + this.CoverageLonLatDisruptionsIdRequestBuilder = function() { this.lat = null; this.lon = null; - this.uri = null; this.id = null; this.startPage = null; this.count = null; @@ -3953,10 +4534,6 @@ var request_builders = { this.lon = lon; return this; }; - this.withUri = function (uri) { - this.uri = uri; - return this; - }; this.withId = function (id) { this.id = id; return this; @@ -4018,10 +4595,9 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDisruptionsId', [{ + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatDisruptionsId', [{ lat: this.lat, lon: this.lon, - uri: this.uri, id: this.id, startPage: this.startPage, count: this.count, @@ -4040,9 +4616,11 @@ var request_builders = { }]); }; }, - CoverageRegionDisruptionsRequestBuilder: function () { - this.CoverageRegionDisruptionsRequestBuilder = function() { - this.region = null; + CoverageLonLatUriDisruptionsRequestBuilder: function () { + this.CoverageLonLatUriDisruptionsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; this.startPage = null; this.count = null; this.depth = null; @@ -4059,8 +4637,16 @@ var request_builders = { this.filter = null; this.originalId = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; return this; }; this.withStartPage = function (startPage) { @@ -4124,8 +4710,10 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionDisruptions', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDisruptions', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, startPage: this.startPage, count: this.count, depth: this.depth, @@ -4144,8 +4732,228 @@ var request_builders = { }]); }; }, - CoverageRegionDisruptionsIdRequestBuilder: function () { - this.CoverageRegionDisruptionsIdRequestBuilder = function() { + CoverageLonLatUriDisruptionsIdRequestBuilder: function () { + this.CoverageLonLatUriDisruptionsIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; + this.id = null; + this.startPage = null; + this.count = null; + this.depth = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.externalCode = null; + this.headsign = null; + this.showCodes = null; + this.odtLevel = null; + this.distance = null; + this.since = null; + this.until = null; + this.disableGeojson = null; + this.originalId = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withExternalCode = function (externalCode) { + this.externalCode = externalCode; + return this; + }; + this.withHeadsign = function (headsign) { + this.headsign = headsign; + return this; + }; + this.withShowCodes = function (showCodes) { + this.showCodes = showCodes; + return this; + }; + this.withOdtLevel = function (odtLevel) { + this.odtLevel = odtLevel; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.withOriginalId = function (originalId) { + this.originalId = originalId; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriDisruptionsId', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, + id: this.id, + startPage: this.startPage, + count: this.count, + depth: this.depth, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + externalCode: this.externalCode, + headsign: this.headsign, + showCodes: this.showCodes, + odtLevel: this.odtLevel, + distance: this.distance, + since: this.since, + until: this.until, + disableGeojson: this.disableGeojson, + originalId: this.originalId + }]); + }; + }, + CoverageRegionDisruptionsRequestBuilder: function () { + this.CoverageRegionDisruptionsRequestBuilder = function() { + this.region = null; + this.startPage = null; + this.count = null; + this.depth = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.externalCode = null; + this.headsign = null; + this.showCodes = null; + this.odtLevel = null; + this.distance = null; + this.since = null; + this.until = null; + this.disableGeojson = null; + this.filter = null; + this.originalId = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withExternalCode = function (externalCode) { + this.externalCode = externalCode; + return this; + }; + this.withHeadsign = function (headsign) { + this.headsign = headsign; + return this; + }; + this.withShowCodes = function (showCodes) { + this.showCodes = showCodes; + return this; + }; + this.withOdtLevel = function (odtLevel) { + this.odtLevel = odtLevel; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.withFilter = function (filter) { + this.filter = filter; + return this; + }; + this.withOriginalId = function (originalId) { + this.originalId = originalId; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionDisruptions', [{ + region: this.region, + startPage: this.startPage, + count: this.count, + depth: this.depth, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + externalCode: this.externalCode, + headsign: this.headsign, + showCodes: this.showCodes, + odtLevel: this.odtLevel, + distance: this.distance, + since: this.since, + until: this.until, + disableGeojson: this.disableGeojson, + filter: this.filter, + originalId: this.originalId + }]); + }; + }, + CoverageRegionDisruptionsIdRequestBuilder: function () { + this.CoverageRegionDisruptionsIdRequestBuilder = function() { this.region = null; this.id = null; this.startPage = null; @@ -4467,24 +5275,403 @@ var request_builders = { originalId: this.originalId }]); }; - }, - CoverageRegionGeoStatusRequestBuilder: function () { - this.CoverageRegionGeoStatusRequestBuilder = function() { - this.region = null; + }, + CoverageLonLatGeoStatusRequestBuilder: function () { + this.CoverageLonLatGeoStatusRequestBuilder = function() { + this.lat = null; + this.lon = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatGeoStatus', [{ + lat: this.lat, + lon: this.lon + }]); + }; + }, + CoverageRegionGeoStatusRequestBuilder: function () { + this.CoverageRegionGeoStatusRequestBuilder = function() { + this.region = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionGeoStatus', [{ + region: this.region + }]); + }; + }, + CoverageLonLatIsochronesRequestBuilder: function () { + this.CoverageLonLatIsochronesRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.from = null; + this.to = null; + this.datetime = null; + this.datetimeRepresents = null; + this.maxNbTransfers = null; + this.minNbTransfers = null; + this.firstSectionMode = null; + this.lastSectionMode = null; + this.maxDurationToPt = null; + this.maxWalkingDurationToPt = null; + this.maxBikeDurationToPt = null; + this.maxBssDurationToPt = null; + this.maxCarDurationToPt = null; + this.walkingSpeed = null; + this.bikeSpeed = null; + this.bssSpeed = null; + this.carSpeed = null; + this.forbiddenUris = null; + this.allowedId = null; + this.disruptionActive = null; + this.dataFreshness = null; + this.maxDuration = null; + this.wheelchair = null; + this.travelerType = null; + this.directPath = null; + this.minDuration = null; + this.boundaryDuration = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withFrom = function (from) { + this.from = from; + return this; + }; + this.withTo = function (to) { + this.to = to; + return this; + }; + this.withDatetime = function (datetime) { + this.datetime = datetime; + return this; + }; + this.withDatetimeRepresents = function (datetimeRepresents) { + this.datetimeRepresents = datetimeRepresents; + return this; + }; + this.withMaxNbTransfers = function (maxNbTransfers) { + this.maxNbTransfers = maxNbTransfers; + return this; + }; + this.withMinNbTransfers = function (minNbTransfers) { + this.minNbTransfers = minNbTransfers; + return this; + }; + this.withFirstSectionMode = function (firstSectionMode) { + this.firstSectionMode = firstSectionMode; + return this; + }; + this.withLastSectionMode = function (lastSectionMode) { + this.lastSectionMode = lastSectionMode; + return this; + }; + this.withMaxDurationToPt = function (maxDurationToPt) { + this.maxDurationToPt = maxDurationToPt; + return this; + }; + this.withMaxWalkingDurationToPt = function (maxWalkingDurationToPt) { + this.maxWalkingDurationToPt = maxWalkingDurationToPt; + return this; + }; + this.withMaxBikeDurationToPt = function (maxBikeDurationToPt) { + this.maxBikeDurationToPt = maxBikeDurationToPt; + return this; + }; + this.withMaxBssDurationToPt = function (maxBssDurationToPt) { + this.maxBssDurationToPt = maxBssDurationToPt; + return this; + }; + this.withMaxCarDurationToPt = function (maxCarDurationToPt) { + this.maxCarDurationToPt = maxCarDurationToPt; + return this; + }; + this.withWalkingSpeed = function (walkingSpeed) { + this.walkingSpeed = walkingSpeed; + return this; + }; + this.withBikeSpeed = function (bikeSpeed) { + this.bikeSpeed = bikeSpeed; + return this; + }; + this.withBssSpeed = function (bssSpeed) { + this.bssSpeed = bssSpeed; + return this; + }; + this.withCarSpeed = function (carSpeed) { + this.carSpeed = carSpeed; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withAllowedId = function (allowedId) { + this.allowedId = allowedId; + return this; + }; + this.withDisruptionActive = function (disruptionActive) { + this.disruptionActive = disruptionActive; + return this; + }; + this.withDataFreshness = function (dataFreshness) { + this.dataFreshness = dataFreshness; + return this; + }; + this.withMaxDuration = function (maxDuration) { + this.maxDuration = maxDuration; + return this; + }; + this.withWheelchair = function (wheelchair) { + this.wheelchair = wheelchair; + return this; + }; + this.withTravelerType = function (travelerType) { + this.travelerType = travelerType; + return this; + }; + this.withDirectPath = function (directPath) { + this.directPath = directPath; + return this; + }; + this.withMinDuration = function (minDuration) { + this.minDuration = minDuration; + return this; + }; + this.withBoundaryDuration = function (boundaryDuration) { + this.boundaryDuration = boundaryDuration; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatIsochrones', [{ + lat: this.lat, + lon: this.lon, + from: this.from, + to: this.to, + datetime: this.datetime, + datetimeRepresents: this.datetimeRepresents, + maxNbTransfers: this.maxNbTransfers, + minNbTransfers: this.minNbTransfers, + firstSectionMode: this.firstSectionMode, + lastSectionMode: this.lastSectionMode, + maxDurationToPt: this.maxDurationToPt, + maxWalkingDurationToPt: this.maxWalkingDurationToPt, + maxBikeDurationToPt: this.maxBikeDurationToPt, + maxBssDurationToPt: this.maxBssDurationToPt, + maxCarDurationToPt: this.maxCarDurationToPt, + walkingSpeed: this.walkingSpeed, + bikeSpeed: this.bikeSpeed, + bssSpeed: this.bssSpeed, + carSpeed: this.carSpeed, + forbiddenUris: this.forbiddenUris, + allowedId: this.allowedId, + disruptionActive: this.disruptionActive, + dataFreshness: this.dataFreshness, + maxDuration: this.maxDuration, + wheelchair: this.wheelchair, + travelerType: this.travelerType, + directPath: this.directPath, + minDuration: this.minDuration, + boundaryDuration: this.boundaryDuration + }]); + }; + }, + CoverageRegionIsochronesRequestBuilder: function () { + this.CoverageRegionIsochronesRequestBuilder = function() { + this.region = null; + this.from = null; + this.to = null; + this.datetime = null; + this.datetimeRepresents = null; + this.maxNbTransfers = null; + this.minNbTransfers = null; + this.firstSectionMode = null; + this.lastSectionMode = null; + this.maxDurationToPt = null; + this.maxWalkingDurationToPt = null; + this.maxBikeDurationToPt = null; + this.maxBssDurationToPt = null; + this.maxCarDurationToPt = null; + this.walkingSpeed = null; + this.bikeSpeed = null; + this.bssSpeed = null; + this.carSpeed = null; + this.forbiddenUris = null; + this.allowedId = null; + this.disruptionActive = null; + this.dataFreshness = null; + this.maxDuration = null; + this.wheelchair = null; + this.travelerType = null; + this.directPath = null; + this.minDuration = null; + this.boundaryDuration = null; + }; + this.withRegion = function (region) { + this.region = region; + return this; + }; + this.withFrom = function (from) { + this.from = from; + return this; + }; + this.withTo = function (to) { + this.to = to; + return this; + }; + this.withDatetime = function (datetime) { + this.datetime = datetime; + return this; + }; + this.withDatetimeRepresents = function (datetimeRepresents) { + this.datetimeRepresents = datetimeRepresents; + return this; + }; + this.withMaxNbTransfers = function (maxNbTransfers) { + this.maxNbTransfers = maxNbTransfers; + return this; + }; + this.withMinNbTransfers = function (minNbTransfers) { + this.minNbTransfers = minNbTransfers; + return this; + }; + this.withFirstSectionMode = function (firstSectionMode) { + this.firstSectionMode = firstSectionMode; + return this; + }; + this.withLastSectionMode = function (lastSectionMode) { + this.lastSectionMode = lastSectionMode; + return this; + }; + this.withMaxDurationToPt = function (maxDurationToPt) { + this.maxDurationToPt = maxDurationToPt; + return this; + }; + this.withMaxWalkingDurationToPt = function (maxWalkingDurationToPt) { + this.maxWalkingDurationToPt = maxWalkingDurationToPt; + return this; + }; + this.withMaxBikeDurationToPt = function (maxBikeDurationToPt) { + this.maxBikeDurationToPt = maxBikeDurationToPt; + return this; + }; + this.withMaxBssDurationToPt = function (maxBssDurationToPt) { + this.maxBssDurationToPt = maxBssDurationToPt; + return this; + }; + this.withMaxCarDurationToPt = function (maxCarDurationToPt) { + this.maxCarDurationToPt = maxCarDurationToPt; + return this; + }; + this.withWalkingSpeed = function (walkingSpeed) { + this.walkingSpeed = walkingSpeed; + return this; + }; + this.withBikeSpeed = function (bikeSpeed) { + this.bikeSpeed = bikeSpeed; + return this; + }; + this.withBssSpeed = function (bssSpeed) { + this.bssSpeed = bssSpeed; + return this; + }; + this.withCarSpeed = function (carSpeed) { + this.carSpeed = carSpeed; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withAllowedId = function (allowedId) { + this.allowedId = allowedId; + return this; + }; + this.withDisruptionActive = function (disruptionActive) { + this.disruptionActive = disruptionActive; + return this; + }; + this.withDataFreshness = function (dataFreshness) { + this.dataFreshness = dataFreshness; + return this; + }; + this.withMaxDuration = function (maxDuration) { + this.maxDuration = maxDuration; + return this; + }; + this.withWheelchair = function (wheelchair) { + this.wheelchair = wheelchair; + return this; }; - this.withRegion = function (region) { - this.region = region; + this.withTravelerType = function (travelerType) { + this.travelerType = travelerType; + return this; + }; + this.withDirectPath = function (directPath) { + this.directPath = directPath; + return this; + }; + this.withMinDuration = function (minDuration) { + this.minDuration = minDuration; + return this; + }; + this.withBoundaryDuration = function (boundaryDuration) { + this.boundaryDuration = boundaryDuration; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionGeoStatus', [{ - region: this.region + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionIsochrones', [{ + region: this.region, + from: this.from, + to: this.to, + datetime: this.datetime, + datetimeRepresents: this.datetimeRepresents, + maxNbTransfers: this.maxNbTransfers, + minNbTransfers: this.minNbTransfers, + firstSectionMode: this.firstSectionMode, + lastSectionMode: this.lastSectionMode, + maxDurationToPt: this.maxDurationToPt, + maxWalkingDurationToPt: this.maxWalkingDurationToPt, + maxBikeDurationToPt: this.maxBikeDurationToPt, + maxBssDurationToPt: this.maxBssDurationToPt, + maxCarDurationToPt: this.maxCarDurationToPt, + walkingSpeed: this.walkingSpeed, + bikeSpeed: this.bikeSpeed, + bssSpeed: this.bssSpeed, + carSpeed: this.carSpeed, + forbiddenUris: this.forbiddenUris, + allowedId: this.allowedId, + disruptionActive: this.disruptionActive, + dataFreshness: this.dataFreshness, + maxDuration: this.maxDuration, + wheelchair: this.wheelchair, + travelerType: this.travelerType, + directPath: this.directPath, + minDuration: this.minDuration, + boundaryDuration: this.boundaryDuration }]); }; }, - CoverageRegionIsochronesRequestBuilder: function () { - this.CoverageRegionIsochronesRequestBuilder = function() { - this.region = null; + CoverageLonLatHeatMapsRequestBuilder: function () { + this.CoverageLonLatHeatMapsRequestBuilder = function() { + this.lat = null; + this.lon = null; this.from = null; this.to = null; this.datetime = null; @@ -4510,11 +5697,14 @@ var request_builders = { this.wheelchair = null; this.travelerType = null; this.directPath = null; - this.minDuration = null; - this.boundaryDuration = null; + this.resolution = null; }; - this.withRegion = function (region) { - this.region = region; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; return this; }; this.withFrom = function (from) { @@ -4617,17 +5807,14 @@ var request_builders = { this.directPath = directPath; return this; }; - this.withMinDuration = function (minDuration) { - this.minDuration = minDuration; - return this; - }; - this.withBoundaryDuration = function (boundaryDuration) { - this.boundaryDuration = boundaryDuration; + this.withResolution = function (resolution) { + this.resolution = resolution; return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionIsochrones', [{ - region: this.region, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatHeatMaps', [{ + lat: this.lat, + lon: this.lon, from: this.from, to: this.to, datetime: this.datetime, @@ -4653,8 +5840,7 @@ var request_builders = { wheelchair: this.wheelchair, travelerType: this.travelerType, directPath: this.directPath, - minDuration: this.minDuration, - boundaryDuration: this.boundaryDuration + resolution: this.resolution }]); }; }, @@ -7930,8 +9116,184 @@ var request_builders = { this.odtLevel = odtLevel; return this; }; - this.withDistance = function (distance) { - this.distance = distance; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.withOriginalId = function (originalId) { + this.originalId = originalId; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriLineGroupsId', [{ + region: this.region, + uri: this.uri, + id: this.id, + startPage: this.startPage, + count: this.count, + depth: this.depth, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + externalCode: this.externalCode, + headsign: this.headsign, + showCodes: this.showCodes, + odtLevel: this.odtLevel, + distance: this.distance, + since: this.since, + until: this.until, + disableGeojson: this.disableGeojson, + originalId: this.originalId + }]); + }; + }, + LineGroupsRequestBuilder: function () { + this.LineGroupsRequestBuilder = function() { + this.externalCode = null; + this.startPage = null; + this.count = null; + this.depth = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.headsign = null; + this.showCodes = null; + this.odtLevel = null; + this.distance = null; + this.since = null; + this.until = null; + this.disableGeojson = null; + this.filter = null; + this.originalId = null; + }; + this.withExternalCode = function (externalCode) { + this.externalCode = externalCode; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withHeadsign = function (headsign) { + this.headsign = headsign; + return this; + }; + this.withShowCodes = function (showCodes) { + this.showCodes = showCodes; + return this; + }; + this.withOdtLevel = function (odtLevel) { + this.odtLevel = odtLevel; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.withFilter = function (filter) { + this.filter = filter; + return this; + }; + this.withOriginalId = function (originalId) { + this.originalId = originalId; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'lineGroups', [{ + externalCode: this.externalCode, + startPage: this.startPage, + count: this.count, + depth: this.depth, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + headsign: this.headsign, + showCodes: this.showCodes, + odtLevel: this.odtLevel, + distance: this.distance, + since: this.since, + until: this.until, + disableGeojson: this.disableGeojson, + filter: this.filter, + originalId: this.originalId + }]); + }; + }, + CoverageLonLatLineReportsRequestBuilder: function () { + this.CoverageLonLatLineReportsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.depth = null; + this.count = null; + this.startPage = null; + this.forbiddenUris = null; + this.disableGeojson = null; + this.since = null; + this.until = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; return this; }; this.withSince = function (since) { @@ -7942,92 +9304,63 @@ var request_builders = { this.until = until; return this; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; - return this; - }; - this.withOriginalId = function (originalId) { - this.originalId = originalId; - return this; - }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriLineGroupsId', [{ - region: this.region, - uri: this.uri, - id: this.id, - startPage: this.startPage, - count: this.count, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatLineReports', [{ + lat: this.lat, + lon: this.lon, depth: this.depth, - forbiddenId: this.forbiddenId, + count: this.count, + startPage: this.startPage, forbiddenUris: this.forbiddenUris, - externalCode: this.externalCode, - headsign: this.headsign, - showCodes: this.showCodes, - odtLevel: this.odtLevel, - distance: this.distance, - since: this.since, - until: this.until, disableGeojson: this.disableGeojson, - originalId: this.originalId + since: this.since, + until: this.until }]); }; }, - LineGroupsRequestBuilder: function () { - this.LineGroupsRequestBuilder = function() { - this.externalCode = null; - this.startPage = null; - this.count = null; + CoverageLonLatUriLineReportsRequestBuilder: function () { + this.CoverageLonLatUriLineReportsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; this.depth = null; - this.forbiddenId = null; + this.count = null; + this.startPage = null; this.forbiddenUris = null; - this.headsign = null; - this.showCodes = null; - this.odtLevel = null; - this.distance = null; + this.disableGeojson = null; this.since = null; this.until = null; - this.disableGeojson = null; - this.filter = null; - this.originalId = null; }; - this.withExternalCode = function (externalCode) { - this.externalCode = externalCode; + this.withLat = function (lat) { + this.lat = lat; return this; }; - this.withStartPage = function (startPage) { - this.startPage = startPage; + this.withLon = function (lon) { + this.lon = lon; return this; }; - this.withCount = function (count) { - this.count = count; + this.withUri = function (uri) { + this.uri = uri; return this; }; this.withDepth = function (depth) { this.depth = depth; return this; }; - this.withForbiddenId = function (forbiddenId) { - this.forbiddenId = forbiddenId; - return this; - }; - this.withForbiddenUris = function (forbiddenUris) { - this.forbiddenUris = forbiddenUris; - return this; - }; - this.withHeadsign = function (headsign) { - this.headsign = headsign; + this.withCount = function (count) { + this.count = count; return this; }; - this.withShowCodes = function (showCodes) { - this.showCodes = showCodes; + this.withStartPage = function (startPage) { + this.startPage = startPage; return this; }; - this.withOdtLevel = function (odtLevel) { - this.odtLevel = odtLevel; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; return this; }; - this.withDistance = function (distance) { - this.distance = distance; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; return this; }; this.withSince = function (since) { @@ -8038,35 +9371,18 @@ var request_builders = { this.until = until; return this; }; - this.withDisableGeojson = function (disableGeojson) { - this.disableGeojson = disableGeojson; - return this; - }; - this.withFilter = function (filter) { - this.filter = filter; - return this; - }; - this.withOriginalId = function (originalId) { - this.originalId = originalId; - return this; - }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'lineGroups', [{ - externalCode: this.externalCode, - startPage: this.startPage, - count: this.count, + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriLineReports', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, depth: this.depth, - forbiddenId: this.forbiddenId, + count: this.count, + startPage: this.startPage, forbiddenUris: this.forbiddenUris, - headsign: this.headsign, - showCodes: this.showCodes, - odtLevel: this.odtLevel, - distance: this.distance, - since: this.since, - until: this.until, disableGeojson: this.disableGeojson, - filter: this.filter, - originalId: this.originalId + since: this.since, + until: this.until }]); }; }, @@ -8078,6 +9394,8 @@ var request_builders = { this.startPage = null; this.forbiddenUris = null; this.disableGeojson = null; + this.since = null; + this.until = null; }; this.withRegion = function (region) { this.region = region; @@ -8103,6 +9421,14 @@ var request_builders = { this.disableGeojson = disableGeojson; return this; }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; this.get = function (successCallback, errorCallback) { exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionLineReports', [{ region: this.region, @@ -8110,7 +9436,9 @@ var request_builders = { count: this.count, startPage: this.startPage, forbiddenUris: this.forbiddenUris, - disableGeojson: this.disableGeojson + disableGeojson: this.disableGeojson, + since: this.since, + until: this.until }]); }; }, @@ -8123,6 +9451,8 @@ var request_builders = { this.startPage = null; this.forbiddenUris = null; this.disableGeojson = null; + this.since = null; + this.until = null; }; this.withRegion = function (region) { this.region = region; @@ -8152,6 +9482,14 @@ var request_builders = { this.disableGeojson = disableGeojson; return this; }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; this.get = function (successCallback, errorCallback) { exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriLineReports', [{ region: this.region, @@ -8160,7 +9498,9 @@ var request_builders = { count: this.count, startPage: this.startPage, forbiddenUris: this.forbiddenUris, - disableGeojson: this.disableGeojson + disableGeojson: this.disableGeojson, + since: this.since, + until: this.until }]); }; }, @@ -11811,48 +13151,174 @@ var request_builders = { this.startPage = startPage; return this; }; - this.withCount = function (count) { - this.count = count; - return this; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withExternalCode = function (externalCode) { + this.externalCode = externalCode; + return this; + }; + this.withHeadsign = function (headsign) { + this.headsign = headsign; + return this; + }; + this.withShowCodes = function (showCodes) { + this.showCodes = showCodes; + return this; + }; + this.withOdtLevel = function (odtLevel) { + this.odtLevel = odtLevel; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withSince = function (since) { + this.since = since; + return this; + }; + this.withUntil = function (until) { + this.until = until; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriPhysicalModesId', [{ + region: this.region, + uri: this.uri, + id: this.id, + startPage: this.startPage, + count: this.count, + depth: this.depth, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + externalCode: this.externalCode, + headsign: this.headsign, + showCodes: this.showCodes, + odtLevel: this.odtLevel, + distance: this.distance, + since: this.since, + until: this.until, + disableGeojson: this.disableGeojson + }]); + }; + }, + CoverageLonLatPlacesIdRequestBuilder: function () { + this.CoverageLonLatPlacesIdRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.id = null; + this.bssStands = null; + this.addPoiInfos = null; + this.disableGeojson = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withId = function (id) { + this.id = id; + return this; + }; + this.withBssStands = function (bssStands) { + this.bssStands = bssStands; + return this; + }; + this.withAddPoiInfos = function (addPoiInfos) { + this.addPoiInfos = addPoiInfos; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatPlacesId', [{ + lat: this.lat, + lon: this.lon, + id: this.id, + bssStands: this.bssStands, + addPoiInfos: this.addPoiInfos, + disableGeojson: this.disableGeojson + }]); + }; + }, + CoverageRegionPlacesIdRequestBuilder: function () { + this.CoverageRegionPlacesIdRequestBuilder = function() { + this.region = null; + this.id = null; + this.bssStands = null; + this.addPoiInfos = null; + this.disableGeojson = null; }; - this.withDepth = function (depth) { - this.depth = depth; + this.withRegion = function (region) { + this.region = region; return this; }; - this.withForbiddenId = function (forbiddenId) { - this.forbiddenId = forbiddenId; + this.withId = function (id) { + this.id = id; return this; }; - this.withForbiddenUris = function (forbiddenUris) { - this.forbiddenUris = forbiddenUris; + this.withBssStands = function (bssStands) { + this.bssStands = bssStands; return this; }; - this.withExternalCode = function (externalCode) { - this.externalCode = externalCode; + this.withAddPoiInfos = function (addPoiInfos) { + this.addPoiInfos = addPoiInfos; return this; }; - this.withHeadsign = function (headsign) { - this.headsign = headsign; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; return this; }; - this.withShowCodes = function (showCodes) { - this.showCodes = showCodes; - return this; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionPlacesId', [{ + region: this.region, + id: this.id, + bssStands: this.bssStands, + addPoiInfos: this.addPoiInfos, + disableGeojson: this.disableGeojson + }]); }; - this.withOdtLevel = function (odtLevel) { - this.odtLevel = odtLevel; - return this; + }, + PlacesIdRequestBuilder: function () { + this.PlacesIdRequestBuilder = function() { + this.id = null; + this.bssStands = null; + this.addPoiInfos = null; + this.disableGeojson = null; }; - this.withDistance = function (distance) { - this.distance = distance; + this.withId = function (id) { + this.id = id; return this; }; - this.withSince = function (since) { - this.since = since; + this.withBssStands = function (bssStands) { + this.bssStands = bssStands; return this; }; - this.withUntil = function (until) { - this.until = until; + this.withAddPoiInfos = function (addPoiInfos) { + this.addPoiInfos = addPoiInfos; return this; }; this.withDisableGeojson = function (disableGeojson) { @@ -11860,22 +13326,10 @@ var request_builders = { return this; }; this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionUriPhysicalModesId', [{ - region: this.region, - uri: this.uri, + exec(successCallback, errorCallback, 'NavitiaSDK', 'placesId', [{ id: this.id, - startPage: this.startPage, - count: this.count, - depth: this.depth, - forbiddenId: this.forbiddenId, - forbiddenUris: this.forbiddenUris, - externalCode: this.externalCode, - headsign: this.headsign, - showCodes: this.showCodes, - odtLevel: this.odtLevel, - distance: this.distance, - since: this.since, - until: this.until, + bssStands: this.bssStands, + addPoiInfos: this.addPoiInfos, disableGeojson: this.disableGeojson }]); }; @@ -15744,20 +17198,6 @@ var request_builders = { }]); }; }, - CoverageRegionStatusRequestBuilder: function () { - this.CoverageRegionStatusRequestBuilder = function() { - this.region = null; - }; - this.withRegion = function (region) { - this.region = region; - return this; - }; - this.get = function (successCallback, errorCallback) { - exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageRegionStatus', [{ - region: this.region - }]); - }; - }, CoverageLonLatStopAreasRequestBuilder: function () { this.CoverageLonLatStopAreasRequestBuilder = function() { this.lat = null; @@ -18056,6 +19496,136 @@ var request_builders = { }]); }; }, + CoverageLonLatTrafficReportsRequestBuilder: function () { + this.CoverageLonLatTrafficReportsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.depth = null; + this.count = null; + this.startPage = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.distance = null; + this.disableGeojson = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatTrafficReports', [{ + lat: this.lat, + lon: this.lon, + depth: this.depth, + count: this.count, + startPage: this.startPage, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + distance: this.distance, + disableGeojson: this.disableGeojson + }]); + }; + }, + CoverageLonLatUriTrafficReportsRequestBuilder: function () { + this.CoverageLonLatUriTrafficReportsRequestBuilder = function() { + this.lat = null; + this.lon = null; + this.uri = null; + this.depth = null; + this.count = null; + this.startPage = null; + this.forbiddenId = null; + this.forbiddenUris = null; + this.distance = null; + this.disableGeojson = null; + }; + this.withLat = function (lat) { + this.lat = lat; + return this; + }; + this.withLon = function (lon) { + this.lon = lon; + return this; + }; + this.withUri = function (uri) { + this.uri = uri; + return this; + }; + this.withDepth = function (depth) { + this.depth = depth; + return this; + }; + this.withCount = function (count) { + this.count = count; + return this; + }; + this.withStartPage = function (startPage) { + this.startPage = startPage; + return this; + }; + this.withForbiddenId = function (forbiddenId) { + this.forbiddenId = forbiddenId; + return this; + }; + this.withForbiddenUris = function (forbiddenUris) { + this.forbiddenUris = forbiddenUris; + return this; + }; + this.withDistance = function (distance) { + this.distance = distance; + return this; + }; + this.withDisableGeojson = function (disableGeojson) { + this.disableGeojson = disableGeojson; + return this; + }; + this.get = function (successCallback, errorCallback) { + exec(successCallback, errorCallback, 'NavitiaSDK', 'coverageLonLatUriTrafficReports', [{ + lat: this.lat, + lon: this.lon, + uri: this.uri, + depth: this.depth, + count: this.count, + startPage: this.startPage, + forbiddenId: this.forbiddenId, + forbiddenUris: this.forbiddenUris, + distance: this.distance, + disableGeojson: this.disableGeojson + }]); + }; + }, CoverageRegionTrafficReportsRequestBuilder: function () { this.CoverageRegionTrafficReportsRequestBuilder = function() { this.region = null; @@ -19933,7 +21503,42 @@ var request_builders = { }; var apis = { + addresses: { + coverageLonLatAddressesRequestBuilder: function () { + return new request_builders.CoverageLonLatAddressesRequestBuilder(); + }, + coverageLonLatAddressesIdRequestBuilder: function () { + return new request_builders.CoverageLonLatAddressesIdRequestBuilder(); + }, + coverageLonLatUriAddressesRequestBuilder: function () { + return new request_builders.CoverageLonLatUriAddressesRequestBuilder(); + }, + coverageLonLatUriAddressesIdRequestBuilder: function () { + return new request_builders.CoverageLonLatUriAddressesIdRequestBuilder(); + }, + coverageRegionAddressesRequestBuilder: function () { + return new request_builders.CoverageRegionAddressesRequestBuilder(); + }, + coverageRegionAddressesIdRequestBuilder: function () { + return new request_builders.CoverageRegionAddressesIdRequestBuilder(); + }, + coverageRegionUriAddressesRequestBuilder: function () { + return new request_builders.CoverageRegionUriAddressesRequestBuilder(); + }, + coverageRegionUriAddressesIdRequestBuilder: function () { + return new request_builders.CoverageRegionUriAddressesIdRequestBuilder(); + } + }, calendars: { + coverageLonLatCalendarsRequestBuilder: function () { + return new request_builders.CoverageLonLatCalendarsRequestBuilder(); + }, + coverageLonLatCalendarsIdRequestBuilder: function () { + return new request_builders.CoverageLonLatCalendarsIdRequestBuilder(); + }, + coverageLonLatUriCalendarsRequestBuilder: function () { + return new request_builders.CoverageLonLatUriCalendarsRequestBuilder(); + }, coverageRegionCalendarsRequestBuilder: function () { return new request_builders.CoverageRegionCalendarsRequestBuilder(); }, @@ -20022,6 +21627,64 @@ var apis = { return new request_builders.CoverageRegionUriContributorsIdRequestBuilder(); } }, + coord: { + coordLonLatRequestBuilder: function () { + return new request_builders.CoordLonLatRequestBuilder(); + }, + coordsLonLatRequestBuilder: function () { + return new request_builders.CoordsLonLatRequestBuilder(); + } + }, + coords: { + coverageLonLatCoordRequestBuilder: function () { + return new request_builders.CoverageLonLatCoordRequestBuilder(); + }, + coverageLonLatCoordIdRequestBuilder: function () { + return new request_builders.CoverageLonLatCoordIdRequestBuilder(); + }, + coverageLonLatCoordsRequestBuilder: function () { + return new request_builders.CoverageLonLatCoordsRequestBuilder(); + }, + coverageLonLatCoordsIdRequestBuilder: function () { + return new request_builders.CoverageLonLatCoordsIdRequestBuilder(); + }, + coverageLonLatUriCoordRequestBuilder: function () { + return new request_builders.CoverageLonLatUriCoordRequestBuilder(); + }, + coverageLonLatUriCoordIdRequestBuilder: function () { + return new request_builders.CoverageLonLatUriCoordIdRequestBuilder(); + }, + coverageLonLatUriCoordsRequestBuilder: function () { + return new request_builders.CoverageLonLatUriCoordsRequestBuilder(); + }, + coverageLonLatUriCoordsIdRequestBuilder: function () { + return new request_builders.CoverageLonLatUriCoordsIdRequestBuilder(); + }, + coverageRegionCoordRequestBuilder: function () { + return new request_builders.CoverageRegionCoordRequestBuilder(); + }, + coverageRegionCoordIdRequestBuilder: function () { + return new request_builders.CoverageRegionCoordIdRequestBuilder(); + }, + coverageRegionCoordsRequestBuilder: function () { + return new request_builders.CoverageRegionCoordsRequestBuilder(); + }, + coverageRegionCoordsIdRequestBuilder: function () { + return new request_builders.CoverageRegionCoordsIdRequestBuilder(); + }, + coverageRegionUriCoordRequestBuilder: function () { + return new request_builders.CoverageRegionUriCoordRequestBuilder(); + }, + coverageRegionUriCoordIdRequestBuilder: function () { + return new request_builders.CoverageRegionUriCoordIdRequestBuilder(); + }, + coverageRegionUriCoordsRequestBuilder: function () { + return new request_builders.CoverageRegionUriCoordsRequestBuilder(); + }, + coverageRegionUriCoordsIdRequestBuilder: function () { + return new request_builders.CoverageRegionUriCoordsIdRequestBuilder(); + } + }, coverage: { coverageRequestBuilder: function () { return new request_builders.CoverageRequestBuilder(); @@ -20086,16 +21749,25 @@ var apis = { } }, geoStatus: { + coverageLonLatGeoStatusRequestBuilder: function () { + return new request_builders.CoverageLonLatGeoStatusRequestBuilder(); + }, coverageRegionGeoStatusRequestBuilder: function () { return new request_builders.CoverageRegionGeoStatusRequestBuilder(); } }, graphicalIsochrone: { + coverageLonLatIsochronesRequestBuilder: function () { + return new request_builders.CoverageLonLatIsochronesRequestBuilder(); + }, coverageRegionIsochronesRequestBuilder: function () { return new request_builders.CoverageRegionIsochronesRequestBuilder(); } }, heatMap: { + coverageLonLatHeatMapsRequestBuilder: function () { + return new request_builders.CoverageLonLatHeatMapsRequestBuilder(); + }, coverageRegionHeatMapsRequestBuilder: function () { return new request_builders.CoverageRegionHeatMapsRequestBuilder(); } @@ -20193,6 +21865,12 @@ var apis = { } }, lineReports: { + coverageLonLatLineReportsRequestBuilder: function () { + return new request_builders.CoverageLonLatLineReportsRequestBuilder(); + }, + coverageLonLatUriLineReportsRequestBuilder: function () { + return new request_builders.CoverageLonLatUriLineReportsRequestBuilder(); + }, coverageRegionLineReportsRequestBuilder: function () { return new request_builders.CoverageRegionLineReportsRequestBuilder(); }, @@ -20312,6 +21990,17 @@ var apis = { return new request_builders.CoverageRegionUriPhysicalModesIdRequestBuilder(); } }, + placeUri: { + coverageLonLatPlacesIdRequestBuilder: function () { + return new request_builders.CoverageLonLatPlacesIdRequestBuilder(); + }, + coverageRegionPlacesIdRequestBuilder: function () { + return new request_builders.CoverageRegionPlacesIdRequestBuilder(); + }, + placesIdRequestBuilder: function () { + return new request_builders.PlacesIdRequestBuilder(); + } + }, places: { coverageLonLatPlacesRequestBuilder: function () { return new request_builders.CoverageLonLatPlacesRequestBuilder(); @@ -20443,11 +22132,6 @@ var apis = { return new request_builders.RoutesRequestBuilder(); } }, - status: { - coverageRegionStatusRequestBuilder: function () { - return new request_builders.CoverageRegionStatusRequestBuilder(); - } - }, stopAreas: { coverageLonLatStopAreasRequestBuilder: function () { return new request_builders.CoverageLonLatStopAreasRequestBuilder(); @@ -20518,6 +22202,12 @@ var apis = { } }, trafficReport: { + coverageLonLatTrafficReportsRequestBuilder: function () { + return new request_builders.CoverageLonLatTrafficReportsRequestBuilder(); + }, + coverageLonLatUriTrafficReportsRequestBuilder: function () { + return new request_builders.CoverageLonLatUriTrafficReportsRequestBuilder(); + }, coverageRegionTrafficReportsRequestBuilder: function () { return new request_builders.CoverageRegionTrafficReportsRequestBuilder(); }, @@ -20592,10 +22282,13 @@ module.exports = { [token] ); }, + addresses: apis.addresses, calendars: apis.calendars, commercialModes: apis.commercialModes, companies: apis.companies, contributors: apis.contributors, + coord: apis.coord, + coords: apis.coords, coverage: apis.coverage, datasets: apis.datasets, disruptions: apis.disruptions, @@ -20612,6 +22305,7 @@ module.exports = { nextArrivals: apis.nextArrivals, nextDepartures: apis.nextDepartures, physicalModes: apis.physicalModes, + placeUri: apis.placeUri, places: apis.places, placesNearby: apis.placesNearby, poiTypes: apis.poiTypes, @@ -20619,7 +22313,6 @@ module.exports = { ptobjects: apis.ptobjects, routeSchedules: apis.routeSchedules, routes: apis.routes, - status: apis.status, stopAreas: apis.stopAreas, stopPoints: apis.stopPoints, stopSchedules: apis.stopSchedules,