Skip to content

Commit

Permalink
Run EMR code gen.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Nov 14, 2020
1 parent f461068 commit c0d5cad
Show file tree
Hide file tree
Showing 64 changed files with 10,117 additions and 5,674 deletions.
2 changes: 1 addition & 1 deletion aws_elasticmapreduce.opam → aws-elasticmapreduce.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ build: [
]
depends: [
"aws" {>= "0.1.0"}
"dune" {build}
"dune"
]
1 change: 0 additions & 1 deletion lib/endpoints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,6 @@ let endpoint_of svc_name region =
| "us-west-1" -> Some "xray.us-west-1.amazonaws.com"
| "us-west-2" -> Some "xray.us-west-2.amazonaws.com"
| _ -> None)

| _ -> None

let url_of svc_name region =
Expand Down
59 changes: 59 additions & 0 deletions libraries/elasticmapreduce/lib/addInstanceFleet.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
open Types
open Aws

type input = AddInstanceFleetInput.t

type output = AddInstanceFleetOutput.t

type error = Errors_internal.t

let service = "elasticmapreduce"

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", [ "2009-03-31" ]; "Action", [ "AddInstanceFleet" ] ]
(Util.drop_empty
(Uri.query_of_encoded (Query.render (AddInstanceFleetInput.to_query req)))))
in
`POST, uri, []

let of_http body =
try
let xml = Ezxmlm.from_string body in
let resp = Xml.member "AddInstanceFleetResponse" (snd xml) in
try
Util.or_error
(Util.option_bind resp AddInstanceFleetOutput.parse)
(let open Error in
BadResponse
{ body; message = "Could not find well formed AddInstanceFleetOutput." })
with Xml.RequiredFieldMissing msg ->
let open Error in
`Error
(BadResponse
{ body
; message =
"Error parsing AddInstanceFleetOutput - 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
10 changes: 10 additions & 0 deletions libraries/elasticmapreduce/lib/addInstanceFleet.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
open Types

type input = AddInstanceFleetInput.t

type output = AddInstanceFleetOutput.t

type error = Errors_internal.t

include
Aws.Call with type input := input and type output := output and type error := error
71 changes: 36 additions & 35 deletions libraries/elasticmapreduce/lib/addInstanceGroups.ml
Original file line number Diff line number Diff line change
@@ -1,58 +1,59 @@
open Types
open Aws

type input = AddInstanceGroupsInput.t

type output = AddInstanceGroupsOutput.t

type error = Errors_internal.t

let service = "elasticmapreduce"

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)))
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region)))
(List.append
[("Version", ["2009-03-31"]); ("Action", ["AddInstanceGroups"])]
[ "Version", [ "2009-03-31" ]; "Action", [ "AddInstanceGroups" ] ]
(Util.drop_empty
(Uri.query_of_encoded
(Query.render (AddInstanceGroupsInput.to_query req))))) in
(`POST, uri, [])
(Uri.query_of_encoded (Query.render (AddInstanceGroupsInput.to_query req)))))
in
`POST, uri, []

let of_http body =
try
let xml = Ezxmlm.from_string body in
let resp = Xml.member "AddInstanceGroupsResponse" (snd xml) in
try
Util.or_error (Util.option_bind resp AddInstanceGroupsOutput.parse)
Util.or_error
(Util.option_bind resp AddInstanceGroupsOutput.parse)
(let open Error in
BadResponse
{
body;
message =
"Could not find well formed AddInstanceGroupsOutput."
})
with
| Xml.RequiredFieldMissing msg ->
let open Error in
`Error
(BadResponse
{
body;
message =
("Error parsing AddInstanceGroupsOutput - missing field in body or children: "
^ msg)
})
with
| Failure msg ->
BadResponse
{ body; message = "Could not find well formed AddInstanceGroupsOutput." })
with Xml.RequiredFieldMissing msg ->
let open Error in
`Error
(let open Error in
BadResponse { body; message = ("Error parsing xml: " ^ msg) })
(BadResponse
{ body
; message =
"Error parsing AddInstanceGroupsOutput - 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.InternalFailure] @ Errors_internal.common in
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))
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
| None -> None
7 changes: 5 additions & 2 deletions libraries/elasticmapreduce/lib/addInstanceGroups.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
open Types

type input = AddInstanceGroupsInput.t

type output = AddInstanceGroupsOutput.t

type error = Errors_internal.t

include
(Aws.Call with type input := input and type output := output and type
error := error)
Aws.Call with type input := input and type output := output and type error := error
69 changes: 35 additions & 34 deletions libraries/elasticmapreduce/lib/addJobFlowSteps.ml
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
open Types
open Aws

type input = AddJobFlowStepsInput.t

type output = AddJobFlowStepsOutput.t

type error = Errors_internal.t

let service = "elasticmapreduce"

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)))
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region)))
(List.append
[("Version", ["2009-03-31"]); ("Action", ["AddJobFlowSteps"])]
[ "Version", [ "2009-03-31" ]; "Action", [ "AddJobFlowSteps" ] ]
(Util.drop_empty
(Uri.query_of_encoded
(Query.render (AddJobFlowStepsInput.to_query req))))) in
(`POST, uri, [])
(Uri.query_of_encoded (Query.render (AddJobFlowStepsInput.to_query req)))))
in
`POST, uri, []

let of_http body =
try
let xml = Ezxmlm.from_string body in
let resp = Xml.member "AddJobFlowStepsResponse" (snd xml) in
try
Util.or_error (Util.option_bind resp AddJobFlowStepsOutput.parse)
Util.or_error
(Util.option_bind resp AddJobFlowStepsOutput.parse)
(let open Error in
BadResponse
{
body;
message = "Could not find well formed AddJobFlowStepsOutput."
})
with
| Xml.RequiredFieldMissing msg ->
let open Error in
`Error
(BadResponse
{
body;
message =
("Error parsing AddJobFlowStepsOutput - missing field in body or children: "
^ msg)
})
with
| Failure msg ->
BadResponse
{ body; message = "Could not find well formed AddJobFlowStepsOutput." })
with Xml.RequiredFieldMissing msg ->
let open Error in
`Error
(let open Error in
BadResponse { body; message = ("Error parsing xml: " ^ msg) })
(BadResponse
{ body
; message =
"Error parsing AddJobFlowStepsOutput - 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.InternalFailure] @ Errors_internal.common in
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))
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
| None -> None
7 changes: 5 additions & 2 deletions libraries/elasticmapreduce/lib/addJobFlowSteps.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
open Types

type input = AddJobFlowStepsInput.t

type output = AddJobFlowStepsOutput.t

type error = Errors_internal.t

include
(Aws.Call with type input := input and type output := output and type
error := error)
Aws.Call with type input := input and type output := output and type error := error
30 changes: 19 additions & 11 deletions libraries/elasticmapreduce/lib/addTags.ml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
open Types
open Aws

type input = AddTagsInput.t

type output = unit

type error = Errors_internal.t

let service = "elasticmapreduce"

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", ["2009-03-31"]); ("Action", ["AddTags"])]
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service region)))
(List.append
[ "Version", [ "2009-03-31" ]; "Action", [ "AddTags" ] ]
(Util.drop_empty
(Uri.query_of_encoded (Query.render (AddTagsInput.to_query req))))) in
(`POST, uri, [])
(Uri.query_of_encoded (Query.render (AddTagsInput.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))
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
| None -> None
7 changes: 5 additions & 2 deletions libraries/elasticmapreduce/lib/addTags.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
open Types

type input = AddTagsInput.t

type output = unit

type error = Errors_internal.t

include
(Aws.Call with type input := input and type output := output and type
error := error)
Aws.Call with type input := input and type output := output and type error := error
Loading

0 comments on commit c0d5cad

Please sign in to comment.