File tree 2 files changed +43
-8
lines changed
2 files changed +43
-8
lines changed Original file line number Diff line number Diff line change 3
3
/build
4
4
erl_crash.dump
5
5
.DS_Store
6
+ main.gleam
Original file line number Diff line number Diff line change 7
7
gleam add aws_request@1
8
8
```
9
9
``` gleam
10
- import aws_request
10
+ import aws_request/config
11
+ import aws_request/service/dynamodb
12
+ import gleam/bit_array
13
+ import gleam/httpc
14
+ import gleam/result
11
15
12
16
pub fn main() {
13
- // TODO: An example of the project in use
14
- }
15
- ```
17
+ let assert Ok(dynamo_client) =
18
+ config.new()
19
+ |> config.with_region("us-east-1")
20
+ |> config.build
21
+ |> result.map(dynamodb.new)
16
22
17
- Further documentation can be found at < https://hexdocs.pm/aws_request > .
23
+ let body =
24
+ "{
25
+ \"TableName\": \"people\",
26
+ \"Key\": { \"name\": { \"S\": \"Ryan\" } }
27
+ }"
28
+ |> bit_array.from_string
18
29
19
- ## Development
30
+ let response =
31
+ dynamodb.get_item(dynamo_client, body)
32
+ }
33
+ ```
20
34
21
35
``` sh
22
- gleam run # Run the project
23
- gleam test # Run the tests
36
+ Ok(Response(
37
+ 200,
38
+ [
39
+ # ("connection", "keep-alive"),
40
+ # (
41
+ " date" ,
42
+ " Mon, 26 Aug 2024 01:14:37 GMT" ,
43
+ ),
44
+ # ("server", "Server"),
45
+ # ("content-length", "48"),
46
+ # (
47
+ " content-type" ,
48
+ " application/x-amz-json-1.0" ,
49
+ ),
50
+ # (
51
+ " x-amzn-requestid" ,
52
+ " 9UDMAF5C9T46D39RJSCHUB7IMFVV4KQNSO5AEMVJF66Q9ASUAAJG" ,
53
+ ),
54
+ # ("x-amz-crc32", "3152510195"),
55
+ ],
56
+ " {" Item" :{" name" :{" S" :" Ryan" }}}" ,
57
+ ))
24
58
```
You can’t perform that action at this time.
0 commit comments