Skip to content

Commit

Permalink
Run code generation for AWS Lambda.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Apr 13, 2021
1 parent a0ab9b8 commit 47ee5b4
Show file tree
Hide file tree
Showing 41 changed files with 3,187 additions and 0 deletions.
58 changes: 58 additions & 0 deletions libraries/lambda/lib/addPermission.ml
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
7 changes: 7 additions & 0 deletions libraries/lambda/lib/addPermission.mli
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
61 changes: 61 additions & 0 deletions libraries/lambda/lib/createEventSourceMapping.ml
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
7 changes: 7 additions & 0 deletions libraries/lambda/lib/createEventSourceMapping.mli
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
58 changes: 58 additions & 0 deletions libraries/lambda/lib/createFunction.ml
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
7 changes: 7 additions & 0 deletions libraries/lambda/lib/createFunction.mli
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
61 changes: 61 additions & 0 deletions libraries/lambda/lib/deleteEventSourceMapping.ml
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
7 changes: 7 additions & 0 deletions libraries/lambda/lib/deleteEventSourceMapping.mli
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
31 changes: 31 additions & 0 deletions libraries/lambda/lib/deleteFunction.ml
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
7 changes: 7 additions & 0 deletions libraries/lambda/lib/deleteFunction.mli
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
6 changes: 6 additions & 0 deletions libraries/lambda/lib/dune
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))
Loading

0 comments on commit 47ee5b4

Please sign in to comment.