Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AWS Rekognition #60

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ LIBRARIES := \
aws-elasticache \
aws-elasticloadbalancing \
aws-rds \
aws-rekognition \
aws-sdb \
aws-ssm \
aws-sts \
Expand Down
22 changes: 22 additions & 0 deletions aws_rekognition.opam
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}
]
28 changes: 28 additions & 0 deletions input/rekognition/2016-06-27/paginators-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"pagination": {
"ListCollections": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": [
"CollectionIds",
"FaceModelVersions"
]
},
"ListFaces": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "Faces",
"non_aggregate_keys": [
"FaceModelVersion"
]
},
"ListStreamProcessors": {
"result_key": "StreamProcessors",
"output_token": "NextToken",
"input_token": "NextToken",
"limit_key": "MaxResults"
}
}
}
3,237 changes: 3,237 additions & 0 deletions input/rekognition/2016-06-27/service-2.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions input/rekognition/latest
13 changes: 13 additions & 0 deletions input/rekognition/overrides.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"referenceUrl": "https://docs.aws.amazon.com/rekognition/latest/dg/API_Reference.html",
"operationUrl": "https://docs.aws.amazon.com/rekognition/latest/dg/API_",
"libraryName": "aws_rekognition",
"libraryVersion": "0.1.0",
"typeOverrides": {
"DescribeEngineDefaultParametersResult": {
"requiredFields": [
"EngineDefaults"
]
}
}
}
57 changes: 57 additions & 0 deletions libraries/rekognition/lib/compareFaces.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
open Types
open Aws
type input = CompareFacesRequest.t
type output = CompareFacesResponse.t
type error = Errors_internal.t
let service = "rekognition"
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", ["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
7 changes: 7 additions & 0 deletions libraries/rekognition/lib/compareFaces.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
open Types
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
58 changes: 58 additions & 0 deletions libraries/rekognition/lib/createCollection.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
open Types
open Aws
type input = CreateCollectionRequest.t
type output = CreateCollectionResponse.t
type error = Errors_internal.t
let service = "rekognition"
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", ["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
7 changes: 7 additions & 0 deletions libraries/rekognition/lib/createCollection.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
open Types
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
59 changes: 59 additions & 0 deletions libraries/rekognition/lib/createStreamProcessor.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
open Types
open Aws
type input = CreateStreamProcessorRequest.t
type output = CreateStreamProcessorResponse.t
type error = Errors_internal.t
let service = "rekognition"
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", ["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
7 changes: 7 additions & 0 deletions libraries/rekognition/lib/createStreamProcessor.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
open Types
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
58 changes: 58 additions & 0 deletions libraries/rekognition/lib/deleteCollection.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
open Types
open Aws
type input = DeleteCollectionRequest.t
type output = DeleteCollectionResponse.t
type error = Errors_internal.t
let service = "rekognition"
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", ["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
7 changes: 7 additions & 0 deletions libraries/rekognition/lib/deleteCollection.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
open Types
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
Loading