File tree 2 files changed +44
-8
lines changed
2 files changed +44
-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
+ |> httpc.send_bits
33
+ }
34
+ ```
20
35
21
36
``` sh
22
- gleam run # Run the project
23
- gleam test # Run the tests
37
+ Ok(Response(
38
+ 200,
39
+ [
40
+ # ("connection", "keep-alive"),
41
+ # (
42
+ " date" ,
43
+ " Mon, 26 Aug 2024 01:14:37 GMT" ,
44
+ ),
45
+ # ("server", "Server"),
46
+ # ("content-length", "48"),
47
+ # (
48
+ " content-type" ,
49
+ " application/x-amz-json-1.0" ,
50
+ ),
51
+ # (
52
+ " x-amzn-requestid" ,
53
+ " 9UDMAF5C9T46D39RJSCHUB7IMFVV4KQNSO5AEMVJF66Q9ASUAAJG" ,
54
+ ),
55
+ # ("x-amz-crc32", "3152510195"),
56
+ ],
57
+ " {" Item" :{" name" :{" S" :" Ryan" }}}" ,
58
+ ))
24
59
```
You can’t perform that action at this time.
0 commit comments