Skip to content

Commit 722a3d0

Browse files
authored
Merge branch 'main' into prompts
2 parents 5f5b3dc + a122e6b commit 722a3d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1964
-5
lines changed

.doc_gen/metadata/location_metadata.yaml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ location_Hello:
2323
- description:
2424
snippet_tags:
2525
- location.java2.hello.main
26+
JavaScript:
27+
versions:
28+
- sdk_version: 3
29+
github: javascriptv3/example_code/location/
30+
sdkguide:
31+
excerpts:
32+
- description:
33+
snippet_tags:
34+
- javascript.v3.location.hello
2635
services:
2736
location: {ListGeofencesPaginator}
2837
location_CreateMap:
@@ -36,6 +45,15 @@ location_CreateMap:
3645
- description:
3746
snippet_tags:
3847
- location.kotlin.create.map.main
48+
JavaScript:
49+
versions:
50+
- sdk_version: 3
51+
github: javascriptv3/example_code/location/actions
52+
sdkguide:
53+
excerpts:
54+
- description:
55+
snippet_tags:
56+
- location.JavaScript.map.createMapV3
3957
Java:
4058
versions:
4159
- sdk_version: 2
@@ -80,6 +98,15 @@ location_CreateGeofenceCollection:
8098
- description:
8199
snippet_tags:
82100
- location.kotlin.create.collection.main
101+
JavaScript:
102+
versions:
103+
- sdk_version: 3
104+
github: javascriptv3/example_code/location/actions
105+
sdkguide:
106+
excerpts:
107+
- description:
108+
snippet_tags:
109+
- location.JavaScript.geofence.createCollectionV3
83110
Java:
84111
versions:
85112
- sdk_version: 2
@@ -102,6 +129,15 @@ location_PutGeofence:
102129
- description:
103130
snippet_tags:
104131
- location.kotlin.put.geo.main
132+
JavaScript:
133+
versions:
134+
- sdk_version: 3
135+
github: javascriptv3/example_code/location/actions
136+
sdkguide:
137+
excerpts:
138+
- description:
139+
snippet_tags:
140+
- location.JavaScript.geofence.putV3
105141
Java:
106142
versions:
107143
- sdk_version: 2
@@ -124,6 +160,15 @@ location_CreateTracker:
124160
- description:
125161
snippet_tags:
126162
- location.kotlin.create.tracker.main
163+
JavaScript:
164+
versions:
165+
- sdk_version: 3
166+
github: javascriptv3/example_code/location/actions
167+
sdkguide:
168+
excerpts:
169+
- description:
170+
snippet_tags:
171+
- location.JavaScript.tracker.createTrackerV3
127172
Java:
128173
versions:
129174
- sdk_version: 2
@@ -146,6 +191,15 @@ location_BatchUpdateDevicePosition:
146191
- description:
147192
snippet_tags:
148193
- location.kotlin.update.device.position.main
194+
JavaScript:
195+
versions:
196+
- sdk_version: 3
197+
github: javascriptv3/example_code/location/actions
198+
sdkguide:
199+
excerpts:
200+
- description:
201+
snippet_tags:
202+
- location.JavaScript.device.batchUpdatePositionV3
149203
Java:
150204
versions:
151205
- sdk_version: 2
@@ -168,6 +222,15 @@ location_GetDevicePosition:
168222
- description:
169223
snippet_tags:
170224
- location.kotlin.get.device.position.main
225+
JavaScript:
226+
versions:
227+
- sdk_version: 3
228+
github: javascriptv3/example_code/location/actions
229+
sdkguide:
230+
excerpts:
231+
- description:
232+
snippet_tags:
233+
- location.JavaScript.position.getDevicePositionV3
171234
Java:
172235
versions:
173236
- sdk_version: 2
@@ -190,6 +253,15 @@ location_CreateRouteCalculator:
190253
- description:
191254
snippet_tags:
192255
- location.kotlin.create.calculator.main
256+
JavaScript:
257+
versions:
258+
- sdk_version: 3
259+
github: javascriptv3/example_code/location/actions
260+
sdkguide:
261+
excerpts:
262+
- description:
263+
snippet_tags:
264+
- location.JavaScript.routes.createRouteCalcV3
193265
Java:
194266
versions:
195267
- sdk_version: 2
@@ -212,6 +284,15 @@ location_CalculateRoute:
212284
- description:
213285
snippet_tags:
214286
- location.kotlin.calc.distance.main
287+
JavaScript:
288+
versions:
289+
- sdk_version: 3
290+
github: javascriptv3/example_code/location/actions
291+
sdkguide:
292+
excerpts:
293+
- description:
294+
snippet_tags:
295+
- location.JavaScript.distance.createDistAsyncV3
215296
Java:
216297
versions:
217298
- sdk_version: 2
@@ -234,6 +315,15 @@ location_DeleteGeofenceCollection:
234315
- description:
235316
snippet_tags:
236317
- location.kotlin.delete.collection.main
318+
JavaScript:
319+
versions:
320+
- sdk_version: 3
321+
github: javascriptv3/example_code/location/actions
322+
sdkguide:
323+
excerpts:
324+
- description:
325+
snippet_tags:
326+
- location.JavaScript.geofence.deleteCollectionV3
237327
Java:
238328
versions:
239329
- sdk_version: 2
@@ -278,6 +368,15 @@ location_DeleteMap:
278368
- description:
279369
snippet_tags:
280370
- location.kotlin.delete.map.main
371+
JavaScript:
372+
versions:
373+
- sdk_version: 3
374+
github: javascriptv3/example_code/location/actions
375+
sdkguide:
376+
excerpts:
377+
- description:
378+
snippet_tags:
379+
- location.JavaScript.geofence.deleteMapV3
281380
Java:
282381
versions:
283382
- sdk_version: 2
@@ -300,6 +399,15 @@ location_DeleteTracker:
300399
- description:
301400
snippet_tags:
302401
- location.kotlin.delete.tracker.main
402+
JavaScript:
403+
versions:
404+
- sdk_version: 3
405+
github: javascriptv3/example_code/location/actions
406+
sdkguide:
407+
excerpts:
408+
- description:
409+
snippet_tags:
410+
- location.JavaScript.tracker.deleteTrackerV3
303411
Java:
304412
versions:
305413
- sdk_version: 2
@@ -322,6 +430,15 @@ location_DeleteRouteCalculator:
322430
- description:
323431
snippet_tags:
324432
- location.kotlin.delete.calculator.main
433+
JavaScript:
434+
versions:
435+
- sdk_version: 3
436+
github: javascriptv3/example_code/location/actions
437+
sdkguide:
438+
excerpts:
439+
- description:
440+
snippet_tags:
441+
- location.JavaScript.calculator.deleteRouteCalculatorV3
325442
Java:
326443
versions:
327444
- sdk_version: 2
@@ -370,5 +487,14 @@ location_Scenario:
370487
- description: A wrapper class for &ALlong; SDK methods.
371488
snippet_tags:
372489
- location.java2.actions.main
490+
JavaScript:
491+
versions:
492+
- sdk_version: 3
493+
github: javascriptv3/example_code/location/scenarios
494+
sdkguide:
495+
excerpts:
496+
- description:
497+
snippet_tags:
498+
- LocationServices.javascriptv3.Scenario.basics
373499
services:
374500
location: {}

.doc_gen/metadata/sfn_metadata.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ sfn_GetActivityTask:
437437
- description:
438438
snippet_tags:
439439
- stepfunctions.java2.activity_task.main
440-
- StepFunctions.dotnetv3.StopExecution
441440
Python:
442441
versions:
443442
- sdk_version: 3

.tools/readmes/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ python -m venv .venv
1717
1818
# Windows
1919
.venv\Scripts\activate
20+
python -m pip install -r requirements_freeze.txt
2021
2122
# Linux or MacOS
2223
source .venv/bin/activate
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Amazon Location code examples for the SDK for JavaScript (v3)
2+
3+
## Overview
4+
5+
Shows how to use the AWS SDK for JavaScript (v3) to work with Amazon Location Service.
6+
7+
<!--custom.overview.start-->
8+
<!--custom.overview.end-->
9+
10+
_Amazon Location lets you easily and securely add maps, places, routes, geofences, and trackers, to your applications._
11+
12+
## ⚠ Important
13+
14+
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
15+
* Running the tests might result in charges to your AWS account.
16+
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
17+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
18+
19+
<!--custom.important.start-->
20+
<!--custom.important.end-->
21+
22+
## Code examples
23+
24+
### Prerequisites
25+
26+
For prerequisites, see the [README](../../README.md#Prerequisites) in the `javascriptv3` folder.
27+
28+
29+
<!--custom.prerequisites.start-->
30+
<!--custom.prerequisites.end-->
31+
32+
### Get started
33+
34+
- [Hello Amazon Location](hello.js#L4) (`ListGeofencesPaginator`)
35+
36+
37+
### Basics
38+
39+
Code examples that show you how to perform the essential operations within a service.
40+
41+
- [Learn the basics](scenarios/location-service-basics.js)
42+
43+
44+
### Single actions
45+
46+
Code excerpts that show you how to call individual service functions.
47+
48+
- [BatchUpdateDevicePosition](actions/batch-update-device-position.js#L4)
49+
- [CalculateRoute](actions/calculate-distance-async.js#L4)
50+
- [CreateGeofenceCollection](actions/create-geofence-collection.js#L4)
51+
- [CreateMap](actions/create-map.js#L4)
52+
- [CreateRouteCalculator](actions/create-route-calculator.js#L4)
53+
- [CreateTracker](actions/create-tracker.js#L4)
54+
- [DeleteGeofenceCollection](actions/delete-geofence-collection.js#L4)
55+
- [DeleteMap](actions/delete-map.js#L4)
56+
- [DeleteRouteCalculator](actions/delete-route-calculator.js#L4)
57+
- [DeleteTracker](actions/delete-tracker.js#L4)
58+
- [GetDevicePosition](actions/get-device-position.js#L4)
59+
- [PutGeofence](actions/put-geofence.js#L4)
60+
61+
62+
<!--custom.examples.start-->
63+
<!--custom.examples.end-->
64+
65+
## Run the examples
66+
67+
### Instructions
68+
69+
**Note**: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
70+
[JavaScript ES6/CommonJS syntax](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html).
71+
72+
**Run a single action**
73+
74+
```bash
75+
node ./actions/<fileName>
76+
```
77+
78+
**Run a scenario**
79+
80+
Most scenarios can be run with the following command:
81+
```bash
82+
node ./scenarios/<fileName>
83+
```
84+
85+
**Run with options**
86+
87+
Some actions and scenarios can be run with options from the command line:
88+
```bash
89+
node ./scenarios/<fileName> --option1 --option2
90+
```
91+
[util.parseArgs](https://nodejs.org/api/util.html#utilparseargsconfig) is used to configure
92+
these options. For the specific options available to each script, see the `parseArgs` usage
93+
for that file.
94+
95+
<!--custom.instructions.start-->
96+
<!--custom.instructions.end-->
97+
98+
#### Hello Amazon Location
99+
100+
This example shows you how to get started using Amazon Location.
101+
102+
```bash
103+
node ./hello.js
104+
```
105+
106+
#### Learn the basics
107+
108+
This example shows you how to do the following:
109+
110+
- Create an Amazon Location map.
111+
- Create an Amazon Location API key.
112+
- Display Map URL.
113+
- Create a geofence collection.
114+
- Store a geofence geometry.
115+
- Create a tracker resource.
116+
- Update the position of a device.
117+
- Retrieve the most recent position update for a specified device.
118+
- Create a route calculator.
119+
- Determine the distance between Seattle and Vancouver.
120+
- Use Amazon Location higher level APIs.
121+
- Delete the Amazon Location Assets.
122+
123+
<!--custom.basic_prereqs.location_Scenario.start-->
124+
<!--custom.basic_prereqs.location_Scenario.end-->
125+
126+
127+
<!--custom.basics.location_Scenario.start-->
128+
<!--custom.basics.location_Scenario.end-->
129+
130+
131+
### Tests
132+
133+
⚠ Running tests might result in charges to your AWS account.
134+
135+
136+
To find instructions for running these tests, see the [README](../../README.md#Tests)
137+
in the `javascriptv3` folder.
138+
139+
140+
141+
<!--custom.tests.start-->
142+
<!--custom.tests.end-->
143+
144+
## Additional resources
145+
146+
- [Amazon Location Developer Guide](https://docs.aws.amazon.com/location/latest/developerguide/what-is.html)
147+
- [Amazon Location API Reference](https://docs.aws.amazon.com/location/latest/APIReference/Welcome.html)
148+
- [SDK for JavaScript (v3) Amazon Location reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/)
149+
150+
<!--custom.resources.start-->
151+
<!--custom.resources.end-->
152+
153+
---
154+
155+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
156+
157+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)