-
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
1 parent
20bad9b
commit e222528
Showing
76 changed files
with
8,608 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,22 @@ | ||
opam-version: "2.0" | ||
maintainer: "Tim McGilchrist <[email protected]>" | ||
authors: [ "Spiros Eliopoulos <[email protected]>" | ||
"Daniel Patterson <[email protected]>" | ||
"Tim McGilchrist <[email protected]>" | ||
] | ||
synopsis: "Amazon Web Services SDK bindings to Amazon Rekognition" | ||
description: "Amazon Web Services SDK bindings to Amazon Rekognition" | ||
version: "1.1" | ||
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: [ | ||
"aws" {>= "0.1.0"} | ||
"dune" {build} | ||
] |
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_internal | ||
open Aws | ||
type input = CompareFacesRequest.t | ||
type output = CompareFacesResponse.t | ||
type error = Errors_internal.t | ||
let service = "rekognition" | ||
let to_http req = | ||
let uri = | ||
Uri.add_query_params (Uri.of_string "https://rekognition.amazonaws.com") | ||
(List.append | ||
[("Version", ["2016-06-27"]); ("Action", ["CompareFaces"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (CompareFacesRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "CompareFacesResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp CompareFacesResponse.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed CompareFacesResponse." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing CompareFacesResponse - 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_internal | ||
type input = CompareFacesRequest.t | ||
type output = CompareFacesResponse.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,56 @@ | ||
open Types_internal | ||
open Aws | ||
type input = CreateCollectionRequest.t | ||
type output = CreateCollectionResponse.t | ||
type error = Errors_internal.t | ||
let service = "rekognition" | ||
let to_http req = | ||
let uri = | ||
Uri.add_query_params (Uri.of_string "https://rekognition.amazonaws.com") | ||
(List.append | ||
[("Version", ["2016-06-27"]); ("Action", ["CreateCollection"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (CreateCollectionRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "CreateCollectionResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp CreateCollectionResponse.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = | ||
"Could not find well formed CreateCollectionResponse." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing CreateCollectionResponse - 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_internal | ||
type input = CreateCollectionRequest.t | ||
type output = CreateCollectionResponse.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_internal | ||
open Aws | ||
type input = CreateStreamProcessorRequest.t | ||
type output = CreateStreamProcessorResponse.t | ||
type error = Errors_internal.t | ||
let service = "rekognition" | ||
let to_http req = | ||
let uri = | ||
Uri.add_query_params (Uri.of_string "https://rekognition.amazonaws.com") | ||
(List.append | ||
[("Version", ["2016-06-27"]); ("Action", ["CreateStreamProcessor"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (CreateStreamProcessorRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "CreateStreamProcessorResponse" (snd xml) in | ||
try | ||
Util.or_error | ||
(Util.option_bind resp CreateStreamProcessorResponse.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = | ||
"Could not find well formed CreateStreamProcessorResponse." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing CreateStreamProcessorResponse - 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_internal | ||
type input = CreateStreamProcessorRequest.t | ||
type output = CreateStreamProcessorResponse.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,56 @@ | ||
open Types_internal | ||
open Aws | ||
type input = DeleteCollectionRequest.t | ||
type output = DeleteCollectionResponse.t | ||
type error = Errors_internal.t | ||
let service = "rekognition" | ||
let to_http req = | ||
let uri = | ||
Uri.add_query_params (Uri.of_string "https://rekognition.amazonaws.com") | ||
(List.append | ||
[("Version", ["2016-06-27"]); ("Action", ["DeleteCollection"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteCollectionRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "DeleteCollectionResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp DeleteCollectionResponse.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = | ||
"Could not find well formed DeleteCollectionResponse." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing DeleteCollectionResponse - 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_internal | ||
type input = DeleteCollectionRequest.t | ||
type output = DeleteCollectionResponse.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,54 @@ | ||
open Types_internal | ||
open Aws | ||
type input = DeleteFacesRequest.t | ||
type output = DeleteFacesResponse.t | ||
type error = Errors_internal.t | ||
let service = "rekognition" | ||
let to_http req = | ||
let uri = | ||
Uri.add_query_params (Uri.of_string "https://rekognition.amazonaws.com") | ||
(List.append [("Version", ["2016-06-27"]); ("Action", ["DeleteFaces"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteFacesRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "DeleteFacesResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp DeleteFacesResponse.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed DeleteFacesResponse." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing DeleteFacesResponse - 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_internal | ||
type input = DeleteFacesRequest.t | ||
type output = DeleteFacesResponse.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,28 @@ | ||
open Types_internal | ||
open Aws | ||
type input = DeleteStreamProcessorRequest.t | ||
type output = unit | ||
type error = Errors_internal.t | ||
let service = "rekognition" | ||
let to_http req = | ||
let uri = | ||
Uri.add_query_params (Uri.of_string "https://rekognition.amazonaws.com") | ||
(List.append | ||
[("Version", ["2016-06-27"]); ("Action", ["DeleteStreamProcessor"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteStreamProcessorRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = `Ok () | ||
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 |
Oops, something went wrong.