-
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
fcf17c7
commit bb70eee
Showing
41 changed files
with
3,187 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
open Types | ||
open Aws | ||
type input = AddPermissionRequest.t | ||
type output = AddPermissionResponse.t | ||
type error = Errors_internal.t | ||
let service = "lambda" | ||
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", ["2015-03-31"]); ("Action", ["AddPermission"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (AddPermissionRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "AddPermissionResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp AddPermissionResponse.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed AddPermissionResponse." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing AddPermissionResponse - 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 = AddPermissionRequest.t | ||
type output = AddPermissionResponse.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,61 @@ | ||
open Types | ||
open Aws | ||
type input = CreateEventSourceMappingRequest.t | ||
type output = EventSourceMappingConfiguration.t | ||
type error = Errors_internal.t | ||
let service = "lambda" | ||
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", ["2015-03-31"]); | ||
("Action", ["CreateEventSourceMapping"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (CreateEventSourceMappingRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "CreateEventSourceMappingResponse" (snd xml) in | ||
try | ||
Util.or_error | ||
(Util.option_bind resp EventSourceMappingConfiguration.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = | ||
"Could not find well formed EventSourceMappingConfiguration." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing EventSourceMappingConfiguration - 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 = CreateEventSourceMappingRequest.t | ||
type output = EventSourceMappingConfiguration.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 = CreateFunctionRequest.t | ||
type output = FunctionConfiguration.t | ||
type error = Errors_internal.t | ||
let service = "lambda" | ||
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", ["2015-03-31"]); ("Action", ["CreateFunction"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (CreateFunctionRequest.to_query req))))) in | ||
(`POST, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "CreateFunctionResponse" (snd xml) in | ||
try | ||
Util.or_error (Util.option_bind resp FunctionConfiguration.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = "Could not find well formed FunctionConfiguration." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing FunctionConfiguration - 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 = CreateFunctionRequest.t | ||
type output = FunctionConfiguration.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,61 @@ | ||
open Types | ||
open Aws | ||
type input = DeleteEventSourceMappingRequest.t | ||
type output = EventSourceMappingConfiguration.t | ||
type error = Errors_internal.t | ||
let service = "lambda" | ||
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", ["2015-03-31"]); | ||
("Action", ["DeleteEventSourceMapping"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteEventSourceMappingRequest.to_query req))))) in | ||
(`DELETE, uri, []) | ||
let of_http body = | ||
try | ||
let xml = Ezxmlm.from_string body in | ||
let resp = Xml.member "DeleteEventSourceMappingResponse" (snd xml) in | ||
try | ||
Util.or_error | ||
(Util.option_bind resp EventSourceMappingConfiguration.parse) | ||
(let open Error in | ||
BadResponse | ||
{ | ||
body; | ||
message = | ||
"Could not find well formed EventSourceMappingConfiguration." | ||
}) | ||
with | ||
| Xml.RequiredFieldMissing msg -> | ||
let open Error in | ||
`Error | ||
(BadResponse | ||
{ | ||
body; | ||
message = | ||
("Error parsing EventSourceMappingConfiguration - 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 = DeleteEventSourceMappingRequest.t | ||
type output = EventSourceMappingConfiguration.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,31 @@ | ||
open Types | ||
open Aws | ||
type input = DeleteFunctionRequest.t | ||
type output = unit | ||
type error = Errors_internal.t | ||
let service = "lambda" | ||
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", ["2015-03-31"]); ("Action", ["DeleteFunction"])] | ||
(Util.drop_empty | ||
(Uri.query_of_encoded | ||
(Query.render (DeleteFunctionRequest.to_query req))))) in | ||
(`DELETE, 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 |
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 = DeleteFunctionRequest.t | ||
type output = unit | ||
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,6 @@ | ||
(library | ||
(name aws_lambda) | ||
(public_name aws-lambda) | ||
(synopsis "aws-AWS Lambda") | ||
(flags (:standard -w -27)) | ||
(libraries aws)) |
Oops, something went wrong.