-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Rochel
committed
Jun 17, 2021
1 parent
bda6e1b
commit 17f3af3
Showing
36 changed files
with
5,909 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
opam-version: "2.0" | ||
maintainer: "Tim McGilchrist <[email protected]>" | ||
authors: [ "Jan Rochel <[email protected]>" ] | ||
synopsis: "Amazon Web Services SDK bindings to Amazon DynamoDB" | ||
description: "Amazon Web Services SDK bindings to Amazon DynamoDB" | ||
version: "1.2" | ||
license: "BSD-3-clause" | ||
homepage: "https://github.com/inhabitedtype/ocaml-aws" | ||
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git" | ||
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" | ||
doc: "https://github.com/inhabitedtype/ocaml-aws" | ||
build: [ | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
] | ||
depends: [ | ||
"ocaml" {>= "4.08"} | ||
"aws" {= version} | ||
"dune" {>= "2.7"} | ||
"ounit" {>= "2.2.4" & with-test} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2012-08-10/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
open Types | ||
open Aws | ||
type input = BatchGetItemInput.t | ||
type output = BatchGetItemOutput.t | ||
type error = Errors_internal.t | ||
let service = "dynamodb" | ||
let signature_version = Request.V4 | ||
let to_http service region req = | ||
let uri = | ||
Uri.add_query_params | ||
(Uri.of_string | ||
(Aws.Util.of_option_exn (Endpoints.url_of service region))) | ||
(List.append | ||
[("Version", ["2012-08-10"]); ("Action", ["BatchGetItem"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (BatchGetItemInput.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "BatchGetItemResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp BatchGetItemOutput.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed BatchGetItemOutput." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing BatchGetItemOutput - missing field in body or children: " | ||
^ msg) | ||
}) | ||
with | ||
| Failure msg -> | ||
`Error | ||
(let open Error in | ||
BadResponse { body; message = ("Error parsing xml: " ^ msg) }) | ||
let parse_error code err = | ||
let errors = [] @ Errors_internal.common in | ||
match Errors_internal.of_string err with | ||
| Some var -> | ||
if | ||
(List.mem var errors) && | ||
((match Errors_internal.to_http_code var with | ||
| Some var -> var = code | ||
| None -> true)) | ||
then Some var | ||
else None | ||
| None -> None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
open Types | ||
type input = BatchGetItemInput.t | ||
type output = BatchGetItemOutput.t | ||
type error = Errors_internal.t | ||
include | ||
Aws.Call with type input := input and type output := output and type | ||
error := error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
open Types | ||
open Aws | ||
type input = BatchWriteItemInput.t | ||
type output = BatchWriteItemOutput.t | ||
type error = Errors_internal.t | ||
let service = "dynamodb" | ||
let signature_version = Request.V4 | ||
let to_http service region req = | ||
let uri = | ||
Uri.add_query_params | ||
(Uri.of_string | ||
(Aws.Util.of_option_exn (Endpoints.url_of service region))) | ||
(List.append | ||
[("Version", ["2012-08-10"]); ("Action", ["BatchWriteItem"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (BatchWriteItemInput.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "BatchWriteItemResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp BatchWriteItemOutput.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed BatchWriteItemOutput." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing BatchWriteItemOutput - missing field in body or children: " | ||
^ msg) | ||
}) | ||
with | ||
| Failure msg -> | ||
`Error | ||
(let open Error in | ||
BadResponse { body; message = ("Error parsing xml: " ^ msg) }) | ||
let parse_error code err = | ||
let errors = [] @ Errors_internal.common in | ||
match Errors_internal.of_string err with | ||
| Some var -> | ||
if | ||
(List.mem var errors) && | ||
((match Errors_internal.to_http_code var with | ||
| Some var -> var = code | ||
| None -> true)) | ||
then Some var | ||
else None | ||
| None -> None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
open Types | ||
type input = BatchWriteItemInput.t | ||
type output = BatchWriteItemOutput.t | ||
type error = Errors_internal.t | ||
include | ||
Aws.Call with type input := input and type output := output and type | ||
error := error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
open Types | ||
open Aws | ||
type input = CreateTableInput.t | ||
type output = CreateTableOutput.t | ||
type error = Errors_internal.t | ||
let service = "dynamodb" | ||
let signature_version = Request.V4 | ||
let to_http service region req = | ||
let uri = | ||
Uri.add_query_params | ||
(Uri.of_string | ||
(Aws.Util.of_option_exn (Endpoints.url_of service region))) | ||
(List.append [("Version", ["2012-08-10"]); ("Action", ["CreateTable"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (CreateTableInput.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "CreateTableResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp CreateTableOutput.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed CreateTableOutput." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing CreateTableOutput - missing field in body or children: " | ||
^ msg) | ||
}) | ||
with | ||
| Failure msg -> | ||
`Error | ||
(let open Error in | ||
BadResponse { body; message = ("Error parsing xml: " ^ msg) }) | ||
let parse_error code err = | ||
let errors = [] @ Errors_internal.common in | ||
match Errors_internal.of_string err with | ||
| Some var -> | ||
if | ||
(List.mem var errors) && | ||
((match Errors_internal.to_http_code var with | ||
| Some var -> var = code | ||
| None -> true)) | ||
then Some var | ||
else None | ||
| None -> None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
open Types | ||
type input = CreateTableInput.t | ||
type output = CreateTableOutput.t | ||
type error = Errors_internal.t | ||
include | ||
Aws.Call with type input := input and type output := output and type | ||
error := error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
open Types | ||
open Aws | ||
type input = DeleteItemInput.t | ||
type output = DeleteItemOutput.t | ||
type error = Errors_internal.t | ||
let service = "dynamodb" | ||
let signature_version = Request.V4 | ||
let to_http service region req = | ||
let uri = | ||
Uri.add_query_params | ||
(Uri.of_string | ||
(Aws.Util.of_option_exn (Endpoints.url_of service region))) | ||
(List.append [("Version", ["2012-08-10"]); ("Action", ["DeleteItem"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteItemInput.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "DeleteItemResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp DeleteItemOutput.parse) | ||
(let open Error in | ||
BadResponse | ||
{ body; message = "Could not find well formed DeleteItemOutput." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing DeleteItemOutput - missing field in body or children: " | ||
^ msg) | ||
}) | ||
with | ||
| Failure msg -> | ||
`Error | ||
(let open Error in | ||
BadResponse { body; message = ("Error parsing xml: " ^ msg) }) | ||
let parse_error code err = | ||
let errors = [] @ Errors_internal.common in | ||
match Errors_internal.of_string err with | ||
| Some var -> | ||
if | ||
(List.mem var errors) && | ||
((match Errors_internal.to_http_code var with | ||
| Some var -> var = code | ||
| None -> true)) | ||
then Some var | ||
else None | ||
| None -> None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
open Types | ||
type input = DeleteItemInput.t | ||
type output = DeleteItemOutput.t | ||
type error = Errors_internal.t | ||
include | ||
Aws.Call with type input := input and type output := output and type | ||
error := error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
open Types | ||
open Aws | ||
type input = DeleteTableInput.t | ||
type output = DeleteTableOutput.t | ||
type error = Errors_internal.t | ||
let service = "dynamodb" | ||
let signature_version = Request.V4 | ||
let to_http service region req = | ||
let uri = | ||
Uri.add_query_params | ||
(Uri.of_string | ||
(Aws.Util.of_option_exn (Endpoints.url_of service region))) | ||
(List.append [("Version", ["2012-08-10"]); ("Action", ["DeleteTable"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteTableInput.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "DeleteTableResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp DeleteTableOutput.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed DeleteTableOutput." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing DeleteTableOutput - missing field in body or children: " | ||
^ msg) | ||
}) | ||
with | ||
| Failure msg -> | ||
`Error | ||
(let open Error in | ||
BadResponse { body; message = ("Error parsing xml: " ^ msg) }) | ||
let parse_error code err = | ||
let errors = [] @ Errors_internal.common in | ||
match Errors_internal.of_string err with | ||
| Some var -> | ||
if | ||
(List.mem var errors) && | ||
((match Errors_internal.to_http_code var with | ||
| Some var -> var = code | ||
| None -> true)) | ||
then Some var | ||
else None | ||
| None -> None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
open Types | ||
type input = DeleteTableInput.t | ||
type output = DeleteTableOutput.t | ||
type error = Errors_internal.t | ||
include | ||
Aws.Call with type input := input and type output := output and type | ||
error := error |
Oops, something went wrong.