@aws-amplify/geo 1.2.4 → 1.2.5-geo.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aws-amplify-geo.js +2145 -136
- package/dist/aws-amplify-geo.js.map +1 -1
- package/dist/aws-amplify-geo.min.js +6 -6
- package/dist/aws-amplify-geo.min.js.map +1 -1
- package/lib/Geo.d.ts +37 -4
- package/lib/Geo.js +153 -5
- package/lib/Geo.js.map +1 -1
- package/lib/Providers/AmazonLocationServiceProvider.d.ts +37 -1
- package/lib/Providers/AmazonLocationServiceProvider.js +417 -8
- package/lib/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib/types/AmazonLocationServiceProvider.d.ts +21 -1
- package/lib/types/Geo.d.ts +48 -1
- package/lib/types/Provider.d.ts +5 -1
- package/lib/types/Provider.js +0 -12
- package/lib/types/Provider.js.map +1 -1
- package/lib/util.d.ts +6 -0
- package/lib/util.js +142 -0
- package/lib/util.js.map +1 -0
- package/lib-esm/Geo.d.ts +37 -4
- package/lib-esm/Geo.js +153 -5
- package/lib-esm/Geo.js.map +1 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.d.ts +37 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +418 -9
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib-esm/types/AmazonLocationServiceProvider.d.ts +21 -1
- package/lib-esm/types/Geo.d.ts +48 -1
- package/lib-esm/types/Provider.d.ts +5 -1
- package/lib-esm/types/Provider.js +0 -12
- package/lib-esm/types/Provider.js.map +1 -1
- package/lib-esm/util.d.ts +6 -0
- package/lib-esm/util.js +132 -0
- package/lib-esm/util.js.map +1 -0
- package/package.json +6 -4
- package/src/Geo.ts +122 -3
- package/src/Providers/AmazonLocationServiceProvider.ts +423 -6
- package/src/types/AmazonLocationServiceProvider.ts +56 -1
- package/src/types/Geo.ts +72 -2
- package/src/types/Provider.ts +31 -1
- package/src/util.ts +171 -0
package/lib/Geo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeoConfig, Coordinates, SearchByTextOptions,
|
|
1
|
+
import { Place, GeoConfig, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, MapStyle, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults } from './types';
|
|
2
2
|
export declare class GeoClass {
|
|
3
3
|
static MODULE: string;
|
|
4
4
|
/**
|
|
@@ -51,20 +51,53 @@ export declare class GeoClass {
|
|
|
51
51
|
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
52
52
|
* @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
|
|
53
53
|
*/
|
|
54
|
-
searchByText(text: string, options?: SearchByTextOptions): Promise<
|
|
54
|
+
searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
|
|
55
55
|
/**
|
|
56
56
|
* Search for search term suggestions based on input text
|
|
57
57
|
* @param {string} text - The text string that is to be search for
|
|
58
58
|
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
59
59
|
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
60
60
|
*/
|
|
61
|
-
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<SearchForSuggestionsResults>;
|
|
61
|
+
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<import("./types").SearchForSuggestionsResults>;
|
|
62
62
|
/**
|
|
63
63
|
* Reverse geocoding search via a coordinate point on the map
|
|
64
64
|
* @param coordinates - Coordinates array for the search input
|
|
65
65
|
* @param options - Options parameters for the search
|
|
66
66
|
* @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
|
|
67
67
|
*/
|
|
68
|
-
searchByCoordinates(coordinates: Coordinates, options?: SearchByCoordinatesOptions): Promise<
|
|
68
|
+
searchByCoordinates(coordinates: Coordinates, options?: SearchByCoordinatesOptions): Promise<Place>;
|
|
69
|
+
/**
|
|
70
|
+
* Create geofences
|
|
71
|
+
* @param geofences - Single or array of geofence objects to create
|
|
72
|
+
* @param options? - Optional parameters for creating geofences
|
|
73
|
+
* @returns {Promise<SaveGeofencesResults>} - Promise that resolves to an object with:
|
|
74
|
+
* successes: list of geofences successfully created
|
|
75
|
+
* errors: list of geofences that failed to create
|
|
76
|
+
*/
|
|
77
|
+
saveGeofences(geofences: GeofenceInput | GeofenceInput[], options?: GeofenceOptions): Promise<SaveGeofencesResults>;
|
|
78
|
+
/**
|
|
79
|
+
* Get a single geofence by geofenceId
|
|
80
|
+
* @param geofenceId: string
|
|
81
|
+
* @param options?: GeofenceOptions
|
|
82
|
+
* @returns Promise<Geofence> - Promise that resolves to a geofence object
|
|
83
|
+
*/
|
|
84
|
+
getGeofence(geofenceId: string, options?: GeofenceOptions): Promise<Geofence>;
|
|
85
|
+
/**
|
|
86
|
+
* List geofences
|
|
87
|
+
* @param options?: ListGeofenceOptions
|
|
88
|
+
* @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:
|
|
89
|
+
* entries: list of geofences - 100 geofences are listed per page
|
|
90
|
+
* nextToken: token for next page of geofences
|
|
91
|
+
*/
|
|
92
|
+
listGeofences(options?: ListGeofenceOptions): Promise<ListGeofenceResults>;
|
|
93
|
+
/**
|
|
94
|
+
* Delete geofences
|
|
95
|
+
* @param geofenceIds: string|string[]
|
|
96
|
+
* @param options?: GeofenceOptions
|
|
97
|
+
* @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:
|
|
98
|
+
* successes: list of geofences successfully deleted
|
|
99
|
+
* errors: list of geofences that failed to delete
|
|
100
|
+
*/
|
|
101
|
+
deleteGeofences(geofenceIds: string | string[], options?: GeofenceOptions): Promise<DeleteGeofencesResults>;
|
|
69
102
|
}
|
|
70
103
|
export declare const Geo: GeoClass;
|
package/lib/Geo.js
CHANGED
|
@@ -35,6 +35,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
38
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
55
|
/*
|
|
40
56
|
* Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -50,6 +66,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
50
66
|
*/
|
|
51
67
|
var core_1 = require("@aws-amplify/core");
|
|
52
68
|
var AmazonLocationServiceProvider_1 = require("./Providers/AmazonLocationServiceProvider");
|
|
69
|
+
var util_1 = require("./util");
|
|
53
70
|
var logger = new core_1.ConsoleLogger('Geo');
|
|
54
71
|
var DEFAULT_PROVIDER = 'AmazonLocationService';
|
|
55
72
|
var GeoClass = /** @class */ (function () {
|
|
@@ -201,21 +218,152 @@ var GeoClass = /** @class */ (function () {
|
|
|
201
218
|
*/
|
|
202
219
|
GeoClass.prototype.searchByCoordinates = function (coordinates, options) {
|
|
203
220
|
return __awaiter(this, void 0, void 0, function () {
|
|
204
|
-
var _a, providerName, prov, error_3;
|
|
221
|
+
var _a, providerName, prov, _b, lng, lat, error_3;
|
|
222
|
+
return __generator(this, function (_c) {
|
|
223
|
+
switch (_c.label) {
|
|
224
|
+
case 0:
|
|
225
|
+
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
226
|
+
prov = this.getPluggable(providerName);
|
|
227
|
+
_b = __read(coordinates, 2), lng = _b[0], lat = _b[1];
|
|
228
|
+
_c.label = 1;
|
|
229
|
+
case 1:
|
|
230
|
+
_c.trys.push([1, 3, , 4]);
|
|
231
|
+
util_1.validateCoordinates(lng, lat);
|
|
232
|
+
return [4 /*yield*/, prov.searchByCoordinates(coordinates, options)];
|
|
233
|
+
case 2: return [2 /*return*/, _c.sent()];
|
|
234
|
+
case 3:
|
|
235
|
+
error_3 = _c.sent();
|
|
236
|
+
logger.debug(error_3);
|
|
237
|
+
throw error_3;
|
|
238
|
+
case 4: return [2 /*return*/];
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Create geofences
|
|
245
|
+
* @param geofences - Single or array of geofence objects to create
|
|
246
|
+
* @param options? - Optional parameters for creating geofences
|
|
247
|
+
* @returns {Promise<SaveGeofencesResults>} - Promise that resolves to an object with:
|
|
248
|
+
* successes: list of geofences successfully created
|
|
249
|
+
* errors: list of geofences that failed to create
|
|
250
|
+
*/
|
|
251
|
+
GeoClass.prototype.saveGeofences = function (geofences, options) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
253
|
+
var _a, providerName, prov, geofenceInputArray, error_4;
|
|
205
254
|
return __generator(this, function (_b) {
|
|
206
255
|
switch (_b.label) {
|
|
207
256
|
case 0:
|
|
208
257
|
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
209
258
|
prov = this.getPluggable(providerName);
|
|
259
|
+
if (!Array.isArray(geofences)) {
|
|
260
|
+
geofenceInputArray = [geofences];
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
geofenceInputArray = geofences;
|
|
264
|
+
}
|
|
210
265
|
_b.label = 1;
|
|
211
266
|
case 1:
|
|
212
267
|
_b.trys.push([1, 3, , 4]);
|
|
213
|
-
return [4 /*yield*/, prov.
|
|
268
|
+
return [4 /*yield*/, prov.saveGeofences(geofenceInputArray, options)];
|
|
214
269
|
case 2: return [2 /*return*/, _b.sent()];
|
|
215
270
|
case 3:
|
|
216
|
-
|
|
217
|
-
logger.debug(
|
|
218
|
-
throw
|
|
271
|
+
error_4 = _b.sent();
|
|
272
|
+
logger.debug(error_4);
|
|
273
|
+
throw error_4;
|
|
274
|
+
case 4: return [2 /*return*/];
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Get a single geofence by geofenceId
|
|
281
|
+
* @param geofenceId: string
|
|
282
|
+
* @param options?: GeofenceOptions
|
|
283
|
+
* @returns Promise<Geofence> - Promise that resolves to a geofence object
|
|
284
|
+
*/
|
|
285
|
+
GeoClass.prototype.getGeofence = function (geofenceId, options) {
|
|
286
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
287
|
+
var _a, providerName, prov, error_5;
|
|
288
|
+
return __generator(this, function (_b) {
|
|
289
|
+
switch (_b.label) {
|
|
290
|
+
case 0:
|
|
291
|
+
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
292
|
+
prov = this.getPluggable(providerName);
|
|
293
|
+
_b.label = 1;
|
|
294
|
+
case 1:
|
|
295
|
+
_b.trys.push([1, 3, , 4]);
|
|
296
|
+
return [4 /*yield*/, prov.getGeofence(geofenceId, options)];
|
|
297
|
+
case 2: return [2 /*return*/, _b.sent()];
|
|
298
|
+
case 3:
|
|
299
|
+
error_5 = _b.sent();
|
|
300
|
+
logger.debug(error_5);
|
|
301
|
+
throw error_5;
|
|
302
|
+
case 4: return [2 /*return*/];
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* List geofences
|
|
309
|
+
* @param options?: ListGeofenceOptions
|
|
310
|
+
* @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:
|
|
311
|
+
* entries: list of geofences - 100 geofences are listed per page
|
|
312
|
+
* nextToken: token for next page of geofences
|
|
313
|
+
*/
|
|
314
|
+
GeoClass.prototype.listGeofences = function (options) {
|
|
315
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
316
|
+
var _a, providerName, prov, error_6;
|
|
317
|
+
return __generator(this, function (_b) {
|
|
318
|
+
switch (_b.label) {
|
|
319
|
+
case 0:
|
|
320
|
+
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
321
|
+
prov = this.getPluggable(providerName);
|
|
322
|
+
_b.label = 1;
|
|
323
|
+
case 1:
|
|
324
|
+
_b.trys.push([1, 3, , 4]);
|
|
325
|
+
return [4 /*yield*/, prov.listGeofences(options)];
|
|
326
|
+
case 2: return [2 /*return*/, _b.sent()];
|
|
327
|
+
case 3:
|
|
328
|
+
error_6 = _b.sent();
|
|
329
|
+
logger.debug(error_6);
|
|
330
|
+
throw error_6;
|
|
331
|
+
case 4: return [2 /*return*/];
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Delete geofences
|
|
338
|
+
* @param geofenceIds: string|string[]
|
|
339
|
+
* @param options?: GeofenceOptions
|
|
340
|
+
* @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:
|
|
341
|
+
* successes: list of geofences successfully deleted
|
|
342
|
+
* errors: list of geofences that failed to delete
|
|
343
|
+
*/
|
|
344
|
+
GeoClass.prototype.deleteGeofences = function (geofenceIds, options) {
|
|
345
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
346
|
+
var _a, providerName, prov, geofenceIdsInputArray, error_7;
|
|
347
|
+
return __generator(this, function (_b) {
|
|
348
|
+
switch (_b.label) {
|
|
349
|
+
case 0:
|
|
350
|
+
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
351
|
+
prov = this.getPluggable(providerName);
|
|
352
|
+
if (!Array.isArray(geofenceIds)) {
|
|
353
|
+
geofenceIdsInputArray = [geofenceIds];
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
geofenceIdsInputArray = geofenceIds;
|
|
357
|
+
}
|
|
358
|
+
_b.label = 1;
|
|
359
|
+
case 1:
|
|
360
|
+
_b.trys.push([1, 3, , 4]);
|
|
361
|
+
return [4 /*yield*/, prov.deleteGeofences(geofenceIdsInputArray, options)];
|
|
362
|
+
case 2: return [2 /*return*/, _b.sent()];
|
|
363
|
+
case 3:
|
|
364
|
+
error_7 = _b.sent();
|
|
365
|
+
logger.debug(error_7);
|
|
366
|
+
throw error_7;
|
|
219
367
|
case 4: return [2 /*return*/];
|
|
220
368
|
}
|
|
221
369
|
});
|
package/lib/Geo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,0CAI2B;AAC3B,2FAA0F;AAE1F,+BAA6C;AAmB7C,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD;IAQC;QACC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,gCAAa,GAApB;QACC,OAAO,QAAQ,CAAC,MAAM,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,+BAAY,GAAnB,UAAoB,S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AAmB;wBACpD,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;wBAI7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;4BAChC,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;yBACtC;6BAAM;4BACN,qBAAqB,GAAG,WAAW,CAAC;yBACpC;;;;wBAIO,qBAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,OAAO,CAAC,EAAA;4BAAjE,sBAAO,SAA0D,EAAC;;;wBAElE,MAAM,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;wBACpB,MAAM,OAAK,CAAC;;;;;KAEb;IAlRM,eAAM,GAAG,KAAK,CAAC;IAmRvB,eAAC;CAAA,AApRD,IAoRC;AApRY,4BAAQ;AAsRR,QAAA,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,cAAO,CAAC,QAAQ,CAAC,WAAG,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, SearchForSuggestionsResults } from '../types';
|
|
1
|
+
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, SearchForSuggestionsResults, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults } from '../types';
|
|
2
2
|
export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
3
3
|
static CATEGORY: string;
|
|
4
4
|
static PROVIDER_NAME: string;
|
|
@@ -58,10 +58,46 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
|
58
58
|
* @returns {Promise<Place>} - Promise that resolves to a place matching search coordinates
|
|
59
59
|
*/
|
|
60
60
|
searchByCoordinates(coordinates: Coordinates, options?: SearchByCoordinatesOptions): Promise<Place>;
|
|
61
|
+
/**
|
|
62
|
+
* Create geofences inside of a geofence collection
|
|
63
|
+
* @param geofences - Array of geofence objects to create
|
|
64
|
+
* @param options? - Optional parameters for creating geofences
|
|
65
|
+
* @returns {Promise<AmazonLocationServiceSaveGeofencesResults>} - Promise that resolves to an object with:
|
|
66
|
+
* successes: list of geofences successfully created
|
|
67
|
+
* errors: list of geofences that failed to create
|
|
68
|
+
*/
|
|
69
|
+
saveGeofences(geofences: GeofenceInput[], options?: AmazonLocationServiceGeofenceOptions): Promise<SaveGeofencesResults>;
|
|
70
|
+
/**
|
|
71
|
+
* Get geofence from a geofence collection
|
|
72
|
+
* @param geofenceId:string
|
|
73
|
+
* @param options?: Optional parameters for getGeofence
|
|
74
|
+
* @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object
|
|
75
|
+
*/
|
|
76
|
+
getGeofence(geofenceId: string, options?: AmazonLocationServiceGeofenceOptions): Promise<AmazonLocationServiceGeofence>;
|
|
77
|
+
/**
|
|
78
|
+
* List geofences from a geofence collection
|
|
79
|
+
* @param options?: ListGeofenceOptions
|
|
80
|
+
* @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:
|
|
81
|
+
* entries: list of geofences - 100 geofences are listed per page
|
|
82
|
+
* nextToken: token for next page of geofences
|
|
83
|
+
*/
|
|
84
|
+
listGeofences(options?: AmazonLocationServiceListGeofenceOptions): Promise<ListGeofenceResults>;
|
|
85
|
+
/**
|
|
86
|
+
* Delete geofences from a geofence collection
|
|
87
|
+
* @param geofenceIds: string|string[]
|
|
88
|
+
* @param options?: GeofenceOptions
|
|
89
|
+
* @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:
|
|
90
|
+
* successes: list of geofences successfully deleted
|
|
91
|
+
* errors: list of geofences that failed to delete
|
|
92
|
+
*/
|
|
93
|
+
deleteGeofences(geofenceIds: string[], options?: AmazonLocationServiceGeofenceOptions): Promise<AmazonLocationServiceDeleteGeofencesResults>;
|
|
61
94
|
/**
|
|
62
95
|
* @private
|
|
63
96
|
*/
|
|
64
97
|
private _ensureCredentials;
|
|
65
98
|
private _verifyMapResources;
|
|
66
99
|
private _verifySearchIndex;
|
|
100
|
+
private _verifyGeofenceCollections;
|
|
101
|
+
private _AmazonLocationServiceBatchPutGeofenceCall;
|
|
102
|
+
private _AmazonLocationServiceBatchDeleteGeofenceCall;
|
|
67
103
|
}
|